小编典典

Celery试图连接到错误的经纪人

redis

我的Celery配置中

BROKER_URL = 'redis://127.0.0.1:6379'
CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379'

但是,每当我运行celery时,都会出现此错误

consumer: Cannot connect to amqp://guest@127.0.0.1:5672//: [Errno 111] Connection refused. Trying again in 2.00 seconds...

为什么它不连接到我正在运行的Redis代理,而后者正在运行?


阅读 642

收藏
2020-06-20

共1个答案

小编典典

导入您的Celery并像这样添加您的经纪人:

celery = Celery('task', broker='redis://127.0.0.1:6379')
celery.config_from_object(celeryconfig)

该代码属于celery.py

2020-06-20