【问题标题】:Redis authentication when using Redis Sentinel failover [closed]使用 Redis Sentinel 故障转移时的 Redis 身份验证 [关闭]
【发布时间】:2020-12-09 13:12:41
【问题描述】:

我配置了 Redis 和 Redis-Sentinel 以启用自动故障转移。
Redis 有 1 个 master 和 2 个 slave。
有3个哨兵节点。

我为 redis 配置了身份验证,所以在 master 的 redis.conf 文件中添加了这个:

requirepass mypassword  

在从属服务器的 redis.conf 中,这个:

masterauth mypassword   

当我停止主人时,其中一个奴隶成为主人,正如预期的那样。
但是,当我使用 redis-cli 连接到新的主服务器时,我注意到不需要密码。
我预计这是因为新 master 的 redis.conf 文件的值仍然是“masterauth mypassword”,而不是“requirepass mypassword”。

这是预期的行为吗? Redis-Sentinel 不应该配置这个吗?还是我应该在 conf 文件中为新主人设置其他内容以要求身份验证?

【问题讨论】:

    标签: redis redis-sentinel


    【解决方案1】:

    您还应该使用密码配置从节点,即 requirepass mypassword

    从节点从主节点同步数据,但不同步密码。所以需要手动配置。

    【讨论】:

      猜你喜欢
      • 2014-10-12
      • 2015-09-18
      • 2017-11-15
      • 1970-01-01
      • 1970-01-01
      • 2016-01-29
      • 2015-10-15
      • 2017-04-17
      • 1970-01-01
      相关资源
      最近更新 更多