pgsql日志:无法建立连接,因为目标机器主动拒绝了它 [英] pgsql log: No connection could be made because the target machine actively refused it
问题描述
最近,我发现客户端在连接到db服务器时总是在等待超时。
这里有些登录。
Recently, I found that clients always are waiting until timeout,when they connect to db server. Some log in here.
我们在postgresql中有一个数据库服务器。并且在远程,与此同时,大约有二十个客户端连接到该数据库服务器,以添加,更新或删除数据。
We have a database server in postgresql. and in remote, meanwhile about twenty clients connect to this db server , adding, updating or deleting data.
2013-03-13 23:19:41 HKT日志:不完整的启动包
2013-03-13 23:31:11 HKT日志:无法从客户端获得数据:由于目标计算机主动拒绝,因此无法建立连接。
2013-03-13 23:19:41 HKT 日志: 不完整的启动包 2013-03-13 23:31:11 HKT 日志: 无法从客户端获得数据: No connection could be made because the target machine actively refused it.
2013-03-13 23:31:11 HKT日志:在客户端联接上的意外EOF
2013-03-13 23:37:05 HKT日志:无法从客户端获得数据:无法建立连接,因为目标计算机主动拒绝了它。
2013-03-13 23:31:11 HKT 日志: 在客户端联接上的意外 EOF 2013-03-13 23:37:05 HKT 日志: 无法从客户端获得数据: No connection could be made because the target machine actively refused it.
任何建议都会受到赞赏。
Any suggestion will be appreciated.
推荐答案
您需要在postgres sql安装目录中修改 pg_hba.conf 。不论使用哪种IPv4本地连接或IPv6本地连接。
You need to modify pg_hba.conf inside postgres sql installation directory. IPv4 local connections or IPv6 local connections whatever you use.
-
例如,IPv4连接的原始配置为
For example, original configuratio of IPv4 connection is
托管所有127.0.0.1/32 md5
,这意味着仅本地客户端。
host all all 127.0.0.1/32 md5
which means only local client.
将IPv4本地连接更改为
Change IPv4 local connections to
托管所有0.0.0.0/0 md5
表示允许所有客户端访问。
host all all 0.0.0.0/0 md5
means allow access from all clients.
这篇关于pgsql日志:无法建立连接,因为目标机器主动拒绝了它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!