返回首页
当前位置: 主页 > 精通Office > Ubuntu教程 >

Centos 7 安装Supervisor管理Laravel Queue

时间:2018-06-29 23:43来源:2018年最新注册送彩金www.zhixing123.cn 编辑:麦田守望者

安装
直接使用 yum进行安装,最好安装3以上的版本

# yum info supervisor
# yum install supervisor
配置
编辑配置文件

# vim /etc/supervisord.conf
在最后面添加下面内容:

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/forge/app.com/artisan queue:work --tries=3
autostart=true
autorestart=true
user=forge //注意这里队列以什么用户权限运行
numprocs=8 //启动多少个进程
redirect_stderr=true
stdout_logfile=/home/forge/app.com/worker.log
执行 supervisord启动supervisord服务。

# supervisord
...
'Supervisord is running as root and it is searching '
...
执行下面命令,启动上面配置好的laravel队列

# supervisorctl start laravel-worker:*
当Job代码变动时,需要重新启动队列

# supervisorctl restart laravel-worker:*
laravel-worker:laravel-worker_00: stopped
laravel-worker:laravel-worker_01: stopped
laravel-worker:laravel-worker_02: stopped
laravel-worker:laravel-worker_03: stopped
laravel-worker:laravel-worker_04: stopped
laravel-worker:laravel-worker_05: stopped
laravel-worker:laravel-worker_06: stopped
laravel-worker:laravel-worker_07: stopped
laravel-worker:laravel-worker_00: started
laravel-worker:laravel-worker_01: started
laravel-worker:laravel-worker_02: started
laravel-worker:laravel-worker_03: started
laravel-worker:laravel-worker_04: started
laravel-worker:laravel-worker_05: started
laravel-worker:laravel-worker_06: started
laravel-worker:laravel-worker_07: started

顶一下
(0)
0%
踩一下
(0)
0%
标签(Tag):CentOS 安装Supervisor管理
------分隔线----------------------------
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码:点击我更换图片
猜你感兴趣
博聚网