1

这是https://github.com/ask/django-celery/blob/master/contrib/supervisord/celeryd.conf提供的文件。如何运行这个 conf 文件?

我正在使用 gunicorn 运行我的 django 应用程序

; =======================================
;  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

谢谢

4

1 回答 1

0

该配置文件不能单独运行;它与supervisord一起使用。

您需要安装 supervisord(如果您有 pip,请使用)pip install supervisor为其创建一个配置文件,sudo echo_supervisord_conf > /etc/supervisord.conf然后将上述文件的内容复制粘贴到您的 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

并将配置文件编辑为您喜欢的内容。

于 2012-10-11T06:22:49.130 回答