
# "system param fs.nr_open should not less than fs.file-max"or"system param net.ipv4.ip_local_port_range should \>=30000"
#### 问题现象
SLB部署失败，日志详细信息提示如下：
- fs.nr_open "system param fs.nr_open should not less than fs.file-max"
  
- net.ipv4.ip_local_range "system param net.ipv4.ip_local_port_range should \>=30000"
  
- ulimit -n "ulimit -n should \>=100000"
  
 
#### 问题分析
SLB从1.4.5版本开始，自动部署前置检查步骤增加了对系统参数配置的校验，以保证SLB部分功能的正常使用。
表1参数说明 
| 参数                          | 防呆触发条件        | 触发动作  |
|:---|:---|:---|
| fs.file-max                 | \<100000      | 不允许启动 |
| fs.nr_open                  | \<fs.file-max | 不允许启动 |
| net.ipv4.ip_local_port_rang | 区间宽度\<3万      | 不允许启动 |
| ulimit -n                   | \<100000      | 不允许启动 |
   
#### 解决方法
1. 系统参数修改 登录SLB实例主机，执行命令**vim /etc/sysctl.conf**，加入以下三行：
   ```
   fs.file-max = 1024000
   fs.nr_open = 1048576
   net.ipv4.ip_local_port_range = 1024 65535
   ```
   
2. 执行命令**/sbin/sysctl -p**，刷新sysctl.conf文件。
3. 执行命令**vim /etc/security/limits.conf** ，加入以下两行：
   ```
   *  soft    nofile   1024000
   *  hard    nofile  1024000
   ```
   
4. 执行命令，**su *os用户*** ，执行**ulimit -n**查看使limits.conf生效。
 
如果只修改/etc/security/limits.conf不起作用，还需要参照上述方法修改/etc/security/limits.d/huawei-nofile.conf文件。
