CentOS 下 beanstalkd & supervisord & laravel 后台队列环境安装配置

4.2 以前的laravel 不支持 redis 队列。

安装 beanstalkd 和 supervisord:

下载: http://kr.github.io/beanstalkd/download.html

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

编辑配置文件:

vi /etc/supervisor/supervisord.conf

最后面添加 :

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

添加 beanstalkd 服务:

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

输入:

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

添加服务

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

输入

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

下载你系统的*nux服务脚本: https://github.com/Supervisor/initscripts

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

修改里面的配置文件路径 改成

/etc/supervisor/supervisord.conf

启动服务:

service supervisord start

查看/管理所有服务的状态:

supervisorctl -c /etc/supervisor/supervisord.conf

done!

    原文作者:qianfeng
    原文地址: https://segmentfault.com/a/1190000000532561
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞