This set of MongoDB online test focuses on “Replication Processes – 2”.
1. Before mongod creates an oplog, you can specify its size with the __________ option.
a) oplogSizeMB
b) oplogSizeGB
c) opSizeMB
d) all of the mentioned
View Answer
Explanation: However, after you have started a replica set member for the first time, you can only change the size of the oplog using the Change the Size of the Oplog procedure.
2. Point out the wrong statement.
a) The oplog is a special capped collection that keeps a rolling record of all operations that modify the data stored in your databases
b) MongoDB applies database operations on the primary and then records the operations on the primary’s oplog
c) The primary members then copy and apply these operations in an asynchronous process
d) None of the mentioned
View Answer
Explanation: All replica set members contain a copy of the oplog, in the local.oplog.rs collection, which allows them to maintain the current state of the database.
3. The oplog must translate multi-updates into individual operations in order to maintain ____________
a) availability
b) idempotency
c) scalability
d) secondary
View Answer
Explanation: This can use a great deal of oplog space without a corresponding increase in data size or disk use.
4. Use _________ from a secondary member and the replication status output to assess the current state of replication.
a) db.getReplInfo()
b) db.getReplicationInfo()
c) rs.printReplicationInfo()
d) none of the mentioned
View Answer
Explanation: This will determine if there is any unintended replication delay.
5. Point out the correct statement.
a) To facilitate replication, all replica set members send heartbeats (pings) to all other members
b) For proper replication operations, entries in the oplog must be idempotent
c) Any member can import oplog entries from any other member
d) All of the mentioned
View Answer
Explanation: When you start a replica set member for the first time, MongoDB creates an oplog of a default size.
6. For a member to sync from another, both members must have the same value for the _________ setting.
a) buildIndexes
b) getIndexes
c) buildpriIndexes
d) secondary
View Answer
Explanation: Beginning in version 2.2, secondaries avoid syncing from delayed members and hidden members.
7. Secondaries apply operations from the primary asynchronously to provide __________ consistency.
a) strict
b) strong
c) eventual
d) none of the mentioned
View Answer
Explanation: In a replica set, the set can have at most one primary and only the primary can accept write operations.
8. When ______________ is true, the mongod instance saves all documents migrated from the shard to the moveChunk directory of the storage.dbPath.
a) sharding.archiveChunks
b) sharding.archiveMovedChunks
c) shards.archiveMovedChunks
d) rs.syncFrom()
View Answer
Explanation: MongoDB does not delete data stored in moveChunk.
9. Replication _______ is a delay between operation on the primary and the application of that operation from the oplog to the secondary.
a) lag
b) delay
c) latency
d) none of the mentioned
View Answer
Explanation: Replication lag can be a significant issue and can seriously affect MongoDB replica set deployments.
10. A delayed member may show as 0 seconds behind the primary when the inactivity period on the primary is greater than the ________ value.
a) slaveDelayTime
b) slaveDelay
c) slaveTime
d) rs.slave()
View Answer
Explanation: slaveDelay is the number of seconds “behind” the primary that this replica set member should “lag”.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Apply for Programming Internship
- Check MongoDB Books
- Practice Programming MCQs
- Check Information Technology Books