MONGODB 讀書摘要

wei-xh發表於2014-05-16
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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章