我使用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
答案 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