Pgpool 没有重新获得连接
Pgpool not regaining connection
我有一套 4 个 vagrant 系统。
- web1(主数据库)
- web2(从 web1 复制的数据库)
- mgmt(我从中连接的节点)
- web3(pgpool 是 运行)
我的pgpool is setup to load balance between the databases on web1 and web2. It works well and I can connect to the db even when one of them is down through pgpool. But when I brought both databases down (web1 and web2), I lose the connection which was existing through pgpool。
现在,当我再次启动主数据库时,我假设 pgpool should regain that connection, but it does not. Even if my assumption is wrong, how do I get 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 文件,因为我认为它们与此无关,但如果需要我会添加它们。
如果后端节点设置为在节点故障时进行故障转移,Pgpool-II 会在故障节点执行故障转移后将其分离。这就是你的情况。但是一旦分离,失败的节点就永远不会自动附加回 Pgpool-II,即使它们再次变为 available/reachable。原因是 Pgpool-II 无法自行确保节点故障是否已导致某些数据损坏 and/or 如果它仍按用户预期正确复制。
所以失败的节点需要手动附加到 Pgpool-II,为此你可以使用 pcp_attach_node 命令。
我有一套 4 个 vagrant 系统。
- web1(主数据库)
- web2(从 web1 复制的数据库)
- mgmt(我从中连接的节点)
- web3(pgpool 是 运行)
我的pgpool is setup to load balance between the databases on web1 and web2. It works well and I can connect to the db even when one of them is down through pgpool. But when I brought both databases down (web1 and web2), I lose the connection which was existing through pgpool。
现在,当我再次启动主数据库时,我假设 pgpool should regain that connection, but it does not. Even if my assumption is wrong, how do I get 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 文件,因为我认为它们与此无关,但如果需要我会添加它们。
如果后端节点设置为在节点故障时进行故障转移,Pgpool-II 会在故障节点执行故障转移后将其分离。这就是你的情况。但是一旦分离,失败的节点就永远不会自动附加回 Pgpool-II,即使它们再次变为 available/reachable。原因是 Pgpool-II 无法自行确保节点故障是否已导致某些数据损坏 and/or 如果它仍按用户预期正确复制。 所以失败的节点需要手动附加到 Pgpool-II,为此你可以使用 pcp_attach_node 命令。