Redis6 Cluster,Unable to AUTH to MASTER: -WRONGPASS invalid username-password pair or user is disabl

又是个悲催的故事,redis的4种集群模式,最终考虑选择了redis cluster,这种模式是当前最优选择,之前的哨兵之类各种问题和性能比较完,感觉redis cluster是个不错的方案。

其实redis把cluster的部署方式做得很好了,但奈何总有一些奇奇怪怪的问题。

配置就不铺了,网上一堆。导致这个问题的原因,其实到头来还是要怪自己,之前我一直用着哨兵模式,里面有个masteruser的参数,纵观整个redis cluster的部署,其实压根用不着这个参数,它不像哨兵,需要这个参数。

833:C 20 Jun 2023 14:50:16.414 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
833:C 20 Jun 2023 14:50:16.414 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=833, just started
833:C 20 Jun 2023 14:50:16.414 # Configuration loaded
833:M 20 Jun 2023 14:50:16.417 * Increased maximum number of open files to 10032 (it was originally set to 1024).
833:M 20 Jun 2023 14:50:16.417 * monotonic clock: POSIX clock_gettime
833:M 20 Jun 2023 14:50:16.418 * Node configuration loaded, I'm 4816aa797cb47d71a63e8b2e00aa9ff4ace22f61
833:M 20 Jun 2023 14:50:16.420 * Running mode=cluster, port=6406.
833:M 20 Jun 2023 14:50:16.420 # Server initialized
833:M 20 Jun 2023 14:50:16.420 * Ready to accept connections
833:M 20 Jun 2023 14:51:49.451 # configEpoch set to 6 via CLUSTER SET-CONFIG-EPOCH
833:M 20 Jun 2023 14:51:49.542 # IP address for this node updated to 10.10.6.81
833:S 20 Jun 2023 14:51:51.465 * Before turning into a replica, using my own master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.
833:S 20 Jun 2023 14:51:51.465 * Connecting to MASTER 10.10.6.81:6402
833:S 20 Jun 2023 14:51:51.465 * MASTER <-> REPLICA sync started
833:S 20 Jun 2023 14:51:51.466 # Cluster state changed: ok
833:S 20 Jun 2023 14:51:51.466 * Non blocking connect for SYNC fired the event.
833:S 20 Jun 2023 14:51:51.466 * Master replied to PING, replication can continue...
833:S 20 Jun 2023 14:51:51.467 # Unable to AUTH to MASTER: -WRONGPASS invalid username-password pair or user is disabled.
833:S 20 Jun 2023 14:51:51.761 * Connecting to MASTER 10.10.6.81:6402
833:S 20 Jun 2023 14:51:51.761 * MASTER <-> REPLICA sync started
833:S 20 Jun 2023 14:51:51.761 * Non blocking connect for SYNC fired the event.
833:S 20 Jun 2023 14:51:51.761 * Master replied to PING, replication can continue...
833:S 20 Jun 2023 14:51:51.762 # Unable to AUTH to MASTER: -WRONGPASS invalid username-password pair or user is disabled.
833:S 20 Jun 2023 14:51:52.765 * Connecting to MASTER 10.10.6.81:6402
833:S 20 Jun 2023 14:51:52.765 * MASTER <-> REPLICA sync started
833:S 20 Jun 2023 14:51:52.765 * Non blocking connect for SYNC fired the event.
833:S 20 Jun 2023 14:51:52.766 * Master replied to PING, replication can continue...
833:S 20 Jun 2023 14:51:52.766 # Unable to AUTH to MASTER: -WRONGPASS invalid username-password pair or user is disabled.

 Redis6 的acl,默认会有个default账号,就算填不填masteruser这个参数也不会影响,但是,填了masteruser这个参数,主从复制的时候,从节点就会用masteruser这个账号来auth,那就导致cluster的主从复制异常的根本原因!!

当然,这个问题还有个很大众的问题出现方式,就是requirepass,masterauth不一致,检查所有节点配置是不是都一样哈。我这个问题估计相对奇葩一点。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值