2012-10-11 15 views
1

这是https://github.com/ask/django-celery/blob/master/contrib/supervisord/celeryd.conf提供的文件。我怎样才能运行这个conf文件?如何使用生产中提供的celeryd.conf文件

我使用gunicorn

; ======================================= 
; celeryd supervisor example for Django 
; ======================================= 

[program:celery] 
command=/path/to/project/manage.py celeryd --loglevel=INFO 
directory=/path/to/project 
user=nobody 
numprocs=1 
stdout_logfile=/var/log/celeryd.log 
stderr_logfile=/var/log/celeryd.log 
autostart=true 
autorestart=true 
startsecs=10 

; Need to wait for currently executing tasks to finish at shutdown. 
; Increase this if you have very long running tasks. 
stopwaitsecs = 600 

; if rabbitmq is supervised, set its priority higher 
; so it starts first 
priority=998 

感谢

回答

0

该配置文件不能自行运行运行我的Django应用程序;它用于supervisord

您需要安装supervisord(如果你有点子,使用pip install supervisor),使用create a configuration file for itsudo echo_supervisord_conf > /etc/supervisord.conf,然后复制为Adding a program下supervisord文档中描述的文件中的内容粘贴到上方的supervisord配置文件。

所以基本上运行在shell下:

pip install supervisor 
sudo echo_supervisord_conf > /etc/supervisord.conf 
sudo wget -O - -o /dev/null https://raw.github.com/ask/django-celery/master/contrib/supervisord/celeryd.conf >> /etc/supervisor.conf 
sudo $EDITOR /etc/supervisor.conf 

和编辑配置文件到您的心脏的内容。

+0

忘记提及我正在使用gunicorn运行我的django应用程序 – user1653509

+0

我对Gunicorn并不熟悉,但它似乎与其他任何服务器一样。芹菜和主管与Gunicorn无关,所以我的答案仍然适用。 OTOH,如果你想[监督监督Gunicorn](http://gunicorn.org/deploy.html#supervisor),gunicorn文件告诉你如何做到这一点。我错过了什么吗? – Caspar

+0

不,我刚才提到gunicorn,我会试试你的答案。 – user1653509

相关问题