美文网首页
Supervisor的安装与使用

Supervisor的安装与使用

作者: 野猪先生XYJ | 来源:发表于2020-10-12 18:29 被阅读0次

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.查看监控效果

相关文章

网友评论

      本文标题:Supervisor的安装与使用

      本文链接:https://www.haomeiwen.com/subject/lvjppktx.html