think-queue和supervisor笔记

浏览:10782 发布日期:2017/03/02 分类:技术分享 关键字: queue 队列 supervisor
这两天折腾了下队列,记下笔记
think-queue入门:
https://github.com/coolseven/notes/tree/master/thinkphp-queue
centos7安装supervisor
http://www.cnblogs.com/justphp/p/6120201.html
碰到过的坑:
如果按照教程一步步走结果还是出错,比如 unix://xxx.sock错误, 执行一下
supervisord -c /etc/supervisord.conf 就可以了

使用supervisor管理think-queue示例

配置文件 /etc/supervisord.conf 末尾添加以下代码:[program:php]
command= /usr/bin/php think queue:work --queue notify --daemon ; 被监控进程
directory=/home/wwwroot/dlsj.mrpzx.com
;process_name=%(process_num)02d 
;numprocs=5 #启动几个进程
autostart=true ;随着supervisord的启动而启动
autorestart=true ;自动启动
startsecs=1 ;程序重启时候停留在runing状态的秒数
startretries=10 ;启动失败时的最多重试次数
redirect_stderr=true ;重定向stderr到stdout
stdout_logfile=/root/supervisor.log ;stdout文件
值得注意的是 每行的 ; 要跟前面的命令用空格隔开, 不能挨着, 然后注释文字要以;开头, 不能#开头 ,每行 ; 作为命令的结尾
最佳答案
评论( 相关
后面还有条评论,点击查看>>