Supervisor管理ELK

1.添加用户
useradd -s /bin/bash -d /home/elk elk
2.将ELK相关文件授权给ELK用户
sudo chown -R elk:elk /usr/share/elasticsearch
sudo chown -R elk:elk /etc/elasticsearch
sudo chown -R elk:elk /etc/elasticsearch
sudo chown -R elk:elk /etc/elasticsearch
sudo chown -R elk:elk /etc/elasticsearch
sudo chown -R elk:elk /etc/elasticsearch
3.添加supervisor配置
[program:elasticsearch]
user = elk
command = /usr/share/elasticsearch/bin/elasticsearch 
process_name=%(program_name)s-%(process_num)s
numprocs=1
autostart=true
autorestart=true
redirect_stderr = true
stdout_logfile_maxbytes=20MB
stdout_logfile_backups=20
stdout_logfile=/data/logs/supervisor/elasticsearch.log
4.在supervisor运行报错
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
需要在/etc/supervisor/supervisord.conf
添加
[supervisord]
minfds=65536
minprocs=32768


Tagged , . Bookmark the permalink.

Comments are closed.