How to use Supervisor + Django + Celery with multi

2019-03-13 08:42发布

问题:

I'm using Celery + Django + Supervisord and I'm trying to setup a "priority" by creating 3 different queues (as suggested at https://stackoverflow.com/a/15827160/54872).

Is there a way to start celery beat and workers for each queue in one command for supervisor? Or, do I need to make different supervisor conf files for each queue/worker pool and one for celery beat?

回答1:

You can create program sections for each queue and combine them in a group section:

[program:worker1]
command=celery worker --queues=queue1

[program:worker2]
command=celery worker --queues=queue2

[group:workers]
programs=worker1,worker2