I am replacing a member of a replica set (the new member has a different IP address).
What I am looking to do is as follows:
- RSYNC the data directory of the existing secondary node to the new node.
- Stop the existing node.
- Map the existing hostname to the IP of the new node.
- Start MongoDB on this new node with the replica set.
Mongo Version 3.2 and storage engine MMapV1
it is 3 member replica set.
Primary
Secondary
Arbiter
My plan is to first replace arbiter with a new secondary node then. Do the procedure with on existing secondary node to replace this also.
Could someone please verify if the above steps make sense?
rsync
files from a running deployment as this is likely to introduce data inconsistency if files are being written to. You would be much safer reversing your first two steps: stop the existing secondary and then rsync the data files.rsync
(the command line file-copying tool) or MongoDB replication initial sync? Are you replacing one member of the replica set or two (an arbiter and/or secondary)? Per my original comment, you should not usersync
on a running deployment. Initial sync is the normal process where you wouldrs.add()
a new secondary. You cannot convert an arbiter into a secondary, as arbiters do not have any data.