我已经通过本教程安装了elasticsearch @ debian6。 我已经build立了我的系统最大打开文件指令,所以我有这些值:
# su # cat /proc/sys/fs/file-max 70000 # ulimit -Hn 64000 # ulimit -Sn 32000
当我检查elasticsearch max_file_descriptors:
curl -XGET 'http://localhost:9200/_nodes?process=true&pretty=true'
我会得到1024 。
当我用root用户重新启动它时,它现在有“max_file_descriptors”:64000。
那个init.d autostart有什么问题? 当我检查htop时,由init.d用这个1024个描述符自动启动的弹性在root用户下也是runnig。
我已经设置最大的文件打开2 confs:
cat /etc/sysctl.conf ... fs.file-max = 70000 cat /etc/security/limits.conf ... * soft nofile 32000 * hard nofile 64000 root soft nofile 32000 root hard nofile 64000
/etc/security/limits.conf的设置通常由pam_limits PAM模块应用。 init启动的服务不会在PAM会话下运行,因此这些设置不适用。 我发现设置这个唯一可靠的方法是从initscript本身运行ulimit 。 编辑ElasticSearch initscript并在顶部附近添加如下内容:
ulimit -n 64000
我不确定你想要设置sys.file-max BTW; 在我的系统上它默认为779149,所以你可能会减less一个数量级。