whb*_*zju 5 postgresql networking
这个问题是昨晚我在使用 Adempiere 时发生的。我的 adempiere 服务器崩溃,它提示没有数据库,这一切都是突然发生的,我不知道为什么。
所以我检查了netstat -nlp | grep 5432,它显示如下
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN -
tcp6 0 0 :::5432 :::* LISTEN -
unix 2 [ ACC ] STREAM LISTENING 150917 - /var/run/postgresql/.s.PGSQL.5432
Run Code Online (Sandbox Code Playgroud)
我尝试 psql -U postgres -h localhost,它连接成功,但是当我尝试时psql -U postgres -h 192.168.1.103,它连接失败,显示如下:
psql: could not connect to server: No route to host
Is the server running on host "192.168.1.103" and accepting
TCP/IP connections on port 5432?
Run Code Online (Sandbox Code Playgroud)
然后我查了pg_hba.conf和postgresql.conf,都是对的,如下:
host all all 192.168.1.0/24 md5
listen_addresses='*'
Run Code Online (Sandbox Code Playgroud)
所以我认为我的配置是正确的,我之前已经连接成功,现在很可能无法连接,有人可以帮助我吗,谢谢?
“无路由到主机”说明可能是网络问题,先ping 192.168.1.103;如果可以,再“telnet 192.168.1.103 5432”看看端口是否正常。
\n\n这不是 pg_hba 问题\xe3\x80\x82
\n| 归档时间: |
|
| 查看次数: |
15132 次 |
| 最近记录: |