简体   繁体   English

有多个django实例的芹菜

[英]celery with multiple django instances

I'm using several django instances, each in a virtualenv, on the same server. 我在同一台服务器上使用了几个django实例,每个实例都在virtualenv中。 How can I start the celery server and make sure it is always running and updated? 如何启动芹菜服务器并确保它始终运行和更新? Ie after a server restart or code update? 即服务器重启或代码更新后?

The /etc/init.d script and the config file assume a single Django installation. /etc/init.d脚本和配置文件假定单个Django安装。 Do I have to use the ./manage.py celeryd command? 我必须使用./manage.py celeryd命令吗?

Regards Simon 关心西蒙

You should look at django celery. 你应该看看django芹菜。 This allows you to use the manage.py celeryd command for each project in it's own virtualenv. 这允许您在其自己的virtualenv中为每个项目使用manage.py celeryd命令。 You can daemonize these processes with supervisord and manage them individually. 您可以使用supervisord对这些进程进行守护,并单独管理它们。

Check out http://ask.github.com/celery/cookbook/daemonizing.html#supervisord for guidance. 查看http://ask.github.com/celery/cookbook/daemonizing.html#supervisord以获取指导。

If you make changes in tasks.py for celery, then you will have to restart it once to apply changes by running command ./manage.py celeryd start or python manage.py celeryd start --settings=settings for using settings.py as configuration for celery. 如果你在tasks.py中对芹菜进行了更改,那么你必须重新启动它一次以通过运行命令来应用更改./manage.py celeryd startpython manage.py celeryd start --settings=settings使用settings.py as配置芹菜。 It will not be affected by the changes in your projects until you make changes in celery configuration. 在您对芹菜配置​​进行更改之前,它不会受到项目更改的影响。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM