6

我正在使用 pgAdmin III 从客户端管理我的数据库。我有一个以流复制模式运行的主从 postgreSQL。他们前面还有另一个 pgpool 服务器来进行连接池和负载平衡。

当我将 pgAdmin 连接到 pgpool 时,我得到了:

Error connecting to the server: ERROR: unable to read message kind
DETAIL: kind does not match between master(52) slot[1] (45)

我之前连接它没有问题,但不知何故 pgpool 死了,我重新启动它,然后这个错误突然出现。

pgpool 和 postgreSQL 服务器运行良好。我可以使用psql -h hostname database user. 应用程序服务器也可以连接到它,并且 Web 应用程序正常运行。我只是无法从 pgAdmin 访问它。

4

1 回答 1

2

http://www.sraoss.jp/pipermail/pgpool-general/2012-March/000297.html

简而言之:max_connections在 postgres 集群上超出。

我假设已经发生了 - 你重新启动了 pgpool 并打开了到 postgres 的新连接,而旧的连接留在了idleor中idle in transaction(取决于超时)。因此,在重新启动 pgpool 后,它消耗了两倍的量 num_init_children达到了实际允许的最大值

杀死旧的(重新启动之前)pgpool 连接应该修复它。尝试pg_terminate_backend(pid)在 postgres 上运行以执行此操作。还要小心杀死正确的连接。至少检查一下

select pid,query, client_address 
from pg_stat_activity where now()-query_start > '1 day'::interval

或类似只抓僵尸

于 2018-05-08T07:50:58.013 回答