max file descriptors [4096] for elasticsearch process is too low
程序员文章站
2022-05-03 16:01:04
...
elasticsearch常见错误汇总
运行elasticsearch一种是 root用户按照官方文档通过rpm安装之后直接可以启动服务。
service elasticsearch start
另一种是在elasticsearch安装目录下直接运行,但是会报错:
[[email protected] elasticsearch]# ./bin/elasticsearch
uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
解决办法是新建一个用户然后再去启动elasticsearch,记得先给这个用户elasticsearch权限。
node validation exception
[1] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
解决方法:
root用户编辑limits.conf
vim /etc/security/limits.conf
最后一行加上
* soft nofile 65536
* hard nofile 65536
保存,然后重新登录后再次启动elasticsearch即可!