Supervisor的安装与使用
2020-10-12 本文已影响0人
野猪先生XYJ
1.安装supervisor
可以通过python和yum方式安装
2.supervisor的配置
vim /etc/supervisord.conf
http_port=10.13.4.44:9001(解除注释,注释掉默认项)
serverurl=http://10.13.4.44:9001(解除注释,注释掉默认项)
在尾部添加配置:
[[program:nginx](http://programnginx/)]
command = /usr/sbin/nginx -g 'daemon off;'
directory=/usr/sbin ;
autorestart=true ;
autostart=true ;
stderr_logfile=/data0/supervisor/log/error.log ;
stdout_logfile=/data0/supervisor/log/stdout.log ;
environment=ASPNETCORE_ENVIRONMENT=Production ;
user=root ;
stopsignal=INT
startsecs=10 ;
startretries=5 ;
stopasgroup=true
注意:command = xxxxx 空格不能少
3.supervisor常用命令
启动
supervisord -c /etc/supervisord.conf
重新加载
supervisorctl -c /etc/supervisord.conf reload
常用其他命令
supervisorctl start all
supervisorctl status
4.查看监控效果