我已经通过本教程安装了 elasticsearch@debian6 。我已经设置了我的系统最大打开文件指令,所以我有这些值:
# su
# cat /proc/sys/fs/file-max
70000
# ulimit -Hn
64000
# ulimit -Sn
32000
Run Code Online (Sandbox Code Playgroud)
当我通过以下方式检查 elasticsearch max_file_descriptors 时:
curl -XGET 'http://localhost:9200/_nodes?process=true&pretty=true'
Run Code Online (Sandbox Code Playgroud)
我会得到 1024。
当我用 root 用户重新启动它时,它现在有“max_file_descriptors”:64000。
init.d 自动启动有什么问题?当我检查 htop 时,由 init.d 自动启动的具有 1024 个描述符的弹性也在 root 用户下运行。
我已经设置了 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
Run Code Online (Sandbox Code Playgroud)