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] | |
A replica set with three members that store data has:包含三个存储数据的成员的副本集具有:
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.旧主节点在可用时重新加入集合。
For considerations when using an arbiter, see Replica Set Arbiter.有关使用仲裁器时的注意事项,请参阅副本集仲裁器。
A three member replica set with a two members that store data has:包含两个成员的三成员副本集存储数据:
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.如果主副本不可用,副本集将选择次副本作为主副本。