简体   繁体   English

无法从 pgadmin4 连接到 AWS RDS postgres 实例

[英]unable to connect to AWS RDS postgres instance from pgadmin4

I have created an AWS RDS postgres instance and i am trying to hit the db using postgres4 dashboard from my local machine but am unable to create a connection and it is throwing an error like我已经创建了一个 AWS RDS postgres 实例,我正在尝试使用本地机器上的 postgres4 仪表板访问数据库,但无法创建连接并且它抛出了类似的错误

Unable to connect to server:
could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "clienteledev2.XXX.ap-south-1.XXX.com" (xx.xx.xx.xx) and accepting
TCP/IP connections on port 5432?

I went through AWS documentation and have already done the necessary settings like: setting public availability我浏览了 AWS 文档并且已经完成了必要的设置,例如:设置公共可用性

1)setting Public accessibility flag to YES 1) 将公共可访问性标志设置为 YES

2)Adding inbound rule in security group in order to open ports for communication ie port 5432 as tcp for postgresSQL 2) 在安全组中添加入站规则,以便打开通信端口,即端口 5432 作为 tcp for postgresSQL

3)even have added rule for incoming traffic from my machine as custom tcp and for source myIP 3)甚至为来自我的机器的传入流量添加了规则作为自定义 tcp 和源 myIP

(see the screenshot) (见截图) 安全组入站规则

I am using default VPC which is public and on my personal machine i have exempted or allowed pgadmin to connect through firewall.我使用的是公共的默认 VPC,在我的个人计算机上,我已豁免或允许 pgadmin 通过防火墙进行连接。

I have searched enough online and have found some solutions suggested for previous questions like these none of them worked.我已经在网上搜索了足够多的内容,并为以前的问题找到了一些建议的解决方案,这些问题都没有奏效。 What is that i am doing wrong?我做错了什么?

The easiest way would be to add an INBOUND rule to your DB Security group allowing access from anywhere 0.0.0.0/0 for the DB TCP port (in this scenario, it is 5432 ).最简单的方法是将 INBOUND 规则添加到您的 DB 安全组,允许从0.0.0.0/0的任何位置访问 DB TCP 端口(在这种情况下,它是5432 )。 This will allow any IP address to access to your publicly accessible DB instance.这将允许任何 IP 地址访问您的可公开访问的数据库实例。 Please be warned that this brings in its own set of security risks.请注意,这会带来一系列安全风险。

To avoid this, commonly used alternative is to connect via a VPN and have the VPN IP address allowed for INBOUND.为避免这种情况,常用的替代方法是通过 VPN 连接并允许 INBOUND 使用 VPN IP 地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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