MongoDB Questions and Answers – Master Slave Replication

«
»

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Master Slave Replication”.

1. Which of the following members should be hidden?
a) Delayed
b) Hidden
c) Primary
d) All of the mentioned
View Answer

Answer: a
Explanation: Use hidden members for dedicated tasks such as reporting and backups.

2. Point out the wrong statement.
a) Clients will not distribute reads with the appropriate read preference to hidden members
b) Hidden members cannot vote in replica set elections
c) If you stop a voting hidden member, ensure that the set has an active majority or the primary will step down
d) None of the mentioned
View Answer

Answer: b
Explanation: Hidden members may vote in replica set elections

advertisement

3. __________ operations cannot guarantee that the data files do not change.
a) db.lockl()
b) db.synclock()
c) db.fsyncUnlock()
d) secondary
View Answer

Answer: c
Explanation: As a result, do not use these methods to ensure consistency for the purposes of creating backups.

4. _______ may block reads, including those necessary to verify authentication.
a) db.lockall()
b) db.fsyncLock()
c) db,lockreads()
d) none of the mentioned
View Answer

Answer: b
Explanation: Such reads are necessary to establish new connections to a mongod that enforces authorization checks.

5. Point out the correct statement.
a) In MongoDB, clients cannot see the results of writes before they are made durable
b) Users may configure read preference on a per-connection basis to prefer that the read operations return results from the secondary members
c) Clients cannot read data which may be subsequently rolled back
d) None of the mentioned
View Answer

Answer: b
Explanation: If clients configure the read preference to permit secondary reads, read operations can return data from secondary members that have not replicated more recent write operations.

6. ________ unlocks a mongod instance to allow writes and reverses the operation of a db.fsyncLock() operation.
a) db.fsyncUnlock()
b) db.fsynclock()
c) db.syncUnlock()
d) secondary
View Answer

Answer: a
Explanation: Typically you will use db.fsyncUnlock() following a database backup operation.

advertisement

7. Delayed members are a ________ or a running “historical” snapshot of the data set.
a) “rolling backup”
b) “roll backup”
c) “rolling commit”
d) none of the mentioned
View Answer

Answer: a
Explanation: They may help you recover from various kinds of human error.

8. Delayed members apply operations from the _______ on a delay.
a) oplog
b) log
c) mlog
d) none of the mentioned
View Answer

Answer: a
Explanation: Always prevent applications from seeing and querying delayed members.

9. In sharded clusters, delayed members have limited utility when the __________ is enabled.
a) Balancer
b) Collector
c) Emitter
d) None of the mentioned
View Answer

Answer: a
Explanation: Delayed members replicate chunk migrations with a delay.

10. A delayed member has its priority equal to 0 and hidden equal to ___________
a) 0
b) flase
c) true
d) all of the mentioned
View Answer

Answer: c
Explanation: When you configure a delayed member, the delay applies both to replication and to the member’s oplog.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

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

advertisement
advertisement
advertisement
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