美文网首页
Supervisor简单使用

Supervisor简单使用

作者: vins | 来源:发表于2022-03-14 10:24 被阅读0次

1.安装

yum install supervisor

2.启动supervisord

supervisord -c /etc/supervisord.conf

3.新建文件

touch /etc/supervisord.d/example.ini

4.编写example.ini

[program:example]
stopasgroup=true
user=root
directory=/home/wwwroot/example
command=sh /home/wwwroot/example/start.sh
redirect_stderr=true
stdout_logfile=/home/wwwroot/example/nohup.out
stderr_logfile=/home/wwwroot/example/err.log

5.运行

supervisorctl reload

6.查看状态

supervisorctl status

7.常用命令

supervisorctl status              //查看所有进程的状态
supervisorctl stop example       //停止example
supervisorctl start example      //启动example
supervisorctl restart             //重启example
supervisorctl update             //配置文件修改后使用该命令加载新的配置
supervisorctl reload             //重新启动配置中的所有程序

相关文章

网友评论

      本文标题:Supervisor简单使用

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