supervisor的安装与使用总结

supervisor的安装与使用总结

# vi /etc/supervisord.conf #编辑supervisord.conf配置文件
#在配置文件最后面前,找个可以位置加上下面的配置
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/wwwroot/la.cn/artisan queue::work --sleep=1 --tries=3 --daemon
autostart=true
autorestart=true
user=nobody
numprocs=8
redirect_stderr=true
stdout_logfile=/home/wwwroot/la.cn/storage/logs/queue/worker_log.log
stdout_errfile=/home/wwwroot/la.cn/storage/logs/queue/worker_error.log
[root@localhost storage]# vi /etc/supervisord.conf #编辑supervisord.conf配置文件
[root@localhost storage]# sudo unlink /var/run/supervisor.sock   #删除supervisor.sock,让配置文件生效
[root@localhost storage]# supervisord -c /etc/supervisord.conf   #查询设置配置文件,让配置生效
[root@localhost storage]# supervisorctl start laravel-worker:*  #开启任务
[root@localhost storage]# supervisorctl status #查看supervisorctl运行状态
laravel-worker:laravel-worker_00   FATAL     Exited too quickly (process log may have details)
laravel-worker:laravel-worker_01   FATAL     Exited too quickly (process log may have details)
laravel-worker:laravel-worker_02   FATAL     Exited too quickly (process log may have details)
laravel-worker:laravel-worker_03   FATAL     Exited too quickly (process log may have details)
laravel-worker:laravel-worker_04   FATAL     Exited too quickly (process log may have details)
laravel-worker:laravel-worker_05   FATAL     Exited too quickly (process log may have details)
laravel-worker:laravel-worker_06   FATAL     Exited too quickly (process log may have details)
laravel-worker:laravel-worker_07   FATAL     Exited too quickly (process log may have details)

参考网站:
生产环境中使用 supervisor 运行队列任务:https://learnku.com/laravel/t/2369/production-environment-using-supervisor-run-queue-task
centos6.5安装配置supervisor:https://www.cnblogs.com/sfnz/p/5578417.html
解决unix:///tmp/supervisor.sock no such file的问题:https://blog.51cto.com/6010131/2321726
supervisor 安装、配置、supervisord启动参数、supervisorctl命令参数详解:https://blog.csdn.net/youzi_yun/article/details/84934110

你可能感兴趣的:(laravel,Linux)