This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Troubleshooting”.
1. _________ prevents the current member from seeking election as primary for a period of time.
a) replSetGetStatus
b) replSetFreeze
c) replSetInitiate
d) all of the mentioned
View Answer
Explanation: The replSetFreeze command prevents a replica set member from seeking election for the specified number of seconds.
2. Point out the wrong statement.
a) Primary capture data from the primary member to maintain an up to date copy of the sets’ data
b) For some deployments, implementing a custom replication sync topology may be more effective than the default sync target selection logic
c) MongoDB provides the ability to specify a host to use as a sync target
d) None of the mentioned
View Answer
Explanation: However, by default secondaries may automatically change their sync targets to secondary members based on changes in the ping time between members and the state of other members’ replication.
3. ________ returns a document that reports on the status of the replica set.
a) replSetGetStatus
b) replSetFreeze
c) replSetInitiate
d) all of the mentioned
View Answer
Explanation: The replSetGetStatus command returns the status of the replica set from the point of view of the current server.
4. __________ enables or disables a maintenance mode, which puts a secondary node in a RECOVERING state.
a) replSetReconfig
b) replSetMaintenance
c) replSetStepDown
d) all of the mentioned
View Answer
Explanation: The replSetMaintenance admin command enables or disables the maintenance mode for a secondary member of a replica set.
5. Point out the correct statement.
a) To affect the sync target for the initial sync, run rs.syn() operation before initial sync
b) If you run rs.syncFrom() during initial sync, MongoDB produces no error messages
c) replSetSyncFrom and rs.syncFrom() provide a permanent override of default behavior
d) All of the mentioned
View Answer
Explanation: The sync target falls more than 30 seconds behind another member of the replica set; the mongod will revert to the default sync target.
6. When enabled replSetMaintenance: true, the member enters the ________ state.
a) REPLICATING
b) RECOVERING
c) STALE
d) All of the mentioned
View Answer
Explanation: The member is not accessible for read operations.
7. ________ applies a new configuration to an existing replica set.
a) replSetReconfig
b) replSetMaintenance
c) replSetStepDown
d) all of the mentioned
View Answer
Explanation: The replSetReconfig command modifies the configuration of an existing replica set.
8. Which of the command is for master-slave replication only?
a) replSetSyncFrom
b) resync
c) applyOps
d) isMaster
View Answer
Explanation: resync forces a mongod to re-synchronize from the master.
9. _______ is an internal command that applies oplog entries to the current data set.
a) replSetSyncFrom
b) resync
c) applyOps
d) isMaster
View Answer
Explanation: The applyOps command is primarily an internal command.
10. __________ explicitly override the default logic for selecting a member to replicate from.
a) replSetSyncFrom
b) resync
c) applyOps
d) isMaster
View Answer
Explanation: replSetSyncFrom explicitly configures which host the current mongod pulls oplog entries from.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Check MongoDB Books
- Check Information Technology Books
- Apply for Programming Internship
- Practice Programming MCQs