我对AWS配置感到困惑.我的目标是创建一个可从网络内部和外部访问的数据库.
I am stumped with AWS configuration. My goal is to create a database that's accessible from inside and outside the network.
这就是我所拥有的.RDS实例运行postgresql.从VPC内部进行的连接可以正常工作.
Here is what I have. RDS instance runs postgresql. Connections from inside the VPC work correctly.
将端点设置为可公开访问-并且从外部访问时,确实可以解析.但是,连接挂起,表明流量被某人阻止.
The endpoint is set up to be publicly accessible - and when accessed from the outside, does in fact resolve. However, the connection hangs, indicating the traffic is blocked by somebody.
安全组很好:入站:端口5432从0.0.0.0/0开始出站:全部从0.0.0.0/0
Security group is good: Inbound: Port 5432 from 0.0.0.0/0 Outbound: all from 0.0.0.0/0
子网.我认为那是哪里出了问题,对不对?最初,我在子网组中有两个专用子网和两个公用子网.为简化起见,我在不更改结果的情况下删除了私有的.
Subnets. I assume that's where something is wrong, right? At first I had two private and two public subnets in the subnet group. To simplify, I removed the private ones without changing the outcome.
因此,我们有两个公共子网:
So we have two public subnets:
两者都与Internet网关具有相同的路由表
Both have the same route table with an Internet Gateway
据我所知,一切都在正常进行中...那么谁在阻止我的数据库连接?
As far as I can tell, everything is in working order... So who is blocking my database connection?
推荐答案要检查的两件事:
确保RDS实例具有公开访问的属性集,以便为它分配一个公共地址
Ensure that the RDS instance has the publicly accessible attribute set so that it is assigned a public address
还根据AWS RDS文档,如果要公开访问VPC中的数据库实例,则必须启用VPC属性DNS主机名和DNS解析.
Also according to the AWS RDS docs, "If you want your DB instance in the VPC to be publicly accessible, you must enable the VPC attributes DNS hostnames and DNS resolution."
还要检查您的RDS实例主机名解析为的IP是公共IP地址.
Also, check that the IP that your RDS instance hostname resolves to is a public IP address.
更多推荐
AWS RDS公共访问
发布评论