<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Thank you very much, after specifying the values like <br><div dir="ltr">sr_check_* and health_check_* and (OF COURSE!) master_slave_mode = on<br></div><div>everything seems to be OK and pgpool works as expected.</div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">чт, 28 мар. 2019 г. в 02:12, Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Question #1: failover script when stand-by fail.<br>
> <br>
> In pgpool.conf there is parameter<br>
> failover_command = '' # Executes this command at failover<br>
> But there is no indication what exactly fail means - fail of master-server<br>
> or fail of stand-by server?<br>
<br>
Both.<br>
<br>
> You wrote "When the standby is stopped, pgpool tries to reconnect x times<br>
> ... then it does the failover script..." Where in pgpool.conf you defined<br>
> this script?<br>
<br>
The health check parameters.<br>
<br>
> Question #2: you wrote "... it detaches the standby".<br>
> I did exactly the same setting as you wrote, but pgpool stil showing<br>
> stand-by as "up" meanwhile it is "down".<br>
> Mayby there is some parameter which exactly tells that stand-by MUST be<br>
> detached when it fails?<br>
<br>
That's not an expected behavior.<br>
You should share the pgpool log (with log_min_messages = debug5).<br>
<br>
> Question #3: you wrote "I  also put the parameter failover_on_backend_error<br>
> = 'off' "<br>
> Why? If "off" than when master fail occurs - no stand-by promotes. Or I<br>
> wrong?<br>
<br>
Wrong. Setting this parameter to off does not affect the failover<br>
triggered by health checking.<br>
<br>
> вт, 26 мар. 2019 г. в 23:16, Pierre Timmermans <<a href="mailto:ptim007@yahoo.com" target="_blank">ptim007@yahoo.com</a>>:<br>
> <br>
>> Hi Dimitri<br>
>><br>
>> Did you set-up the health checks ?<br>
>><br>
>> In my pgpool config I have the following parameters related to the health<br>
>> checks<br>
>><br>
>> health_check_period = 10<br>
>> health_check_timeout = 10<br>
>> health_check_user = 'hcuser'<br>
>> health_check_password = 'hcuser'<br>
>> health_check_database = 'postgres'<br>
>> health_check_max_retries = 5<br>
>> health_check_retry_delay = 1<br>
>><br>
>> I  also put the parameter<br>
>><br>
>> failover_on_backend_error = 'off'<br>
>><br>
>> And I created the user hcuser on the postgres database<br>
>><br>
>> When the standby is stopped, pgpool tries to reconnect x times (depending<br>
>> on health_check_max_retries parameter) then it does the failover script<br>
>> (the script does not have to do something because it is not the primary<br>
>> failing) and it detaches the standby. When the standby is started again,<br>
>> pgpool does a failback script (I do nothing in this script) and then it<br>
>> attaches the standby again<br>
>><br>
>> I believe that if you don't set-up the health-checks pgpool does not<br>
>> detach the standby when it fails (not sure if it is as-designed or not)<br>
>><br>
>> Pierre<br>
>><br>
>><br>
>> On Tuesday, March 26, 2019, 3:58:52 PM GMT+1, Dmitry Medvedev <<br>
>> <a href="mailto:dm.dm.medvedev@gmail.com" target="_blank">dm.dm.medvedev@gmail.com</a>> wrote:<br>
>><br>
>><br>
>> Hello to everyone.<br>
>><br>
>> A couple of days I've spent trying to understand how pgpool-II works.<br>
>> Tell me, please, principle of operation when slave node goes down.<br>
>> I've read tons of manuals and when master node in my test cluster goes<br>
>> down (or master's network interface goes down) - pgpool does failover<br>
>> actions. Everything is OK and works as expected.<br>
>> But when slave node goes down - pgpool does nothing at all and I receive<br>
>> such answer<br>
>><br>
>> test=# show pool_nodes;<br>
>>  node_id |  hostname   | port | status | lb_weight |  role  | select_cnt |<br>
>> load_balance_node | replication_delay | last_status_change<br>
>><br>
>> ---------+-------------+------+--------+-----------+--------+------------+-------------------+-------------------+---------------------<br>
>>  0       | 172.28.30.6 | 5434 | up     | 0.500000  | master | 3          |<br>
>> true              | 0                 | 2019-03-26 17:04:12<br>
>>  1       | 172.28.30.7 | 5434 | up     | 0.500000  | slave  | 0          |<br>
>> false             | 0                 | 2019-03-26 17:04:12<br>
>> (2 rows)<br>
>><br>
>><br>
>> At the same time slave node is completely down. Not "up"! select * from<br>
>> pg_stat_replication showing (0 rows)<br>
>><br>
>> Why does pgpool-II does nothing when slave node goes down and how I can<br>
>> change it?<br>
>> _______________________________________________<br>
>> pgpool-general mailing list<br>
>> <a href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
>> <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
>><br>
</blockquote></div>