ElasticSearch 安装启动报错max file descriptors [32768] for elasticsearch process is too low, increase to at least [65535]
1.启动报错
ES集群初次安装部署,启动的时候
ERROR: bootstrap checks failed
max file descriptors [32768] for elasticsearch process is too low, increase to at least [65535]
![在这里插入图片描述](https://img-blog.csdnimg.cn/ee91877f7db341fb99a400f8f594f351.png)
2.原因分析
从字面意思理解就是当前启动ES进程的linux 用户,打开的文件句柄数最大只有32768,文件句柄数,可直接决定ES建立的TCP连接数,因此,ES建议将此值增大到65536。
接下来按照提示,设置ulimit 用户可打开文件句柄限制数。
3.解决方法
3.1 设置limits.conf
vim /etc/security/limits.conf
建议把下面两项都设置为65535
* soft nofile 65535
* hard nofile 65535
保险起见修改过配置后,退出ssh,再重新登录。
使用ulimit -n 查看当前配置是否生效。
如果不生效,请执行下一步。
3.2 ulimit 设置不生效
*系统ulimit 设置不生效,按网上各种方法设置,均不生效,导致ES使用非root用户启动不成功**.*
原因:ES安装的3台机器上,有安装大数据集群,大数据集群安装时在/etc/security/limits.d/ 目录下,放置了以下配置文件。在 yarn.conf 中限制了xxops,只能open files:32768
-rw-r–r–. 1 root root 832 Oct 10 19:00 hbase.conf
-rw-r–r–. 1 root root 829 Oct 10 19:00 hdfs.conf
-rw-r–r–. 1 root root 828 Oct 10 19:01 hive.conf
-rw-r–r–. 1 root root 830 Oct 10 19:01 mapreduce.conf
-rw-r–r–. 1 root root 828 Oct 10 19:01 yarn.conf
![在这里插入图片描述](https://img-blog.csdnimg.cn/9b5bc3f77e4e4ec488df7189c0ab438d.png)
解决方法:修改/etc/security/limits.d/yarn.conf 中xxops nofile 为65535.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)