This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Member Configuration”.
1. The ________ settings of replica set members affect the outcomes of elections for primary.
a) priority
b) replication
c) Initiate
d) all of the mentioned
View Answer
Explanation: Use this setting to ensure that some members are more likely to become primary and that others can never become primary.
2. Point out the correct statement.
a) The value of the member’s priority setting determines the member’s priority in elections
b) The default value for the priority field is 3
c) The value of priority can be any floating point (i.e. decimal) number between 0 and 500
d) None of the mentioned
View Answer
Explanation: The higher the number, the higher the priority.
3. To modify priorities, you update the members _________ in the replica configuration object.
a) array
b) tag
c) mdimarray
d) all of the mentioned
View Answer
Explanation: The array index begins with 0. Do not confuse this index value with the value of the replica set member’s _id field in the array.
4. The _________ shell method can force the current primary to step down, which causes an election.
a) rs.repliconfig()
b) rs.config()
c) rs.reconfig()
d) all of the mentioned
View Answer
Explanation: When the primary steps down, the mongod closes all client connections.
5. Point out the wrong statement.
a) Before an election the primary opens all open client connections
b) To block a member from seeking election as primary, assign it a priority of 0
c) Hidden members, delayed members, and arbiters all have priority set to 0
d) All of the mentioned
View Answer
Explanation: Reconfiguring priority can force the current primary to step down, leading to an election.
6. If the oplog is shorter than the slaveDelay window, the _______ member cannot successfully replicate operations.
a) hidden
b) delayed
c) priority
d) all of the mentioned
View Answer
Explanation: The length of the secondary slaveDelay must fit within the window of the oplog.
7. _________ members allow you to add additional members for read distribution beyond the maximum seven voting members.
a) Voting
b) Non-voting
c) Priority
d) all of the mentioned
View Answer
Explanation: To configure a member as non-voting, set its votes value to 0.
8. Remove the secondary from the replica set by calling ___________ method.
a) rs.removeRepli()
b) rs.remove()
c) rs.removeset()
d) isMaster
View Answer
Explanation: rs.remove() removes the member described by the hostname parameter from the current replica set.
9. ______ returns basic help text for replica set functions.
a) rs.printSlaveReplicationInfo()
b) rs.printReplication()
c) rs.help()
d) all of the mentioned
View Answer
Explanation: rs.help() returns a basic help text for all of the replication related shell functions.
10. __________ prints a report of the status of the replica set from the perspective of the secondaries.
a) rs.printSlaveReplicationInfo()
b) rs.printReplication()
c) rs.help()
d) none of the mentioned
View Answer
Explanation: rs.printSlaveReplicationInfo() returns a formatted report of the status of a replica set from the perspective of the secondary member of the set.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Get Free Certificate of Merit in MongoDB
- Participate in MongoDB Certification Contest
- Become a Top Ranker in MongoDB
- Take MongoDB Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Apply for MongoDB Internship
- Apply for Programming Internship
- Buy Information Technology Books
- Practice Programming MCQs
- Buy MongoDB Books