V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ns2250225
V2EX  ›  Python

请教大家: Django 集成了 Celery,怎样分布式部署 worker 啊 👻

  •  
  •   ns2250225 ·
    ns2250225 · 2018-09-20 16:58:34 +08:00 · 2604 次点击
    这是一个创建于 2038 天前的主题,其中的信息可能已经有所发展或是发生改变。
    请教大家:Django 集成了 Celery,怎样分布式部署 worker 啊 👻
    4 条回复    2018-09-20 17:25:50 +08:00
    NaVient
        1
    NaVient  
       2018-09-20 17:10:35 +08:00   ❤️ 1
    配置同一个 broker 共享 broker 就可以了
    ns2250225
        2
    ns2250225  
    OP
       2018-09-20 17:20:29 +08:00
    @NaVient,DjangoA 和 DjangoB,都配置成同一个 broker,周期性任务的话,他们可能会各自执行自己的任务,会产生重复的数据,而且好像没达到分配任务给不同 worker 的目的
    neoblackcap
        3
    neoblackcap  
       2018-09-20 17:24:56 +08:00
    @NaVient 你到底是有多少个 celery beat 实例?
    NaVient
        4
    NaVient  
       2018-09-20 17:25:50 +08:00
    @ns2250225 共用一个 broker 的情况下每个 woker 都是队列的消费者,多处部署仅有一处 worker 能够消费掉消息,不会产生重复的数据
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2687 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 15:09 · PVG 23:09 · LAX 08:09 · JFK 11:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.