1、查询原因
Linux对打开文件的数量有限制,使用如下命令查看到的最大文件数量是1024,命令如下:
ulimit -a
2、解决方案
(1)方案一(临时方案)
使用命令修改可以打开的最大文件数,但是机器重启后,就会失效
ulimit -n 65535
(2)方案二
修改配置文件
在 /etc/security/limits.conf 文件的最后增加如下内容,重启机器即可。
# End of file
root soft nofile 65535
root hard nofile 65535
* soft nofile 65535
* hard nofile 65535