ITPub博客

首页 > 数据库 > NoSQL > MONGODB 读书摘要

MONGODB 读书摘要

原创 NoSQL 作者:wei-xh 时间:2014-05-16 10:22:24 0 删除 编辑
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博客 ” ,链接:https://blog.itpub.net/22034023/viewspace-1162475/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle ACE组成员,DBGeeK用户组发起人。曾在DTCC、ORACLE技术嘉年华、Gdevops等公开场合做过数据库技术专题分享,2017年应Oracle邀请在世界最大的数据库会议OOW上做技术分享。组织翻译了《拨云见日,解密Oracle ASM内核》一书。

注册时间:2009-07-04

  • 博文量
    422
  • 访问量
    2425337