简体   繁体   English

主机重启后,Redis故障转移失败

[英]Redis failover fails after hosts reboot

I have a small cluster of redis machines, 3 hosts with sentinels on them, one master and 2 slaves. 我有一小群redis机器,其中有3个主机,上面有哨兵,一个主机和2个从机。 Each time when we are doing any patching and rebooting machines, some of instances are not getting up after the reboot and sentinel shows their status as sdown In Sentinel log this msg keeps popping up: 每次我们进行任何修补和重新引导计算机时,某些实例在重新引导后都不会启动,并且哨兵将其状态显示为sdown在Sentinel日志中,此消息会不断弹出:

9932:X 18 Jul 13:46:47.357 # Next failover delay: I will not start a failover before Wed Jul 18 13:52:47 2018
9932:X 18 Jul 13:46:47.485 # +new-epoch 9602
9932:X 18 Jul 13:46:47.485 # +try-failover master Redis 10.208.202.112 6204
9932:X 18 Jul 13:46:47.487 # +vote-for-leader eb84f5a615bc02d9de4674dd33136fcde3f318dd 9602
9932:X 18 Jul 13:46:47.491 # daf5bf045ca5733de9fdd7f0206aa225d993c100 voted for eb84f5a615bc02d9de4674dd33136fcde3f318dd 9602
9932:X 18 Jul 13:46:47.492 # 4009be0fbc29c385eb68a6492c8c94ce1b61e31b voted for eb84f5a615bc02d9de4674dd33136fcde3f318dd 9602
9932:X 18 Jul 13:46:47.559 # +elected-leader master Redis 10.208.202.102 6204
9932:X 18 Jul 13:46:47.559 # +failover-state-select-slave master Redis 10.208.202.112 6204
9932:X 18 Jul 13:46:47.630 # -failover-abort-no-good-slave master Redis 10.208.202.112 6204

And Sentinel is unable to select any master after reboot, and this msg keeps coming up again and again, but all the instances are up and running. 而且,Sentinel在重新启动后无法选择任何主服务器,并且该消息会不断出现,但是所有实例都已启动并正在运行。 Sentinels are on the same machines as redis slaves and master. 哨兵与Redis从属服务器和主服务器在同一台计算机上。 I'm rebooting redis isntances and sentinels on all machines after issue appears and then everything gets back to normal. 出现问题后,我在所有机器上重新启动Redis和哨兵,然后一切恢复正常。 Does anyone know what can I do to make it work properly after reboot? 有人知道重启后如何正常工作吗? When I'm doing normal failover, eg. 当我进行正常的故障转移时,例如。 shutting down master master it works fine, new master get's ellected and everything runs smooth. 关闭master master可以正常工作,选择新的master,一切运行顺利。 I don't even exactly care on which host the master gonna be, it can do a failover anytime it wants, I just need it to work after the machine reboot. 我什至都不在乎主机要在哪台主机上,它可以在任何时候进行故障转移,我只需要它在机器重启后就可以工作。

看起来原因是我没有将masterauth参数放在主配置中,只是requirepass,似乎主配置同时需要两者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM