MongoDB Associate Database Administrator(Based on MongoDB 6.0 and 7.0+) C100DBA Question # 50 Topic 6 Discussion
C100DBA Exam Topic 6 Question 50 Discussion:
Question #: 50
Topic #: 6
What command set removes node-1.cluster1.mycompany.local:27017 and node-2.cluster1.mycompany.local:27017 from the replica set, then adds node-1.cluster1.mycompany.local:27017 back to the replica set?
The supported mongosh helpers for replica-set membership changes are rs.remove() and rs.add(). rs.remove(hostname) removes the member whose host string matches the supplied host:port, while rs.add() adds a new member using either a host string or a member configuration document that includes a host field. Option C uses those documented methods in the required sequence: remove node 1, remove node 2, then add node 1 back. The names rs.removeNode() and rs.addNode() shown in the other options are not standard MongoDB replica-set helper methods. Membership changes must be performed carefully because modifying voting or data-bearing membership can affect majority calculations, elections, and availability. Administrators normally execute membership changes while connected to the current primary, allow configuration propagation, and verify replica-set health afterward with rs.status() or related diagnostics. If a removed data-bearing node is later re-added, it may need to synchronize depending on how far its data has diverged from the current replica-set history. Among the choices, option C is the only valid command sequence.
Study Guide reference/topic:Cluster Reliability and Data Resilience - replica-set membership, rs.remove(), rs.add(), and topology changes.
===========
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit