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不一致,检查所有节点配置是不是都一样哈。我这个问题估计相对奇葩一点。

你可能感兴趣的:(错误解决,redis)