我有我的 celery 配置
BROKER_URL = 'redis://127.0.0.1:6379'
CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379'
然而每当我运行celeryd时,我都会得到这个错误
consumer: Cannot connect to amqp://guest@127.0.0.1:5672//: [Errno 111] Connection refused. Trying again in 2.00 seconds...
为什么它没有连接到我设置的正在运行的 redis 代理?
最佳答案
导入你的 celery 并像这样添加你的经纪人:
celery = Celery('task', broker='redis://127.0.0.1:6379')
celery.config_from_object(celeryconfig)
这段代码属于celery.py
关于python - Celery 尝试连接到错误的代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16176533/