Celery beat + redis with password throws No Auth exception

笑着哭i 提交于 2020-06-26 07:46:00

问题


I am using celery and redis as two services in my docker setup. Configuration is as below:

  redis:
    image: redis:latest
    hostname: redis
    ports:
      - "0.0.0.0:6379:6379"
    command:
      --requirepass PASSWORD

  celeryworker:
    <<: *django
    depends_on:
      - redis
      - postgres
    command: "celery -E -A rhombus.taskapp worker --beat --scheduler redbeat.schedulers:RedBeatScheduler --loglevel INFO --uid taskmaster --concurrency=5"

When I try to build my containers and schedule some jobs once the workers are ready I get an exception

[2018-03-20 04:40:52,082: WARNING/Beat] redis.exceptions.ResponseError: NOAUTH Authentication required.

I have been unable to figure out what else would be required as configuration to get this setup working. Some insights and guidance into the issue is appreciable.

Below is the complete stack trace.


回答1:


If you have authentication for redis, then URI should be in this format.

broker_url = 'redis://user:password@redishost:6379/0'

The URI you mentioned is not a valid redis uri. If you update URI, it should work.

Without authentication, uri should be

broker_url = 'redis://redishost:6379/0'


来源:https://stackoverflow.com/questions/49376540/celery-beat-redis-with-password-throws-no-auth-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!