How do I troubleshoot connectivity issues to Amazon RDS Multi-AZ instances after failover?

Last updated: 2019-03-13

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?

Short Description

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

After a failover, you might experience connection issues if the subnet of the primary instance has different traffic-routing rules than the subnet of the standby instance. 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:

  • Create an Amazon Virtual Private Cloud (Amazon VPC).
  • Create an internet gateway and attach it to your VPC.
  • Create a subnet in each Availability Zone.
  • Create a route to the internet gateway.
  • Associate the subnets with the route table.
  • Create a DB subnet group associated with the VPC.

Note: There are other issues that might also 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?

Resolution

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, enter a name for your VPC.
  5. For IPv4 CIDR block, enter 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. Open the Amazon VPC console.
  2. From the navigation pane, choose Subnets.
  3. Choose Create Subnet.
  4. For Name tag, enter a name for the subnet.
  5. For VPC, choose the VPC you created.
  6. For Availability Zone, choose one Availability Zone in the VPC.
  7. For IPv4 CIDR block, enter a CIDR block subset of the VPC's CIDR.
  8. Choose Yes, Create.
  9. Repeat steps 2 through 8 for each Availability Zone in the VPC.

Create a route to the internet gateway

  1. Open the Amazon VPC console.
  2. From the navigation pane, choose Route Tables.
  3. From the resource list, choose the route table associated with the VPC you created.
  4. Choose the Routes tab. Then, choose Edit.
  5. Choose Add another route.
  6. For Destination, enter 0.0.0.0/0.
  7. For Target, choose the internet gateway that you created.
  8. Choose Save.

Associate the subnets with the route table

  1. Select your route table, and choose the Subnet Associations tab.
  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 RDS console.
  2. From the navigation pane, choose Subnet Groups.
  3. Choose Create DB Subnet Group.
  4. For Name, enter a name for your DB subnet group.
  5. For Description, enter a description for your DB subnet group.
  6. For VPC, 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 your subnets.
    Note: If you want to add all the subnets for the VPC to the subnet group, then you can skip steps 7 through 9. Instead, choose Add all subnets related to this VPC to add all subnets of this VPC to the subnet group.
  11. Choose Create.

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


Did this article help you?

Anything we could improve?


Need more help?