简体   繁体   中英

Migrate Celery Tasks from Redis to RabbitMQ

I'm changing my Celery backend from redis to rabbitmq. I can get the new broker working with changing my BROKER_URL. However I'm wondering how to migrate existing scheduled tasks from redis to rabbitmq broker?

I would like to do this by Python script if possible.

Celery provides following commands by default.

celery -b "redis://<url>:<port>/<db>" inspect scheduled > scheduled_tasks.txt
celery migrate "redis://<url>:<port>/<db>" "amqp://<username>:<password>@<url>:<port>/<vhost>"
celery -b "amqp://<username>:<password>@<url>:<port>/<vhost>" inspect scheduled  > post_migration_scheduled_tasks.txt
diff scheduled_tasks.txt post_migration_scheduled_tasks.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM