使用root用户打开./elasticsearch报错
这是系统为了安全考虑,由于es可以独立接受用户输入的脚本,所以需要单独建立一个用户来运行es
ERROR: bootstrap checks failed
{max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]max number of threads [1024] for user [elk] likely too low, increase to at least [2048]}
用于弹性搜索过程的最大文件描述符[4096]太低,至少增加到[65536]
用户[elk]的最大线程数[1024]过低,请增加到至少[2048]
解决:切换到root用户,编辑limits.conf
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
执行 sysctl -p
单独报max number of threads [1024] for user [elk] likely too low, increase to at least [2048]
解决:切换到root用户,编辑limits.d
vi /etc/security/limits.d/90-nproc.conf
修改 soft nproc 1024修改为 soft nproc 2048
4:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
解决:切换到切换到root用户修改配置sysctl.conf
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p
然后,重新启动elasticsearch,即可启动成功。