CentOS 下 beanstalkd & supervisord & laravel 後臺隊列環境安裝配置

4.2 之前的laravel 不支持 redis 隊列。php

安裝 beanstalkd 和 supervisord:html

下載: http://kr.github.io/beanstalkd/download.htmlpython

tar zxvf beanstalkd-1.9.tar.gz
cd beanstalkd-1.9
make
mv beanstalkd /usr/local/bin/

yum -y install python-setuptools
easy_install supervisor

mkdir /etc/supervisor/
mkdir /etc/supervisor/conf.d
echo_supervisord_conf > /etc/supervisor/supervisord.conf

編輯配置文件:laravel

vi /etc/supervisor/supervisord.conf

最後面添加 :git

[include]
files = /etc/supervisor/conf.d/*.conf

添加 beanstalkd 服務:github

vi etc/supervisor/conf.d/beanstalkd.conf

輸入:redis

[program:beanstalkd]
command = /usr/local/bin/beanstalkd -l 127.0.0.1 -c

添加服務centos

vi /etc/supervisor/conf.d/queue.conf

輸入code

[program:queue]
user = nobody
command = /usr/local/php5.4/bin/php /home/www/artisan queue:listen --timeout=180

下載你係統的*nux服務腳本: https://github.com/Supervisor/initscriptshtm

PS:我centos 選了 : redhat-init-mingalevme

修改裏面的配置文件路徑 改爲

/etc/supervisor/supervisord.conf

啓動服務:

service supervisord start

查看/管理全部服務的狀態:

supervisorctl -c /etc/supervisor/supervisord.conf

done!

相關文章
相關標籤/搜索