Replica Set Secondary Members副本集辅助成员
A secondary maintains a copy of the primary's data set. 辅助服务器维护primary数据集的副本。To replicate data, a secondary applies operations from the primary's oplog to its own data set in an asynchronous process. 要复制数据,辅助进程会在异步进程中将操作从primary的oplog应用到它自己的数据集。[1] A replica set can have one or more secondaries.副本集可以有一个或多个辅助副本。
The following three-member replica set has two secondary members. 以下三个成员的复制副本集有两个辅助成员。The secondaries replicate the primary's oplog and apply the operations to their data sets.辅助设备复制主设备的操作日志,并将操作应用于其数据集。
Although clients cannot write data to secondaries, clients can read data from secondary members. 尽管客户端无法将数据写入辅助成员,但客户端可以从辅助成员读取数据。See Read Preference for more information on how clients direct read operations to replica sets.有关客户端如何将读取操作定向到副本集的详细信息,请参阅读取首选项。
A secondary can become a primary. 次要的可以变成主要的。If the current primary becomes unavailable, the replica set holds an election to choose which of the secondaries becomes the new primary.如果当前主副本不可用,则副本集将进行一次选举,以选择哪个辅助副本将成为新的主副本。
In the following three-member replica set, the primary becomes unavailable. 在以下三个成员的复制副本集中,主复制副本将不可用。This triggers an election where one of the remaining secondaries becomes the new primary.这会引发一场选举,剩下的一名中学生将成为新的小学生。
See Replica Set Elections for more details.有关详细信息,请参阅副本集选举。
You can configure a secondary member for a specific purpose. You can configure a secondary to:您可以为特定目的配置辅助成员。您可以将辅助配置为:
Prevent it from becoming a primary in an election, which allows it to reside in a secondary data center or to serve as a cold standby.防止它在选举中成为主要数据中心,这样它就可以驻留在辅助数据中心或充当冷备用。See Priority 0 Replica Set Members.请参阅优先级为0的副本集成员。Prevent applications from reading from it, which allows it to run applications that require separation from normal traffic.阻止应用程序从中读取,这允许它运行需要与正常流量分离的应用程序。See Hidden Replica Set Members.请参见隐藏的副本集成员。Keep a running "historical" snapshot for use in recovery from certain errors, such as unintentionally deleted databases.保留一个正在运行的“历史”快照,以用于从某些错误中恢复,例如无意删除的数据库。See Delayed Replica Set Members.请参阅延迟的副本集成员。
[1] |
|