Navigation
You were redirected from a different version of the documentation. Click here to go back.

Configure AWS Integration

Important

The ability to provision MongoDB servers in AWS using Cloud Manager was retired in October 2017.

  • Any existing clusters continue as they are.
  • This retirement impacts DNS entries in the following ways:
    • Entries for existing servers continue to resolve to the same IP address to which they currently resolve until at least January 1, 2023.
    • Servers that undergo a change of IP address due to maintenance or an instance stop/restart will no longer be resolvable via their mongodbdns.com hostname.
    • All existing mongodbdns.com hostnames will stop working in May 2023.
  • Cloud Manager can manage hosts provisioned directly through AWS. See Provision Servers for Automation.
  • If you are interested in fully managed provisioning on AWS, evaluate MongoDB Atlas.

If you want to continue using Cloud Manager to manage these deployments, update the hostname for each host using one of the following methods for a replica set:

Considerations

These procedures involve stepping down the old primary and triggering at least one election for a new primary. All writes to the primary fail during the period starting when the rs.stepDown() method is received until either a new primary is elected, or if there are no electable secondaries, the original primary resumes normal operation. For MongoDB versions 4.0 and earlier, all client connections are closed.

Consider performing this procedure during a maintenance window during which applications stop all write operations to the cluster.

To learn more about elections, see rs.stepDown() behavior and Replica Set Elections.

Rolling Resync onto New EC2 Instances

1

Create a new EC2 instance for each member of the replica set.

2

Replace each non-primary replica set member with a new EC2 instance.

  1. Add a new instance to the replica set using its EC2 hostname. To learn more, see Add Members to a Replica Set.
  2. Wait for the initial sync to complete. To learn how to get the status of an initial sync, see the MongoDB manual.
  3. Remove one old replica set member with a mongodbdns.com hostname. To learn more, see Remove Members from Replica Set.

Repeat for each non-primary replica set member.

3

Change your application connection string to use the AWS EC2 hostnames.

4

Replace the primary with a new EC2 instance.

  1. Add the last new instance to the replica set using its EC2 hostname. To learn more, see Add Members to a Replica Set.

  2. Wait for the initial sync to complete. To learn how to get the status of an initial sync, see the MongoDB manual.

  3. Connect to the primary and step it down. To learn more, see rs.stepDown().

    Note

    Stepping down the primary triggers at least one election for a new primary. To learn more about elections, see Replica Set Elections.

  4. Remove the old primary with the mongodbdns.com hostname from the replica set. To learn more, see Remove Members from Replica Set.

Update a Replica Set’s Hostnames

Follow the Change Hostnames while Maintaining Replica Set Availability procedure in the MongoDB manual.

An overview of the linked procedure is as follows:

1

Connect to the primary.

2

Remove a secondary member from the replica set and re-add it using its EC2 hostname.

Repeat for each non-primary member of the replica set.

3

Change your application connection string to use the AWS EC2 hostnames.

4

Reconnect to the primary and step it down.

Note

Stepping down the primary triggers at least one election for a new primary. To learn more about elections, see Replica Set Elections.

5

Connect to the new primary.

6

Remove the old primary from the replica set and re-add it using its EC2 hostname.