监督laravel 5.1中的队列

时间:2016-03-06 11:22:15

标签: php laravel amazon-web-services laravel-5 supervisord

我使用laravel 5.1和Redis数据库作为队列。我想监督队列:listen命令应用程序托管在AWS中。

对于安装,我使用了以下命令

sudo su -             //it would be root user
easy_install supervisor
echo_supervisord_conf
echo_supervisord_conf > /etc/supervisord.conf
cd /etc
sudo vim supervisord.conf

在底部添加以下行

[program:queue]
command=/usr/bin/php /var/www/html/artisan --env="production" --timeout 240 queue:listen

然后

supervisord -c /etc/supervisord.conf

supervisorctl status

它会生成以下日志 Screenshot of Error log

1 个答案:

答案 0 :(得分:0)

sudo su -             //it would be root user
easy_install supervisor
echo_supervisord_conf
echo_supervisord_conf > /etc/supervisord.conf
sudo vim /etc/supervisord.conf

在文件supervisord.conf

的末尾添加以下代码
[program:queue]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work sqs --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=forge
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/html/storage/logs/supervisord.log

运行以下命令启动

supervisord -c /etc/supervisord.conf                  //To start
supervisorctl status