I have two servers running Celery and one Redis database. They both listen to the same queue as they are meant to divide the "workload". Tasks are queued onto Redis, but it looks like both my Celery servers pick up the task at the same time, hence executing it twice (once on each server.) Is there a way to prevent this with the Redis/Celery setup?

Thank you,

有帮助吗?

解决方案

Each of my servers were using the same name for the celery workers. Since then I've added %h at the end of the worker name (-n my_worker_%h) to show the hostname. This way Celery Flower displays all of the workers in their own line, and there is no confusion more possible.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top