【问题标题】:Migrate Celery Tasks from Redis to RabbitMQ将 Celery 任务从 Redis 迁移到 RabbitMQ
【发布时间】:2017-10-29 14:59:23
【问题描述】:

我正在将我的 Celery 后端从 redis 更改为 rabbitmq。我可以让新代理更改我的 BROKER_URL。但是我想知道如何将现有的计划任务从 redis 迁移到 rabbitmq 代理?

如果可能的话,我想通过 Python 脚本来实现。

【问题讨论】:

  • 在寻找这个问题的答案时,您尝试过或挖掘过什么吗?
  • 显然有一个名为“迁移”的芹菜工具。它应该可以解决问题。虽然还不能验证。如果可行,我会对此作出答复。

标签: python redis rabbitmq celery


【解决方案1】:

Celery 默认提供以下命令。

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

【讨论】:

    猜你喜欢
    • 2020-12-18
    • 2022-06-17
    • 2011-07-18
    • 2011-07-17
    • 2018-08-06
    • 2018-10-11
    • 1970-01-01
    • 1970-01-01
    • 2016-12-14
    相关资源
    最近更新 更多