Supervisor 安装配置

安装

yum install supervisor

配置

vim /etc/supervisord.d/mchregister.ini
[program:mch-register]
process_name=%(program_name)s_%(process_num)02d
command=/usr/local/php/bin/php /data/wwwroot/platform/mch/artisan queue:work  --quiet --queue=register --delay=3 --sleep=3
autostart=true ; 在supervisord启动的时候也自动启动
autorestart=true ; 在supervisord启动的时候也自动启动
user=apache  ; 用哪个用户启动进程
numprocs=5   ; 开启几个进程
redirect_stderr=true ; 把stderr重定向到stdout,默认false

[program:mch-project]
process_name=%(program_name)s_%(process_num)02d
command=/usr/local/php/bin/php /data/wwwroot/platform/mch/artisan queue:work  --quiet --queue=project --delay=3 --sleep=3
autostart=true
autorestart=true
user=apache
numprocs=8
redirect_stderr=true

[program:mch-settled]
process_name=%(program_name)s_%(process_num)02d
command=/usr/local/php/bin/php /data/wwwroot/platform/mch/artisan queue:work  --quiet --queue=project_settled --delay=3 --sleep=3
autostart=true
autorestart=true
user=apache
numprocs=8
redirect_stderr=true

启动

supervisord -c /etc/supervisord.conf

开机运行

systemctl enable supervisord

运行

supervisorctl reread
supervisorctl update
supervisorctl start mch-register:*
supervisorctl start mch-project:*
supervisorctl start mch-settled:*

文档 http://supervisord.org/introduction.html

参考 https://www.cnblogs.com/xuezhigu/p/7660203.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Captcha Code