使用supervior 监控 elasticsearch 进程

时间:2021-10-22 23:50:47

elasticsearch引擎在使用中可能会出现后台守护进程挂掉的情况,需要手动启动来恢复正常。

这时则可以引用supervior进程管理工具来监控elasticsearch进程状态,实现进程挂掉自动重启的效果。

vi supervior.conf

 //elasticsearch进程配置
[program:elasticsearch]
command=sh /mnt/elasticsearch-6.3./bin/elasticsearch
stderr_logfile=/var/log/Elastic.err.log
stdout_logfile=/var/log/Elastic.out.log
environment=JAVA_HOME=/usr/bin/java
autostart=true
autorestart=true
startsecs=
numprocs=
user=elastic

ERROR: [1] bootstrap checks failed
[1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

编辑 /etc/security/limits.conf

root soft nofile 65536
root hard nofile 65536
elastic soft nofile 65536
elastic hard nofile 65536