Postgres PgAdmin 3:服务器不听——什么都试过了

Postgres PgAdmin 3: Server doesn't listen - Tried everything

我尝试在 IPTables 中打开端口,
将收听地址设置为 *
已添加
host all all 23.81.27.0/24 信任
甚至
托管所有所有 0.0.0.0/0 信任

YouGetSignal 显示端口已关闭,我无法通过 PgAdmin 连接到我的数据库。

我明白了

could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "23.81.27.206" and accepting TCP/IP connections on port 5432?

有什么想法吗?

我已经尝试重启 Postgresql、IPtables 和服务器。

有这个错误

could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "23.81.27.206" and accepting TCP/IP connections on port 5432?

无需修改hba_file。 postgres.conf 中的 listen_address 未设置为侦听外部 iface,或者防火墙阻止它/不翻译/其他网络问题。第一种情况通常人们将 listen_address 修改为错误的 postgres.conf 或不重新启动服务器。为了确保它没有发生在你身上,ssh 到服务器,psql 到它并检查

show config_file;
show listen_addresses;

如果没问题,那么还在遥控器上 shell :

psql -h 23.81.27.206

如果您已连接,请停止查看 postgres 配置 - 检查网络(防火墙、PAT、NAT、路由、您的客户端连接((也许您未连接到 Internet?..)))

原来是 IPTables。我做了 "Service iptables stop" 我可以连接。我无法允许我的 ip/open 该端口。但我想这就是我必须要做的。我只是在完成时启用它。