最后一个mongo副本集成为次要副本? [英] Last mongo replica set becomes secondary?

查看:42
本文介绍了最后一个mongo副本集成为次要副本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个mongo节点设置为副本集.正在发生以下情况:

I have 3 mongo nodes set up as replica sets. The following scenario is occurring:

  • 节点1是主要节点,节点2是辅助节点,节点3是辅助节点.
  • 节点2和3被关闭.
  • 节点1成为辅助节点.

这对我来说没有意义...我希望主要对象仍然是主要对象.谁可以给我解释一下这个?我已经读到,如果只有一个节点幸存下来,也许我需要一名仲裁员来进行选举,但是这感觉很笨拙.为什么单个节点不能进行选举?

This doesn't make sense to me...I would expect the primary to remain primary. Can someone explain this to me? I've read that perhaps I need an arbiter to make the election in the case that only a single node survives, however this feels clunky. Why can't a single node make the election?

推荐答案

对于3节点副本集,您至少需要2个节点.这些文档指的是选举一个新的主要学生所需要的多数".因此,对于具有3个节点的RS,需要至少有2个节点在运行,才能将一个节点分配为主节点.

With a 3 node replicaset you need a minimum of 2 nodes up. The docs refer to a 'majority' required to elect a new primary. Therefore with a 3 node RS, there needs to be at least 2 nodes running for one node to be assigned as primary.

此页面上的表格非常有用,显示了具有不同数量节点的副本集的容错能力: https://docs.mongodb.org/manual/core/replica-set-架构/

This page has a quite useful table showing the fault tolerance for replicasets with different numbers of nodes: https://docs.mongodb.org/manual/core/replica-set-architectures/

这篇关于最后一个mongo副本集成为次要副本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆