3

I have an Elastic Beanstalk application running for several years using an RDS database (now attached to the EB itself but set up separately).

This has been running without issues for ages. There's a security group attached to the load balancer, that allows traffic on port 5432 (postgreSQL).

Now I've set up a new environment which is identical, but since I want to use Amazon Linux 2, I cannot clone the existing environment (a cloned environment works as well, BTW). So I've carefully set up everything the same way - I've verified that the SG:s are the same, that all environment properties are set, that the VPC and subnets are identical. However, as soon as my EB instances try to call RDS, it just gets stuck and times out, producing a HTTP 504 for the calling clients.

I've used the AWS Reachability Analyzer to analyze the path from the EB's EC2 instance to the ENI used by the RDS database instance, and that came out fine - there is reachability, at least VPC and SG-wise. Still, I cannot get the database calls to work.

How would one go about to debug this? What could cause a postgresQL connection with valid parameters, from an instance which is confirmed to reach the RDS ENI, to fail for this new instance, while the existing, old, EB application still runs fine? The only differences in configuration are (new vs original):

  • Node 14 on Amazon Linux 2 vs Node 10 on original Amazon Linux ("v1")
  • Application load balancer vs classic load balancer
  • Some Nginx tweaks from the old version removed as they weren't compatible nor applicable

If the path is reachable, what could cause the RDS connectivity to break, when all DB connection params are also verified to be valid?

Edit: What I've now found is that RDS is attached to subnet A, and an EB having an instance in subnet A can connect to it, but not an instance in subnet B. With old EBs and classic load balancers, a single AZ/subnet could be used, but now at least two must be chosen. So I suspect my route tables are somehow off. What could cause a host in 10.0.1.x not to reach a host in 10.0.2.x if they're both in the same VPC comprising of these two subnets, and Reachability Analyzer thinks there is a reachable path? I cannot find anywhere that these two subnets are isolated.

JHH
  • 8,567
  • 8
  • 47
  • 91

1 Answers1

2

check the server connection information

nslookup myexampledb.xxxx.us-east-1.rds.amazonaws.com

verify information

telnet <RDS endpoint> <port number>

nc -zv <RDS endpoint> <port number>

note: keep in mind to replace your endpoint/port to your endpoint available in database settings

Meet Joshi
  • 81
  • 6