【发布时间】:2018-04-19 02:31:02
【问题描述】:
目前我无法从客户端连接到 PostgreSQL。客户端IP为“10.0.0.121”,我的服务器IP为“10.0.0.104”。
当我尝试与psql -U postgres -h 10.0.0.121 连接时,我收到以下错误:
psql: could not connect to server: No route to host
Is the server running on host "10.0.0.104" and accepting
TCP/IP connections on port 5432?
我已经配置了我的服务器:
pg_hba.conf
host all all 10.0.0.121/32 md5
postgresql.conf
listen_addresses = '*' # what IP address(es) to listen on;
port = 5432
我还需要配置什么吗?
【问题讨论】:
-
还要确保你重新加载了 pg_hba:
select pg_reload_conf(); -
"No route to host" 表示 psql 甚至无法定位服务器。这可能是网络问题,而不是 Postgres 配置问题
标签: postgresql remote-access psql