MONGODB 读书摘要

If you are starting a brand-new set, you can send the configuration to any member in
the set. If you are starting with data on one of the members, you must send the configuration
to the member with data. You cannot initiate a set with data on more than one
member.

如果RS是全新的,无任何数据的,那么初始化集群可以在任意一台机器上,否则应该在存在数据的节点上进行初始化。你不能够初始化RS,在2个节点都存在数据的时候。

Note that, in both of the use cases above, you need at most one arbiter. You do not need
an arbiter if you have an odd number of nodes. A common misconception seems to be
that you should add extra arbiters “just in case.” However, it doesn’t help elections go
any faster or provide any data safety to add extra arbiters.
Suppose you have a three members set. Two members are required to elect a primary.
If you add an arbiter, you’ll have a four member set, so three members will be required
to choose a primary. Thus, your set is potentially less stable: instead of requiring 67%
of your set to be up, you’re now requiring 75%.
Having extra members can also make elections take longer. If you have an even number
of nodes because you added an arbiter, your arbiters can cause ties, not prevent them.


最多只需要一个仲裁者,如果节点数是奇数,那就不需要仲裁者。一种错误的理解是,为了以防万一,总是应该添加额外的仲裁者。
假设有3个节点的成员的RS,需要2个成员才能组成大多数,才能选举为主节点,如果这时添加了一个仲裁者,RS里就4个成员了,要有3个成员才能组成大多数。因此RS的稳定性降低了。
添加额外成员也会导致选举耗时变长,由于添加了仲裁者,现在RS一共有偶数个成员,这样就可能出现成员票数相同的情况。仲裁者的目的应该是避免出现平票,而不是导致出现平票。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22034023/viewspace-1162475/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22034023/viewspace-1162475/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值