Navigation

Edit a Replica Set

Overview

You can add, remove, and reconfigure members in a replica set directly in the Ops Manager console.

Note

Ops Manager restarts a node in a replica set or sharded cluster when you change configuraton file options for the MongoDB process running on the node. The following options trigger a restart only for the specified changes:

  • security.clusterAuthMode: Changing the value from keyfile to sendKeyFile triggers a restart. All other changes to this option do not.
  • net.ssl.mode: Changing the value from disabled to allowSSL triggers a restart. All other changes to this option do not.

A restarted node triggers an election if the node was the primary. In addition, modifying the member settings of the current primary may trigger an election.

Procedures

Add a Replica Set Member

You must have an existing server to which to deploy the new replica set member. To add a member to an existing replica set, increasing the size of the set:

1

Click Deployment, then the Processes tab, then the Topology view.

2

On the card with the replica set, click Modify.

3

In Member Configuration, click Add a Mongod.

4

In Hostname, select the host that you want to add as a new member of the replica set.

Use the following procedure to add the host if it doesn’t appear in the Hostname list:

  1. In Hostname, select New Server.

    If no hosts have yet been added to the project, the Hostname list does not appear. Click Install Agent instead.

  2. In the Add New Server dialog, select your operating system and click Next.

  3. Follow the instructions to install an Automation Agent on the new host. See Install or Update the Automation Agent for more information.

Note

When adding a new member to a replica set, set Build Indexes to True if you want the member’s mongod to build indexes. You cannot change this value after the Automation Agent adds the new member to the replica set. See members[n].buildIndexes for more information.

Warning

If your replica set uses SSL (or TLS), you must create and install the necessary SSL certificates on the new replica set member host then set the SSL settings for the mongod or mongos process for the new replica set member on that host. Automation does not create and install the certificates and configure these settings automatically. If you do not configure SSL on the new member, you cannot add it to the existing SSL-enabled replica set. To learn how to enable SSL on the new replica set member, see Enable SSL for a Deployment.

  1. In the Replica Set Configuration section, complete the following fields for the new member:

    Auth Schema Version Select the schema for storing the user data for your deployment. See Upgrade to SCRAM for more information.
    Feature Compatibility (Optional) Select the feature compatibility set. This field appears if your deployment MongoDB version is 3.4 or later.
    Version

    Select the MongoDB version for your replica set.

    Note

    If the dropdown menu does not include the MongoDB version you want for your deployment, you must enable it in the Version Manager.

    Data Directory Specify the full path of the directory where the mongod process will store data files.
    Log File Specify the location and name of the log file for the mongod process on the new host.
5

Click Save.

6

Click Review & Deploy to review your changes.

7

Click Confirm & Deploy to deploy your changes.

Otherwise, click Cancel and you can make additional changes.

Important

To avoid disrupting majority writes, new members are now added to replica sets as priority=0, votes=0 until they reach secondary state, after which Ops Manager automatically updates the configuration to match the priority and votes value specified in the deployment.

Edit a Replica Set Member

To reconfigure a member as an arbiter, see Replace a Member with an Arbiter

1

Click Deployment, then the Processes tab, then the Topology view.

2

On the card with the replica set, click Modify.

3

In Member Configuration, modify the settings for the replica set member that you want to edit.

Hostname Specify the hostname for the replica set member.
Port Specify the port for the replica set member.
Votes Specify whether the replica set member votes in elections. A value of 1 indicates the member votes, while a value of 0 indicates that the member does not vote.
Priority Specify the priority of the replica set member during elections. Non-voting members must have a priority of 0.
Delay Specify whether the member is a delayed replica set member.
Build Indexes Specify whether the replica set member builds indexes.
Tags Enter JSON that defines the tag set that you want to add to the replica set member.
4

Click Save.

5

Click Review & Deploy to review your changes.

6

Click Confirm & Deploy to deploy your changes.

Otherwise, click Cancel and you can make additional changes.

Replace a Member with an Arbiter

You cannot directly reconfigure a member as an arbiter. Instead, you must must add a new member to the replica set as an arbiter. Then you must shut down an existing secondary.

1

Click Deployment, then the Processes tab, then the Topology view.

2

On the card with the replica set, click Modify.

3

Add a new member to the replica set.

Select Arbiter from the Member list when you Add a Replica Set Member.

4

Click Save.

5

Click Review & Deploy to review your changes.

6

Click Confirm & Deploy to deploy your changes.

Otherwise, click Cancel and you can make additional changes.

7

Remove the secondary member of the replica set member that you want to replace with the arbiter.

Note

To determine which processes are secondaries, click the Metrics tab and select secondaries in Toggle Members.

  1. Click Modify next to the replica set.
  2. Select Remove from Replica Set.
  3. Click Save.
8

Click Review & Deploy.

9

Click Confirm & Deploy.

10

Remove the standalone instance. (Optional)

Upon completion, Ops Manager removes the member from the replica set. The instance continues to run as a standalone. To shut down the standalone, see Shut Down a MongoDB Process.

Remove a Replica Set Member

Removing a member from a replica set does not shut down the member or remove it from Ops Manager. Ops Manager still monitors the mongod as as standalone instance.

When removing members, you must keep a majority of voting members active with respect to the original number of voting members. Without a majority, the primary replica set member steps down and the replica set becomes read-only. For more information on voting, see Replica Set Elections and Replica Set High Availability in the MongoDB Manual.

Removing members 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.

To remove a member:

1

Click Deployment, then the Processes tab, then the Topology view.

2

On the card with the replica set, click Modify.

3

In Member Configuration, click the ellipsis next to the replica set member that you want to remove and select Remove from Replica Set.

4

Click Remove from Replica Set to confirm.

5

Click Save.

6

Click Review & Deploy to review your changes.

7

Click Confirm & Deploy.

8

Remove the standalone instance. (Optional)

Upon completion, Ops Manager removes the member from the replica set. The instance continues to run as a standalone. To shut down the standalone, see Shut Down a MongoDB Process.

Edit a Cluster Configuration

To edit a cluster configuration:

1

Click Deployment, then the Processes tab, then the Topology view.

2

On the card with the replica set, click Modify.

3

Configure the replica set.

In the Replica Set Configuration section, complete the following fields.

Auth Schema Version Select the schema for storing the user data for your deployment. If you are upgrading from a MongoDB version older than 3.0, MongoDB 3.0 uses a different schema for user data than previous versions. For compatibility information, see the Security Changes in the MongoDB 3.0 release notes.
Feature Compatibility (Optional) Select the feature compatibility set. This field appears if your deployment MongoDB version is 3.4 or later.
Version

Select the MongoDB version for your replica set.

Note

If the dropdown menu does not include the MongoDB version you want for your deployment, you must enable it in the Version Manager.

Log File Specify the location and name of the log file for the mongod process. The location must exist on the host.
4

Click Save.

5

Click Review & Deploy to review your changes.

6

Click Confirm & Deploy to deploy your changes.

Otherwise, click Cancel and you can make additional changes.

Edit Replication Settings

To edit replication settings:

1

Click Deployment, then the Processes tab, then the Topology view.

2

On the card with the replica set, click Modify.

If you do not see the replica set, click the Processes tab, then the Topology view.

3

In Replication Settings, modify the desired replication setting.

See Replica Set Configuration Fields for descriptions of all fields and which versions of MongoDB support each field.

4

Click Save.

5

Click Review & Deploy to review your changes.

6

Click Confirm & Deploy to deploy your changes.

Otherwise, click Cancel and you can make additional changes.

Additional Information

For more information on replica set configuration options, see, Replica Set Configuration in the MongoDB manual.