On this page
Replace a Replica Set Member
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.
Operation
To change the hostname for a replica set member modify the members[n].host
field. The value of members[n]._id
field will not change when you reconfigure the set.
See Replica Set Configuration and rs.reconfig()
for more information.