gpt4 book ai didi

mongodb - 对 MongoDB 副本集中投票成员的数量感到困惑?

转载 作者:可可西里 更新时间:2023-11-01 10:44:21 24 4
gpt4 key购买 nike

replica set architecture article 建议的(最低)配置由:一个主要成员和两个次要成员(或一个次要成员和一个轻量级仲裁者)组成。因此两个有投票权的成员

不管下面几行你能读懂(这是为了“顺利选举”):

When adding additional members, ensure the following architectural conditions are true:

  • The set has an odd number of voting members.

    If you have an even number of voting members, deploy an arbiter to create an odd number.

如果我二是偶数是对的,那就是建议的最小配置是错误的!偶数选民怎么会导致选举“不顺利”?在副本投票方面,什么是“不顺利”?

有关此的更多信息:即使将初选算作选民(因此三个选民,奇数),如果初选失败,您最终也会有两个选民。如果它失败了,主要如何投票?

最佳答案

In the replica set architecture article the suggested (minimum) configuration is made of: one primary member and two secondary ones (or one secondary and a lightweight arbiter). Hence two voting members.

这是不正确的。主要、次要和仲裁者是三票。

因此您的票数为奇数。因此,如果一个节点宕机,其他两个节点占多数,可以选出一个新的主节点。

你不应该有偶数的原因是,在网络分区的情况下,你不会最终在网络分区的每一侧都有 50% 的投票成员——如果发生这种情况,你将没有主要成员即使副本集的每个成员实际上都已启动。

关于mongodb - 对 MongoDB 副本集中投票成员的数量感到困惑?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16618614/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com