英文:
Can't connect to RDS read replicas' domain name hosted via Route53
问题
我有一个带有多个只读副本的RDS。为了平衡可用的只读副本,我使用了Route53的加权托管区。我使用以下链接进行操作:AWS只读副本
在完成此链接中提供的步骤后,我可以从本地连接到RDS(在将我的本地IP列入白名单后)。但是当我尝试从EC2服务器连接时,它出现了错误:
ERROR 2005 (HY000): 未知的MySQL服务器主机'rds-endpoint.com' (0)
我已经尝试将EC2机器的公共IP和私有IP都列入白名单。不确定是什么导致了这个问题。
但是,当我尝试将MySQL端口对公共网络开放(0.0.0.0/0,::/0)时,我可以连接到它。问题是什么?我该如何解决它。
英文:
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.
答案1
得分: 0
我使用的服务器托管在默认VPC中,而RDS托管在另一个自定义VPC中。当我在与RDS托管的相同VPC中创建了一个EC2实例时,问题得到了解决。我能够调用Route53托管区域的公共和私有域名。
有了这个解决方案,我的问题得以解决。不确定是否有其他VPC连接的方法。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论