I'm using Amazon Relational Database Service (Amazon RDS) Multi-AZ deployment. Why can't I communicate with my RDS instance after a failover? What can I do to avoid this?

When you use Multi-AZ deployment, Amazon RDS creates a primary DB instance in one Availability Zone associated with a subnet. Then, Amazon RDS creates a standby DB instance in a different Availability Zone associated with a different subnet.

After a failover, you might experience connection issues if the primary instance's subnet has different traffic-routing rules than the standby instance's subnet. To avoid these connection problems, be sure that the subnets in your DB subnet group have consistent routing rules, as defined in a route table.

To be sure that the subnets in your DB subnet group have consistent routing rules, associate the subnets with one route table. To create a DB subnet group with subnets associated with the same route table, follow these steps:

  1. Create a virtual private cloud (VPC).
  2. Create an internet gateway and attach it to your VPC.
  3. Create a subnet in each Availability Zone.
  4. Create a route to the internet gateway.
  5. Associate the subnets with the route table.
  6. Create a DB subnet group associated with the VPC.

Note: In addition to inconsistent route tables, there are other issues that might cause connection problems with DB instances. For other ways to troubleshoot Amazon RDS connection problems, see How do I resolve problems connecting to my Amazon RDS database instance?   

Create a VPC

1.    Open the Amazon VPC console.

2.    From the navigation pane, choose Your VPCs.

3.    Choose Create VPC.

4.    For Name tag, type a name for your VPC.

5.    For IPv4 CIDR block, type a CIDR block.

6.    For IPv6 CIDR block, choose No IPv6 CIDR Block.

7.    For Tenancy, choose Default.

8.    Choose Yes, Create.

Create an internet gateway and attach it to your VPC

Follow the steps in Creating and Attaching an Internet Gateway.  

Create a subnet in each Availability Zone

1.    From the Amazon VPC console's navigation pane, choose Subnets.

2.    Choose Create Subnet.

3.    For Name tag, type a name for the subnet.

4.    For VPC, choose the VPC you created.

5.    For Availability Zone, choose one Availability Zone in the VPC.

6.    For IPv4 CIDR block, type a CIDR block subset of the VPC's CIDR.

7.    Choose Yes, Create.

8.    Repeat steps 2 through 7 for each Availability Zone in the VPC.

Create a route to the internet gateway

1.    From the Amazon VPC console's navigation pane, choose Route Tables.

2.    From the resource list, choose the route table associated with the VPC you created.

3.    Choose the Routes view. Then, choose Edit.

4.    Choose Add another route.

5.    For Destination, type 0.0.0.0/0

6.    For Target, choose the internet gateway you created.

7.    Choose Save.

Associate the subnets with the route table

1.    From the details view of your route table, choose the Subnet Associations view.

2.    Choose Edit.

3.    Select Associate for all subnets in the VPC.

4.    Choose Save.

Create a DB subnet group associated with the VPC

1.    Open the Amazon Relational Database Service (Amazon RDS) console.

2.    From the navigation pane, choose Subnet Groups.

3.    Choose Create DB Subnet Group.

4.    For Name, type a name for your DB subnet group.

5.    For Description, type a description for your DB subnet group.

6.    For VPC ID, choose the VPC you created.

7.    For Availability Zone, choose one Availability Zone.

8.    For Subnet ID, choose the subnet that corresponds with the Availability Zone you previously chose.

9.    Choose Add.

10.   Repeat steps 7 through 9 for all Availability Zones.

11.    Choose Create.

After you create the DB subnet group, you can launch Multi-AZ DB instances in the associated VPC. The instances have consistent routing rules because the subnets in the DB subnet group are associated with the same route table.


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2018-04-02