ElasticSearch第十二讲 ES 集群脑裂问题

本文探讨了ElasticSearch集群中的脑裂问题,解释了脑裂现象及其原因,详细介绍了如何通过设置`discovery.zen.minimum_master_nodes`参数来避免这种情况,强调至少需要3个节点且该参数设为quorum以确保集群稳定性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ES集群出现脑裂

脑裂这个词,我们肯定不会陌生,在zk集群,mq集群搭建就考虑过这个问题,为保证部署在不同机房的集群始终保证任何时候只会有一个Leader来协调处理问题,当集群其他机器或者主节点出现故障时,保证重新选举出主节点不影响整个系统服务,对数据一致性进行一致性处理。

集群脑裂是什么?
所谓脑裂问题,就是同一个集群中的不同节点,对于集群的状态有了不一样的理解,比如集群中存在两个master
如果因为网络的故障,导致一个集群被划分成了两片,每片都有多个node,以及一个master,那么集群中就出现了两个master了。
但是因为master是集群中非常重要的一个角色,主宰了集群状态的维护,以及shard的分配,因此如果有两个master,可能会导致数据异常。

如下图所示

脑裂
节点1在启动时被选举为主节点并保存主分片标记为0P,而节点2保存复制分片标记为0R
现在,如果在两个节点之间的通讯中断了,会发生什么?由于网络问题或只是因为其中一个节点无响应,这是

引用 引用 引用根据这些引用内容,警告信息"warning: in the working copy of 'androidPrivacy.json', LF will be replaced by CRLF the next time Git touches it"是在提醒用户在Git操作中,回车和换行的转换将会发生。这是因为Git会在提交时对换行符进行转换以保持统一性。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [warning: in the working copy of ‘App.vue‘, LF will be replaced by CRLF the next time Git touches ...](https://blog.youkuaiyun.com/weixin_44953057/article/details/129644219)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Git: ‘LF will be replaced by CRLF the next time Git touches it‘ 问题解决与思考](https://blog.youkuaiyun.com/Babylonxun/article/details/126598477)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [warning: in the working copy of ‘...‘, LF will be replaced by CRLF the next time Git touche](https://blog.youkuaiyun.com/weixin_55252589/article/details/129017650)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序员路同学

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值