安装了一个redis (v.3.0.4)主从模型,使用了3个节点(1个主节点和2个从节点),并按照https://www.digitalocean.com/community/tutorials/how-to-configure-a-redis-cluster-on-ubuntu-14-04中的描述对每个节点进行了请求传递,然后按照文章http://blog.commando.io/redis-is-easy-trivial-hard/的描述在每个节点上启动了3个哨兵
在试图扳倒主人之后,哨兵如愿以偿地将其中一名奴隶提升为主人。然后,当老主人再次起来时,它变成了一个奴隶,并识别了一个新的主服务器,这可以在/etc/redis/entinel.conf中看到,它在'sentinel monitor redis-群集‘属性中使用新的主IP更新。但是已经注意到,老主人尽管知道新的主IP,它认为新的主人是向下的,不像其他的奴隶看到它。这可以通过对旧主程序运行此命令来检查:
$redis-cli -a altoros info replication
#
Replication
role:slave
master_host: new master ip
master_port:6379
master_link_status:down当试图使用同步客户端测试节点上的数据复制时,这似乎也导致了以下错误:"MASTERDOWN,并且在尝试使用同步客户机测试节点上的数据复制时,从服务过期数据设置为'no'“。
The logs of the old masters (/var/log/redis/redis-server.log) are showing:
20731:S 09 Nov 10:16:31.117 * Connecting to MASTER <new master="" ip="">: 6379
20731:S 09 Nov 10:16:31.117 * MASTER <-> SLAVE sync started
20731:S 09 Nov 10:16:31.118 * Non blocking connect for SYNC fired the event.
20731:S 09 Nov 10:16:31.118 * Master replied to PING, replication can continue...
20731:S 09 Nov 10:16:31.119 * (Non critical) Master does not under stand REPLCONF listening-port: -NOAUTH Authentication required.
20731:S 09 Nov 10:16:31.119 * (Non critical) Master does not under stand REPLCONF capa:
-NOAUTH Authentication required.这看起来像老主人无法对新的主服务器进行身份验证,因为它没有他的密码,但是如何正确地设置它呢?
因为已经注意到/etc/redis/redis.conf与/etc/redis/entinel.conf不同的是,在新的主服务器升级后没有发生更改,这可能会导致这一点,因为主服务器的redis.conf并不是新主服务器的密码。
如有任何解决问题的提示,将不胜感激。
发布于 2015-11-11 20:42:57
主人需要像奴隶一样配置,因为总有一天它会变成奴隶。因此,您需要将它的masterauth设置为荚的密码。
您可以在不重新启动y的情况下对“老主人”执行以下操作:
redis-cli -h oldmasterip -a thepassword config set masterauth thepassword
redis-cli -h oldmasterip -a thepassword config rewrite从那时起,它应该是好的,并且配置文件将被更新。
https://stackoverflow.com/questions/33650026
复制相似问题