Replace a Replica Set Member MongoDB Documentation, Release 3.0.4 If you need to change the hostname of a replica set member without changing the configuration of that member or the set, you can use the operation outlined in this tutorial. For example if you must re-provision systems or rename hosts, you can use this pattern to minimize the scope of that change. To change the hostname for a replica set member modify the host field. The value of _id field will not change when you reconfigure the set. Note: Any replica set configuration change can trigger the current primary to step down, which forces an election (page 580). During the election, the current shell session and clients connected to this replica set disconnect, which produces an error even when the operation succeeds. See Replica Set Configuration (page 652) and rs.reconfig() for more information. To change the hostname to mongo2.example.net for the replica set member configured at members[0] , issue the following sequence of commands: The following tutorials provide information in configuring replica set members to support specific operations, such as to provide dedicated backups, to support reporting, or to act as a cold standby. Adjust Priority for Replica Set Member Overview 9.3.2 Member Configuration Tutorials Example cfg = rs.conf() cfg.members[0].host = "mongo2.example.net" rs.reconfig(cfg) Adjust Priority for Replica Set Member (page 620) Change the precedence given to a replica set members in an elec- tion for primary. Prevent Secondary from Becoming Primary (page 621) Make a secondary member ineligible for election as pri- mary. Configure a Hidden Replica Set Member (page 623) Configure a secondary member to be invisible to applications in order to support significantly different usage, such as a dedicated backups. Configure a Delayed Replica Set Member (page 624) Configure a secondary member to keep a delayed copy of the data set in order to provide a rolling backup. Configure Non-Voting Replica Set Member (page 625) Create a secondary member that keeps a copy of the data set but does not vote in an election. Convert a Secondary to an Arbiter (page 626) Convert a secondary to an arbiter. The priority settings of replica set members affect the outcomes of elections (page 580) for primary. Use this setting to ensure that some members are more likely to become primary and that others can never become primary. Chapter 9. Replication 620 Operation