芹菜试图连接到错误的经纪人 [英] Celery tries to connect to the wrong broker

查看:54
本文介绍了芹菜试图连接到错误的经纪人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的芹菜配置

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

但无论何时运行芹菜,都会出现此错误

Yet whenever I run the celeryd, I get this error

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

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

Why is it not connecting to the redis broker I set it up with, which is running btw?

推荐答案

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

import your celery and add your broker like that :

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

此代码属于celery.py

This code belongs in celery.py

这篇关于芹菜试图连接到错误的经纪人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆