Celery Beat + Redis带有密码抛出没有Auth异常 [英] Celery beat + redis with password throws No Auth exception

查看:410
本文介绍了Celery Beat + Redis带有密码抛出没有Auth异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在docker设置中将celery和redis用作两项服务。配置如下:

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.

推荐答案

如果您对Redis进行身份验证,则URI应该采用这种格式。

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

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

您提到的URI不是有效的redis uri。如果您更新URI,它应该可以使用。

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

未经身份验证的uri应该是

Without authentication, uri should be

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

这篇关于Celery Beat + Redis带有密码抛出没有Auth异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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