Migrate a Replica Set Member to a New Server
On this page
Overview
You can replace one member of a managed replica set with another member from the Ops Manager console. Use this process to migrate members of replica sets to new underlying servers. This procedure requires that you:
Provision the new server.
Add an extra member to the replica set.
Shut down old member of the replica set.
Un-manage the old member (Optional).
Considerations
Initial Sync
When you add a new replica set member, the member must perform an initial sync, which takes time to complete, depending on the size of your data set. For more information on initial sync, see Replica Set Data Synchronization.
Migrating Multiple Members
You can remove or migrate multiple replica set members at once, but a majority of the voting members must remain. If you need to remove more voting members, remove them one at a time.
Example
Example 1
You have a four-node replica set. All nodes are voting members. You can remove only one node, which preserves the majority of three out of four voting nodes. You can remove another node from the remaining three-node replica set afterward. This preserves the majority of the remaining voting nodes.
Example
Example 2
You have a four-node replica set. Three nodes are voting members and one node is a non-voting member. You can remove one voting member and one non-voting member at the same time. This preserves the majority of two out of three voting nodes.
To learn more about voting, see Replica Set High Availability and Replica Set Elections.
Removing members during migration might affect the ability of the replica set to acknowledge writes, depending on the level of write concern you use. For more information, see Write Concern in the MongoDB manual.
Procedure
Perform this procedure separately for each member of a replica set to migrate.
Navigate to the Processes tab for your deployment.
If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
If it is not already displayed, select your desired project from the Projects menu in the navigation bar.
Click Processes in the sidebar.
Add a member to the replica set.
In the Member Configuration section, click
Add a Mongod to add a new mongod
member.
Ops Manager displays the following configuration settings for the
mongod
:
Setting | Description |
---|---|
Member | Select one of the following replica set member roles from the menu:
|
Hostname | Select from the menu the host to which Ops Manager Automation deploys the replica set member. The menu only lists hosts under Ops Manager Automation. For complete documentation on adding servers to Ops Manager Automation, see Provision Servers for Automation. This hostname can be a hostname, an FQDN, an IPv4 address, or an IPv6 address. |
Port | Specify the IANA port
number for the The |
Votes | |
Priority | |
Delay | Specify the number of seconds "behind" the primary member this
member should "lag". This setting corresponds to the
|
Build Indexes | Specify |
Tags | Specify the tag or tags associated to the replica set.
This setting corresponds to the
For complete documentation on replica set tags, see Replica Set Tags |
Ensure you select the Hostname that corresponds to the newly provisioned server.
Configure the new mongod
process.
From the Replica Set Configuration section, view the table under the Replica Set Settings heading. The Process Name column lists the hostname and port of each replica set member set. Ops Manager initially groups the processes under the replica set name. Click the icon to the left of the replica set name to list all members associated to the replica set.
Configure the following settings for the Process Name that corresponds to the newly added member:
Setting | Description |
---|---|
Version | Select the MongoDB server version of the Ops Manager lists only the MongoDB versions that are available for your deployment. To disable this filtering, see
|
Data Directory | Specify the directory where the Each |
Log File | Specify the full path to the For example, specifying The |
Verify that the new member has synchronized.
On the Deployment page, click the name of the replica
set to open the cluster view. Verify that the
status for each
new member is no longer in the Recovering
state.
Remove the old member from the replica set.
From the Deployment view, click Modify.
Navigate to the Member Configuration section.
Click the ellipses button for the member you want to remove.
From the menu, select Remove from Replica Set.
Important
Removing the primary replica set member triggers an election. The replica set cannot process write operations until the election completes. For complete documentation on replica set elections, see Replica Set Elections.
Click Save to return to the Deployment screen.
Click Review Changes and then click Confirm & Deploy. Ops Manager converts the removed replica set member to a standalone cluster visible in the Deployment view.
Optional: Remove the old member.
To remove the member from Ops Manager management, click the ellipsis icon and select Remove from Ops Manager.
Ops Manager does not automatically shut down a process removed from management. If you did not shut down the process in the previous step, you must do so manually by connecting directly to the host machine.
For complete documentation on removing processes from Ops Manager management, see Stop Managing and/or Monitoring One Deployment.