Celery beat scheduler providing ability to run multiple celerybeat
instances.
Production level deployment requires redundancy and fault-tolerance environment. Unfortunately Celery doesn't provide periodic tasks scheduling redundancy out of the box. Running multiple celerybeat
instances results multiple scheduled tasks queuing. This package provides synchronized scheduler class with failover support. By default redis
backend used, but developers are free too use their own based on package primitives.
pip install celery-redundant-scheduler
pip install git+https://github.com/MnogoByte/celery-redundant-scheduler.git
-
Setup scheduler synchronization backend:
CELERYBEAT_REDUNDANT_BACKEND_OPTIONS = { 'HOST': 'localhost', 'PORT': 6379, 'DB': 0, 'PASSWORD': 'secret' }
-
Provide
--scheduler=celery_redundant_scheduler:RedundantScheduler
option running yourworker
orbeat
instance.
CELERYBEAT_REDUNDANT_BACKEND_OPTIONS
- redis connection options.CELERYBEAT_REDUNDANT_REDIS_KEYPREFIX
- prefix for redis keys. Default isredundant-scheduler
.CELERYBEAT_REDUNDANT_REDIS_LOCK_EXPIRES
- redis lock timeout. Default is 60 seconds.
- Define subclass of
celery_redundant_scheduler.backends.base:BaseBackend
. - Override back-end interaction methods.
- Provide backend options with
CELERYBEAT_REDUNDANT_BACKEND_OPTIONS
- Claim using your subclass providing
CELERYBEAT_REDUNDANT_BACKEND
setting or environment variable.
BSD - 3