C100DBA认证讲解 MongoDB replication 原理

C100DBA认证讲解 MongoDB replication 原理

Screen Shot 2015-05-25 at 11.39.46 PM


which of following is true of mechanics of replication in MongoDB?

  1. Clients read from nearest member of a replica set by default
  2. Members of a replica set may replicate data from any other data-bearing member of set .
  3. Operations on the primary are recorded in a capped collection called oplog



  1. 复制集成员会默认从复制集中最近的成员哪里读取数据
  2. replica set 复制集中的成员可能从其他任何承载数据的节点上复制数据
  3. 在primary上的操作将会被记录到一个capped collection(受限集合)中称之为oplong


Replica set members replicate data continuously after the initial sync. This process keeps the members up to date with all changes to the replica set’s data. In most cases, secondaries synchronize from the primary.



For a member to sync from another, both members must have the same value for the buildIndexessetting.

Beginning in version 2.2, secondaries avoid syncing from delayed members and hidden members.



The oplog (operations log) is a special capped collection that keeps a rolling record of all operations that modify the data stored in your databases. MongoDB applies database operations on the primary and then records the operations on the primary’s oplog. The secondary members then copy and apply these operations in an asynchronous process. All replica set members contain a copy of the oplog, in thelocal.oplog.rs collection, which allows them to maintain the current state of the database.


选项Operations on the primary are recorded in a capped collection called oplog是正确的。




沪公网安备 31010802001379号