Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Celery tries to connect to the wrong broker

I have in my celery configuration

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://[email protected]:5672//: [Errno 111] Connection refused. Trying again in 2.00 seconds...

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

like image 490
BDuelz Avatar asked Apr 23 '13 18:04

BDuelz


1 Answers

import your celery and add your broker like that :

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

This code belongs in celery.py

like image 123
Freelancer Avatar answered Sep 23 '22 03:09

Freelancer