Redoku在Heroku上拒绝连接 [英] Connection refused for Redis on Heroku
问题描述
从其他答案中我可以看出,这表明redis服务器不在线,尽管REDISTOGO_URL似乎配置正确。 p>
在settings.py中:
REDIS_URL = os.getenv('REDISTOGO_URL ','redis:// localhost:6379/0')
在tasks.py中:
from celery import Celery
celery = Celery('tasks',backend = settings.CELERY_RESULT_BACKEND,broker = settings.REDIS_URL)
版本:
celery == 3.0.5
celery-with-redis == 3.0
django-celery == 3.0.4
kombu == 2.3.2
redis == 2.6.0
发现问题。我将芹菜后端配置为字符串'redis'而不是REDIS_URL。
我有:
CELERY_RESULT_BACKEND ='redis'
应该是什么:
CELERY_RESULT_BACKEND = REDIS_URL
德米特里 - 感谢您的帮助。
I'm trying to set up Redis on Heroku as a backend for Celery. I have it working locally but on Heroku, I get this error (after the celery task completes): ConnectionError: Error 111 connecting localhost:6379. Connection refused.
From what I can tell from other answers, that would indicate that the redis server isn't online, though the REDISTOGO_URL seems to be configured properly.
In settings.py:
REDIS_URL = os.getenv('REDISTOGO_URL', 'redis://localhost:6379/0')
In tasks.py:
from celery import Celery
celery = Celery('tasks', backend=settings.CELERY_RESULT_BACKEND, broker=settings.REDIS_URL)
Versions:
celery==3.0.5
celery-with-redis==3.0
django-celery==3.0.4
kombu==2.3.2
redis==2.6.0
Found the problem. I had the celery backend configured to the string 'redis' rather than the REDIS_URL.
What I had:
CELERY_RESULT_BACKEND = 'redis'
What it should be:
CELERY_RESULT_BACKEND = REDIS_URL
Dmitry - appreciate your help.
这篇关于Redoku在Heroku上拒绝连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!