我正在使用Fabric部署一个Celery代理(运行RabbitMQ)和多个Celery工作者,celeryd并通过守护进程supervisor.我不能为我的生活弄清楚如何重新加载tasks.py模块,而不是重新启动服务器.
/etc/supervisor/conf.d/celeryd.conf
[program:celeryd]
directory=/fab-mrv/celeryd
environment=[RABBITMQ crendentials here]
command=xvfb-run celeryd --loglevel=INFO --autoreload
autostart=true
autorestart=true
Run Code Online (Sandbox Code Playgroud)
celeryconfig.py
import os
## Broker settings
BROKER_URL = "amqp://%s:%s@hostname" % (os.environ["RMQU"], os.environ["RMQP"])
# List of modules to import when celery starts.
CELERY_IMPORTS = ("tasks", )
## Using the database to store task state and results.
CELERY_RESULT_BACKEND = "amqp"
CELERYD_POOL_RESTARTS = True
Run Code Online (Sandbox Code Playgroud)
附加信息
celery --version 3.0.19(Chiastic Slide)python --version 2.7.3lsb_release -a Ubuntu 12.04.2 LTSrabbitmqctl status ...... 2.7.1 ......以下是我尝试过的一些事情: