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