[pgpool-general: 5311] Re: About failover execution and master node detection
lazaro3487 at gmail.com
Wed Feb 8 17:27:13 JST 2017
Thank you very much for the explanation, I think this question could be
added in the FAQs.
Is there any plan to implement some functionality for selecting the standby
with less delay in the replica?
De: Tatsuo Ishii [mailto:ishii at sraoss.co.jp]
Enviado el: miércoles, 8 de febrero de 2017 12:10 a. m.
Para: lazaro3487 at gmail.com
CC: pgpool-general at pgpool.net
Asunto: Re: [pgpool-general: 5302] About failover execution and master node
%m is the new master node chosen by Pgpool-II. It is the node being assigned
the youngest (smallest) node id which is alive.
For example if you have 3 nodes, namely node 0, 1, 2. Suppose node 1 the
primary and all of them are healthy (no down node). If node 1 fails,
failover_command is called with %m = 0.
If node 0 is down, %m would be 2.
SRA OSS, Inc. Japan
> 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
> 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
> # %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 detection
>> 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
> Best regards,
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
More information about the pgpool-general