在同一台服务器上运行多个Django Celery网站 [英] Running multiple Django Celery websites on same server

查看:185
本文介绍了在同一台服务器上运行多个Django Celery网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用apache2虚拟服务器在同一服务器上运行多个Django / apache / wsgi网站。我想使用celery,但是如果我为多个网站启动celeryd,则所有网站都将使用我启动的最后一个celeryd实例的配置(日志,数据库等)。

I'm running multiple Django/apache/wsgi websites on the same server using apache2 virtual servers. And I would like to use celery, but if I start celeryd for multiple websites, all the websites will use the configuration (logs, DB, etc) of the last celeryd instance I started.

是否可以使用多个Celeryd(每个网站一个)或所有所有Celeryd?似乎应该可行,但是我找不到方法。

Is there a way to use multiple Celeryd (one for each website) or one Celeryd for all of them? Seems like it should be doable, but I can't find out how.

推荐答案

这个问题让人头疼,我没有我第一次来这里时没有注意到@Crazyshezy的评论。我只是通过为每个Web应用程序更改 settings.py 中的代理URL来实现这一点。

This problem was a big headache, i didn't noticed @Crazyshezy 's comment when i first came here. I just accomplished this by changing Broker URL in settings.py for each web app.

app1.settings.py >

BROKER_URL = 'redis://localhost:6379/0'

app2.settings.py

BROKER_URL = 'redis://localhost:6379/1'

这篇关于在同一台服务器上运行多个Django Celery网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆