MongoDB Questions and Answers – Member Configuration

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

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

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

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

Answer: c
Explanation: When the primary steps down, the mongod closes all client connections.

advertisement
advertisement

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

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

Answer: b
Explanation: The length of the secondary slaveDelay must fit within the window of the oplog.

Note: Join free Sanfoundry classes at Telegram or Youtube

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

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

Answer: b
Explanation: rs.remove() removes the member described by the hostname parameter from the current replica set.

advertisement

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

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

Answer: a
Explanation: rs.printSlaveReplicationInfo() returns a formatted report of the status of a replica set from the perspective of the secondary member of the set.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). 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!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.