MONGO 选举初选 [英] MONGO election primary
问题描述
我有一个包含 5 个 mongo 节点的副本集,我关闭了 3 个节点进行 DR 测试,并向副本添加了一个新节点.然而,即使一个节点具有更高的优先级,我仍然有 3 个辅助节点并且没有主节点.你知道为什么吗,应该怎么做,我该如何修复它
I had a replica set with 5 mongo nodes I shut 3 nodes for DR testing and add a new node to replica. however, even though one node has higher priority I still have 3 secondaries nodes and no primary. do you know why, what should be done how can I fix it
推荐答案
当您关闭 5 个节点中的 3 个时,您将失去拥有主节点的能力,因为大多数节点必须投票支持主节点.
When you shut down 3 out of 5 nodes, you lost the ability to have a primary since a majority of nodes must vote for the primary.
当您添加新节点时,新节点必须先从主节点同步数据,然后才能成为新的主节点.由于没有主节点,因此不可能发生同步.
When you added a new node, the new node had to sync data from the primary before it could become a new primary. Since there was no primary this sync couldn't have happened.
您的灾难恢复计划需要确保始终大多数节点都在运行.
Your DR plans need to ensure there is always a majority of nodes operational.
这篇关于MONGO 选举初选的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!