linux – Redis sentinel – 如何使服务器脱离循环?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了linux – Redis sentinel – 如何使服务器脱离循环?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2123字,纯文字阅读大概需要4分钟。
内容图文
我在不同服务器上部署了Sentinel-3 redis实例,每个服务器上都有3个标记.
现在,我意识到当前的master没有太多内存,所以我在这个特定的服务器上停止了sentinel和redis实例.并在新机器上进行相同的设置.所以,我仍然有相同的部署,3个redis实例和3个哨兵.
问题是,现在哨兵说,主人已经失败,因为他们认为主人是我删除的服务器.我该怎么做才能告诉哨兵它不需要在循环中包含该服务器.
解决方法:
关于Redis Sentinel的文档,在Adding or removing Sentinels章下:
Removing a Sentinel is a bit more complex: Sentinels never forget already seen Sentinels, even if they are not reachable for a long time, since we don’t want to dynamically change the majority needed to authorize a failover and the creation of a new configuration number. So in order to remove a Sentinel the following steps should be performed in absence of network partitions:
- Stop the Sentinel process of the Sentinel you want to remove.
- Send a
SENTINEL RESET *
command to all the other Sentinel instances (instead of * you can use the exact master name if you want to reset just a single master). One after the other, waiting at least 30 seconds between instances.- Check that all the Sentinels agree about the number of Sentinels currently active, by inspecting the output of
SENTINEL MASTER mastername
of every Sentinel.
进一步:
Removing the old master or unreachable slaves.
Sentinels never forget about slaves of a given master, even when they are unreachable for a long time. This is useful, because Sentinels should be able to correctly reconfigure a returning slave after a network partition or a failure event.
Moreover, after a failover, the failed over master is virtually added as a slave of the new master, this way it will be reconfigured to replicate with the new master as soon as it will be available again.
However sometimes you want to remove a slave (that may be the old master) forever from the list of slaves monitored by Sentinels.
In order to do this, you need to send a
SENTINEL RESET mastername
command to all the Sentinels: they’ll refresh the list of slaves within the next 10 seconds, only adding the ones listed as correctly replicating from the current masterINFO
output.
内容总结
以上是互联网集市为您收集整理的linux – Redis sentinel – 如何使服务器脱离循环?全部内容,希望文章能够帮你解决linux – Redis sentinel – 如何使服务器脱离循环?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。