On this page本页内容
This document answers common questions about replication in MongoDB. 本文档回答了有关MongoDB中复制的常见问题。See also the Replication section in the manual, which provides an overview of replication, including details on:另请参阅手册中的复制部分,该部分概述了复制,包括以下详细信息:
MongoDB supports replica sets, which can have up to 50 nodes.MongoDB支持副本集,最多可以有50个节点。
Yes.对
For example, a deployment may maintain a primary and secondary in an East-coast data center along with a secondary member for disaster recovery in a West-coast data center.例如,部署可以在东海岸数据中心维护一个primary和一个secondary,以及在西海岸数据中心进行灾难恢复。
Yes, but not without connection failures and the obvious latency.是的,但并非没有连接故障和明显的延迟。
Members of the set will attempt to reconnect to the other members of the set in response to networking flaps. 集合的成员将尝试重新连接到集合的其他成员,以响应网络襟翼。This does not require administrator intervention. 这不需要管理员干预。However, if the network connections among the nodes in the replica set are very slow, it might not be possible for the members of the node to keep up with the replication.但是,如果副本集中节点之间的网络连接非常缓慢,则节点的成员可能无法跟上复制。
Journaling facilitates faster crash recovery.日志记录有助于更快的崩溃恢复。
Journaling is particularly useful for protection against power failures, especially if your replica set resides in a single data center or power circuit.日志记录对于防止电源故障特别有用,尤其是当副本集位于单个数据中心或电源电路中时。
When a replica set runs with journaling, you can safely restart 当副本集运行日志记录时,您可以安全地重新启动mongod
instances without additional intervention.mongod
实例,而无需额外干预。
Journaling requires some resource overhead for write operations. 日志记录需要一些写操作的资源开销。Journaling has no effect on read performance, however.然而,日志记录对读取性能没有影响。
Journaling is enabled by default on all 64-bit builds of MongoDB v2.0 and greater.默认情况下,MongoDB v2.0及更高版本的所有64位版本均启用日志记录。
Arbiters never receive the contents of a collection but do exchange the following data with the rest of the replica set:仲裁器从不接集合合的内容,但会与副本集的其余部分交换以下数据:
If your MongoDB deployment uses TLS/SSL, then all communications between arbiters and the other members of the replica set are secure.如果MongoDB部署使用TLS/SSL,那么仲裁器和副本集其他成员之间的所有通信都是安全的。
See the documentation for Configure 有关更多信息,请参阅配置mongod
and mongos
for TLS/SSL for more information. mongod
和mongos
for TLS/SSL的文档。As with all MongoDB components, run arbiters on secure networks.与所有MongoDB组件一样,在安全网络上运行仲裁器。
Yes.
Factors including: different oplog sizes, different levels of storage fragmentation, and MongoDB's data file pre-allocation can lead to some variation in storage utilization between nodes. 因素包括:不同的oplog大小、不同级别的存储分片以及MongoDB的数据文件预分配可能会导致节点之间的存储利用率有所不同。Storage use disparities will be most pronounced when you add members at different times.当您在不同时间添加成员时,存储使用差异将最明显。
Yes, unsharded replica sets can be renamed. 是的,可以重命名未共享的副本集。This procedure requires downtime.此过程需要停机。
To learn how to rename your replica set, see Rename a Replica Set.要了解如何重命名副本集,请参阅重命名副本集。
Before renaming a replica set, perform a full backup of your MongoDB deployment.重命名副本集之前,请执行MongoDB部署的完整备份。