python - Celery 尝试连接到错误的代理

标签 python redis celery celeryd

我有我的 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/

相关文章:

python - 将训练和测试数据保存在文件中

javascript - Redis数据操作

python - python中的Celery构建微服务

python - python如何返回Windows下当前正在处理的文件名

python - 用 HTML 标记替换电子邮件 ID 以在文本中创建超链接

带队列的 Laravel 监听器不执行

python - 将 Celery 与 SQLAlchemy 和 Pyramid 结合使用

python - 如何忽略 Sentry 捕获中的某些 Python 错误

python - 如何使用 Tkinter Entry 像 raw_input

python - 我应该如何处理重叠批处理的 RQ 工作人员