【问题标题】:Setting requirepass on redis throws 'NOAUTH Authentication required'在 redis 上设置 requirepass 会抛出“需要 NOAUTH 身份验证”
【发布时间】:2020-02-22 17:20:58
【问题描述】:

我尝试使用选项设置来提供密码:

CHANNEL_LAYERS = {
    'default': {
        'BACKEND': 'channels_redis.core.RedisChannelLayer',
        'OPTIONS': {
            "PASSWORD": 'pass',               },                                                                                                                                   'CONFIG': {
            'hosts': [('localhost', 6379)],                                                                                                  }
    }
}

尽管如此,还是出错了:

Exception Value: NOAUTH Authentication required.

我发现了以下 SO:

Redis raise error: NOAUTH Authentication required but there is no password setting

但答案在这种情况下没有帮助。

【问题讨论】:

    标签: django nginx redis gunicorn django-channels


    【解决方案1】:

    注意:如果您的密码中有任何特殊符号,则会引发 base 10 错误。您要么必须将密码转换为对 url 友好,要么使用不带特殊字符的密码。

    CHANNEL_LAYERS = {
        "default": {
            "BACKEND": "asgi_redis.RedisChannelLayer",
            "CONFIG": {
                "hosts": [("redis://:mypassword@127.0.0.1:6379/0")],
            },
        },
    }
    

    来自 Discord 和 github issue 的 PanosTrak 的致谢

    【讨论】:

      猜你喜欢
      • 2017-07-17
      • 2019-06-11
      • 2017-02-18
      • 1970-01-01
      • 2016-03-10
      • 2016-03-21
      • 2018-01-22
      • 2017-07-13
      • 2016-01-19
      相关资源
      最近更新 更多