gpt4 book ai didi

mongodb - 在 MongoDb 中使用副本集的三个节点和 2 个已关闭

转载 作者:IT老高 更新时间:2023-10-28 13:33:28 25 4
gpt4 key购买 nike

在一个 3 节点副本集中,为什么当 2 个关闭时,第三个成为 SECONDARY 而不是 PRIMARY?

我希望在数据中心内有 2 个 mongod,在外部有一个,所以如果数据中心出现故障,我希望第三个外部 mongod 成为主节点。

没有和仲裁者有可能吗?

最佳答案

好的,找到回复了:

http://tebros.com/2010/11/mongodb-arbiters-with-only-two-replicas/

What happend?! It turns out that when a mongod instance is isolated, it cannot vote for itself to be primary. This makes sense when you think about it. If a network link went down and separated your two replicas, you wouldn’t want them both to elect themselves as primary. So in my case, when rep1-1 noticed that it was isolated from the rest of the replica set, it made itself secondary and stopped accepting writes.

关于mongodb - 在 MongoDb 中使用副本集的三个节点和 2 个已关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12129583/

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