我以前的办公室一切正常。现在我搬到了新办公室,无法远程连接到 postgres。不过 SSH 可以工作。我的 IP 目前是 70.90.155.138。
无法连接到服务器:连接超时
IP 表配置:
# Allpw postgres connections
-A INPUT -p tcp --dport 5432 -s 70.90.155.138/16 -j ACCEPT
iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere loopback/8 reject-with icmp-port-unreachable
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpts:http-alt:8090
ACCEPT udp -- anywhere anywhere udp dpts:60000:61000
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- 70.90.0.0/16 anywhere tcp dpt:postgresql
pg_hba.conf:
local all postgres md5
host all all 0.0.0.0/0 md5
Listen_addresses 设置正确且未注释:
listen_addresses = '*'
Postgres 正在运行:
/etc/init.d/postgresql status
Running clusters: 9.1/main
并聆听:
sudo /etc/init.d/postgresql status
Running clusters: 9.1/main
user1@finance1:/var/log$ sudo netstat -nlp | grep 5432
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 17772/postgres
tcp6 0 0 :::5432 :::* LISTEN 17772/postgres
unix 2 [ ACC ] STREAM LISTENING 5667832 17772/postgres /var/run/postgresql/.s.PGSQL.5432
而且我没有在 IPtables 日志中看到任何失败的连接:
tail -5000 /var/log/kern.log | grep DPT=5432
我在这里没有检查什么?当唯一改变的是我的笔记本电脑的位置时,什么可能导致它停止工作?