[pgpool-general: 7403] Re: All nodes are the standby

Bo Peng pengbo at sraoss.co.jp
Thu Jan 21 09:41:54 JST 2021


Hi,

On Tue, 19 Jan 2021 15:02:05 +0000
Luís Alves <luisalves00 at gmail.com> wrote:

> Hi
> 
> Mu cluster have 2 nodes and currently I'm getting:
> 
> find_primary_node: standby node is 1
> find_primary_node: standby node is 0

It seems that Pgpool-II can't detect the primary node.
Pgpool executes "SELECT pg_is_in_recovery()" on each backend node to find the primary node.

> I'm trying to issue detach or promote commands but I get this:
> 
> -bash-4.2$ pcp_detach_node -w -h 10.230.4.148 -p 9898 -U pgpool -g  -n 1
> ERROR: connection to host "10.230.4.148" failed with error "Connection
> refused"
> -bash-4.2$  pcp_promote_node -w -h 10.230.4.148 -p 9898 -U pgpool -g  -n 0
> ERROR: connection to host "10.230.4.148" failed with error "Connection
> refused"

The pcp commands failed.
Please make sure the hostname "10.230.4.148" and port "9898" is specified correctly.
 
> Any idea how I can mark one as primary?
> 
> I'm running with the -D flag: /usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf
> -D -n

Please note that "pcp_promote_node" just changes the internal status of Pgpool-II 
and it does not actually promote PostgreSQL standby server. 

You need to connect to backend directly to promote the standby 
as primary in the following steps:

1. detach node0 using "pcp_detach_node"
2. promote node0 using "pg_ctl promote ..."
3. attach node0 using "pcp_attach_node"

-- 
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS, Inc. Japan


More information about the pgpool-general mailing list