这个问题是昨晚我使用 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
我尝试 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?
然后我检查了pg_hba.conf和postgresql.conf,它们是对的,如下:
host all all 192.168.1.0/24 md5
listen_addresses='*'
所以我认为我的配置是正确的,我之前连接成功,现在可能无法连接,谁能帮助我,谢谢?