【发布时间】:2018-01-27 19:03:51
【问题描述】:
我有一套 4 个流浪系统。
- web1(主数据库)
- web2(从 web1 复制的数据库)
- mgmt(我连接的节点)
- web3(pgpool 正在运行)
我的pgpool 设置为在 web1 和 web2 上的数据库之间进行负载平衡。它运行良好,即使其中一个通过pgpool 关闭,我也可以连接到数据库。但是当我关闭两个数据库(web1 和 web2)时,我失去了通过pgpool 存在的连接。
现在,当我再次启动主数据库时,我假设pgpool 应该重新获得该连接,但事实并非如此。即使我的假设是错误的,我如何让pgpool 再次获得与我在 web1 和 web2 上的数据库的连接?
目前在两个数据库都关闭后,我收到了消息 -
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
当我再次恢复数据库时,我仍然收到此消息 -
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
只有重新启动系统才能恢复连接。有什么我遗漏的或者我误解了pgpool 的工作方式吗?
我没有在此处添加 pgpool 和 postgresql conf 文件,因为我认为它们与此无关,但如果需要我会添加它们。
【问题讨论】:
标签: database postgresql load-balancing pgpool