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

来源:互联网 发布:ubuntu安装firefox 编辑:程序博客网 时间:2024/05/22 16:06

http://segmentfault.com/a/1190000000532561


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

安装 beanstalkd 和 supervisord:

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

tar zxvf beanstalkd-1.9.tar.gzcd beanstalkd-1.9makemv beanstalkd /usr/local/bin/yum -y install python-setuptoolseasy_install supervisormkdir /etc/supervisor/mkdir /etc/supervisor/conf.decho_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 = nobodycommand = /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!


0 0