简体   繁体   中英

Can't connect to RDS read replicas' domain name hosted via Route53

I have an RDS with multiple read replicas. In order to load balance the available read replicas, I used Route53's weighted hosted zone. I use this link for doing that: AWS Read Replica

After completing the steps provided in this link, I could connect to the RDS locally (after whitelisting my local IP). But when I try to connect to it from an EC2 server, it is giving the error:

ERROR 2005 (HY000): Unknown MySQL server host 'rds-endpoint.com' (0)

I have tried whitelist both the EC2 machine's public and private IPs. Not sure, what is causing the issue.

But, when I tried opening the MySQL port to the public (0.0.0.0/0,::/0), I can connect to it. What is the issue? How can I resolve it.

The server that I used was hosted in the default VPC and the RDS is hosted in another custom VPC. When I created an EC2 instance in the same VPC where the RDS is hosted, the issue resolved. I am able to call both public and private domain name of Route53's hosted zones.

With this, my issue got resolved. Not sure, whether there is any way to connect from other VPC.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM