Three Member Replica Sets三个成员副本集
On this page本页内容
The minimum number of replica set members needed to obtain the benefits of a replica set is three members. 要获得副本集的好处,最少需要三个副本集成员。A three member replica set can have either three data-bearing members (Primary-Secondary-Secondary) (Recommended) or if circumstances (such as cost) prohibit adding a third data bearing member, two data-bearing members and an arbiter (Primary-Secondary-Arbiter). 三个成员的副本集可以有三个数据承载成员(主-次-次)(推荐),或者如果情况(如成本)禁止添加第三数据承载成员、两个数据承载构件和一个仲裁器(主-辅助仲裁器)。[1]
[1] | |
Primary with Two Secondary Members (P-S-S)具有两个次要成员的主要成员(P-S-S)
A replica set with three members that store data has:由三个成员组成的存储数据的复制副本集具有:
One primary.一个primary。Two secondary members. Both secondaries can become the primary in an election.两名secondary成员。两个secondary都可以在选举中成为primary。
These deployments provide two complete copies of the data set at all times in addition to the primary. 除了主数据集外,这些部署还始终提供数据集的两个完整副本。These replica sets provide additional fault tolerance and high availability. 这些复制副本集提供了额外的容错性和高可用性。If the primary is unavailable, the replica set elects a secondary to be primary and continues normal operation. The old primary rejoins the set when available.如果主副本不可用,则副本集会选择一个辅助副本作为主副本并继续正常操作。旧的主服务器在可用时重新加入集合。
Primary with a Secondary and an Arbiter (PSA)初级、次级和仲裁员(PSA)
For considerations when using an arbiter, see Replica Set Arbiter.有关使用仲裁器时的注意事项,请参阅副本集仲裁器。
A three member replica set with a two members that store data has:具有两个成员的三成员复制副本集存储数据,该复制副本集具有:
- One primary.
- One secondary member. The secondary can become primary in an election.
- One arbiter. The arbiter only votes in elections.
Since the arbiter does not hold a copy of the data, these deployments provides only one complete copy of the data. Arbiters require fewer resources, but at the expense of more limited redundancy and fault tolerance.由于仲裁器不保存数据的副本,因此这些部署只提供数据的一个完整副本。仲裁器需要更少的资源,但代价是更有限的冗余和容错。
However, a deployment with a primary, secondary, and an arbiter ensures that a replica set remains available if the primary or the secondary is unavailable. If the primary is unavailable, the replica set will elect the secondary to be primary.但是,具有主、辅助和仲裁器的部署可确保在主或辅助不可用时副本集仍然可用。如果主副本不可用,则副本集将选择次副本作为主副本。