《supervisor官网网址,supervisor安装配置与使用介绍(二)》是由大铁棍娱乐网(www.datiegun.com)编辑为你整理收集在【教育学习】栏目,于2016-04-13 10:38:28整理发布,希望对你有所帮助,可及时向我们反馈。
;autostart=true 是否随supervisord启动而启动
;autorestart=true 进程意外退出后是否自动重启
;startsecs=10 进程持续运行多久才认为是启动成功
;startretries=3 重启失败的连续重试次数
;exitcodes=0,2 若autostart设置为unexpected且监控的进程并非因为supervisord停止而退出,那么如果进程的退出码不在exitcode列表中supervisord将重启进程
;stopsignal=QUIT 杀进程的信号
;stopwaitsecs=10 向进程发出stopsignal后等待OS向supervisord返回SIGCHILD 的时间。若超时则supervisord将使用SIGKILL杀进程
一个Rabbitmq项目中生产者和消费者进程使用supervisor监控的配置情况:(配置中的其他部分略)
[program:worker_for_summary]
command=/home/op1/scripts/rabbitmqclient/worker_for_summary.py
priority=1
log_stderr=true ; if true, log program stderr (def false)
[program:worker_for_detail_all]
command=/home/op1/scripts/rabbitmqclient/worker_for_detail_all.py
priority=1
log_stderr=true ; if true, log program stderr (def false)
[program:worker_for_detail_recent_list]
command=/home/op1/scripts/rabbitmqclient/worker_for_detail_recent_list.py
priority=1
log_stderr=true ; if true, log program stderr (def false)
[program:worker_for_detail_recent_sset]
command=/home/op1/scripts/rabbitmqclient/worker_for_detail_recent_sset.py
priority=1
log_stderr=true ; if true, log program stderr (def false)
[program:publisher_for_summary]
command=/home/op1/scripts/rabbitmqclient/publisher_for_summary.py
priority=999
log_stderr=true ; if true, log program stderr (def false)
[program:publisher_for_summary_nt]
command=/home/op1/scripts/rabbitmqclient/publisher_for_summary_nt.py
priority=999
log_stderr=true ; if true, log program stderr (def false)
[program:publisher_for_detail]
command=/home/op1/scripts/rabbitmqclient/publisher_for_detail.py
priority=999
log_stderr=true ; if true, log program stderr (def false)
[program:publisher_for_detail_nt]
command=/home/op1/scripts/rabbitmqclient/publisher_for_detail_nt.py
priority=999
log_stderr=true ; if true, log program stderr (def false)
配置完成后启动supervisord'
sudo /etc/init.d/supervisord start
可以看到配置的各个进程在后台运行了起来。
停掉某个进程后supervisor会马上重启该进程
停止supervisor
sudo /etc/init.d/supervisord stop
可以看到配置的各个进程都停止运行了。