MongoDB Questions and Answers – Replication Processes – 2

«
»

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

Answer: a
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

Answer: c
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.

advertisement

3. The oplog must translate multi-updates into individual operations in order to maintain ____________
a) availability
b) idempotency
c) scalability
d) secondary
View Answer

Answer: b
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

Answer: b
Explanation: This will determine if there is any unintended replication delay.

advertisement
advertisement

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

Answer: b
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

Answer: a
Explanation: Beginning in version 2.2, secondaries avoid syncing from delayed members and hidden members.

advertisement

7. Secondaries apply operations from the primary asynchronously to provide __________ consistency.
a) strict
b) strong
c) eventual
d) none of the mentioned
View Answer

Answer: c
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

Answer: b
Explanation: MongoDB does not delete data stored in moveChunk.

advertisement

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

Answer: a
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

Answer: b
Explanation: slaveDelay is the number of seconds “behind” the primary that this replica set member should “lag”.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Reference Books in MongoDB.

To practice all areas of MongoDB for online test, Here is complete set of 1000+ Multiple Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!
advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter