- Manage Deployments >
- Migrate a Replica Set Member to a New Server
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.
Provision the new server.¶
See Provision Servers.
Click Modify for the replica set cluster.¶
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 | Specify the number of votes that the replica set member has during
elections. This setting corresponds to the
votes mongod
replica set configuration option. |
Priority | Specify the priority of the member during elections. Replica set
members with a priority of 0 cannot become the primary
and cannot trigger elections. This setting
corresponds to the
priority
mongod replica set configuration option. |
Delay | Specify the number of seconds “behind” the primary member this
member should “lag”. This setting corresponds to the
secondaryDelaySecs
mongod replica set configuration option. |
Build Indexes | Specify true to direct the mongod to build
indexes. This setting
corresponds to the
buildIndexes
mongod replica set configuration option. |
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 caret right icon 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 Available Versions 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 Example Specifying The |
Click Apply.¶
Click Review & Deploy to review your changes.¶
Click Confirm & Deploy to deploy your changes.¶
Otherwise, click Cancel and you can make additional changes.
Remove the old member from the replica set.¶
- From the Deployment view, click Modify.
- Navigate to the Member Configuration section.
- Click the ellipsis h icon 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: Shut down the old member.¶
From the Deployment view, click the standalone’s ellipsis icon and select Shutdown. Click Review Changes and then click Confirm & Deploy.
Optional: Remove the old member.¶
To remove the member from Ops Manager management, click the ellipsis h icon 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.