AWS RDS: cannot connect to server

0

I have created a RDS PostgreSQL DB Instance, see it in AWS Explorer. But cannot connect to it using pgAdmin, it responses: Unable connect to server etc. How to fix it?

ps. It is Publicly accessible, also , I have added inbound rule: all trafic, all ports, My Ip - but again cannot connect from pgAdmin

port range: all type: all trafic source type: custom protocol: all source: myip/32

  • Please provide more information to how your trying to connect to the Rds instance and what your network connectivity looks like

  • Please see above I have edited my question. Also, I use pgAdmin on my computer, it shows me an INTERNAL SERVER ERROR: unable to connect etc

2개 답변
0

The fact that you’re trying a 172.x address raises the question is your RDS really publicly accessing?

A 172.16.0.0/12 network range is an RFC1918 address space. I’m going to assume the IP address returned via a dns lookup is a 172.31.x.x which is the default VPC CiDR range. You will never be able to connect to this address over the public internet.

Connecting via dns name or its ip will always result in the same issue.

A few things you need to check.

  1. The Rds instance is in a public subnet.
  2. the RDS instance does have Public accessible set
  3. The public subnet default routes to an IgW
  4. The security group on the RDS allows your PUBLIC ip and not the private IP of your home machine.
  5. NACLs allow connectivity to and from the postgress port and ip address
profile picture
전문가
답변함 일 년 전
  • Thank you. Could you please look at my rules, what is wrong there: GroupId,GroupName,Type,IpProtocol,FromPort,ToPort,IpRanges,Ipv6Ranges,PrefixListIds,UserIdGroupPairs sg-06517,default,Inbound/Ingress,'-1,,,0.0.0.0/0,,, sg-06517,default,Inbound/Ingress,'-1,,,,::/0,, sg-06517,default,Inbound/Ingress,'-1,,,,,,sg-06517 sg-065*17,default,Outbound/Egress,'-1,,,0.0.0.0/0,,,

  • Rules look fine. Does the dns name return a 172.31 ip address?

  • nslookup 12121212.eu-west-2.rds.amazonaws.com DNS request timed out. timeout was 2 seconds. Server: UnKnown Address: fe80::b669:.... DNS request timed out. timeout was 2 seconds. DNS request timed out. timeout was 2 seconds. *** Request to UnKnown timed-out

  • Looks like now you have dns resolution issues with dns timeouts.

0

Hi, it's probably a routing issue: If you connect via the dns name, try to run nslookup (windows) to get the ip address and then try to connect via this ip instead of dns.

Another way to check the root of your problem it to telnet to the dns name / ip + port to see if you get the tcp session properly established. For that, see https://netbeez.net/blog/telnet-to-test-connectivity-to-tcp/

profile pictureAWS
전문가
답변함 일 년 전
  • Telnet: Connecting To ***.eu-west-2.rds.amazonaws.com...Could not open connection to the host, on port 5432: Connect failed

  • Also, Microsoft Telnet> open 172...** 5432 Connecting To 172...** ...Could not open connection to the host, on port 5432: Connect failed

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠