当前位置: 移动技术网 > 科技>操作系统>Linux > The user limit for number of open files is too small.

The user limit for number of open files is too small.

2020年05月01日  | 移动技术网科技  | 我要评论

当安装alluxio时,出现允许打开的文件数目过小问题:

the user limit for number of open files is too small. the current value is 4096. for production use, it should be bigger than 16384

解决方法:

#查看当前系统允许打开文件数目
cat /proc/sys/fs/file-max
#查看用户可以打开的文件数目
# check hard limit in linux
ulimit -hn
# check soft limits in linux
ulimit -sn

#修改系统
sysctl -w fs.file-max=500000 # 临时生效;
vi /etc/sysctl.conf # 永久生效
cat /proc/sys/fs/file-max 验证
sysctl -p # 修改立即生效;

# 修改用户限制
ulimit -hn 16386 #临时生效;退出后失效 vi /etc/security/limits.conf,添加:
* soft nofile 16386
* hard nofile 16386 
确保 /etc/pam.d/login 文件中有:(没有则进行添加)
session required pam_limits.so
重新登录即可;使用ulimit 查看变化;

参考链接:

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网