[pgpool-general: 5304] Re: About failover execution and master node detection

Lazaro Garcia lazaro3487 at gmail.com
Tue Feb 7 17:04:02 JST 2017

Thanks for your answer.

In the failover_command configuration parameter, %m is the new master
selected by pgpool. With 2 standby servers, what node is selected as master?

failover_command = ''
                                   # Executes this command at failover
                                   # Special values:
                                   #   %d = node id
                                   #   %h = host name
                                   #   %p = port number
                                   #   %D = database cluster path
                                   #   %m = new master node id
                                   #   %H = hostname of the new master node
                                   #   %M = old master node id
                                   #   %P = old primary node id
								   #   %r =
new master port number
								   #   %R =
new master database cluster path
                                   #   %% = '%' carácter


-----Mensaje original-----
De: Tatsuo Ishii [mailto:ishii at sraoss.co.jp] 
Enviado el: martes, 7 de febrero de 2017 04:51 a. m.
Para: lazaro3487 at gmail.com
CC: pgpool-general at pgpool.net
Asunto: Re: [pgpool-general: 5302] About failover execution and master node

> I am Reading the pgpool documentation and i have a doubt related to 
> failover and selecting a new master node.
> I want to create a cluster with more than 2 nodes for instance 3 
> nodes. The question is when the backend shuts down, the new primary 
> selected by pgpool and sended to the failover command is the closest 
> node to previous master, in terms of replication delay?

Probably you are misunderstanding. Pgpool-II does *not* automatically choose
new primary. It's totally up to you how to select the new primary node in
the failover command script. In other word, the logic to choose the new
primary node should be explicitly coded in the failover command script.

Best regards,
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php

More information about the pgpool-general mailing list