<div dir="ltr">Yes, thank you!<div>I realised that there were an old status file with second and third nodes down.</div><div>I removed the status file, restarted all three Pgpool nodes and now everything is working fine.</div><div>Thank you!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 24 ott 2019 alle ore 10:06 Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; ha scritto:<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; Hi,<br>
&gt; I installed a new PgPool-II cluster with 3 dedicated nodes separated from<br>
&gt; the PostgreSQL nodes.<br>
&gt; PgPool-II version is 4.0.2-1 from Debian Buster, and PostgreSQL version is<br>
&gt; 11.5 from official PostgresSQL APT repository.<br>
&gt; <br>
&gt; I configured the failover script, but when I test the master node shutdown,<br>
&gt; automatic failover does not happens from PgPool-II because it does not find<br>
&gt; any valid backend node:<br>
<br>
At the time when you shutdown the primary PostgreSQL, other standby<br>
PostgreSQL were aleady in down status, right? If so, it&#39;s not possible<br>
to find any alternative to the previous primary PostgreSQL becuase<br>
other PostgreSQL are all down.<br>
<br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
&gt; ================================================================<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9764]: [53-1] 2019-10-21 18:22:26: pid 9764:<br>
&gt; LOG:  watchdog is informed of failover start by the main process<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9764]: [53-2] 2019-10-21 18:22:26: pid 9764:<br>
&gt; LOCATION:  watchdog.c:2784<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: [29-1] 2019-10-21 18:22:26: pid 9763:<br>
&gt; LOG:  starting degeneration. shutdown host postgres1(5432)<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: [29-2] 2019-10-21 18:22:26: pid 9763:<br>
&gt; LOCATION:  pgpool_main.c:1867<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: [30-1] 2019-10-21 18:22:26: pid 9763:<br>
&gt; WARNING:  All the DB nodes are in down status and skip writing status file.<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: [30-2] 2019-10-21 18:22:26: pid 9763:<br>
&gt; LOCATION:  pgpool_main.c:3847<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: [31-1] 2019-10-21 18:22:26: pid 9763:<br>
&gt; LOG:  failover: no valid backend node found<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: [31-2] 2019-10-21 18:22:26: pid 9763:<br>
&gt; LOCATION:  pgpool_main.c:1917<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: [32-1] 2019-10-21 18:22:26: pid 9763:<br>
&gt; LOG:  Restart all children<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: [32-2] 2019-10-21 18:22:26: pid 9763:<br>
&gt; LOCATION:  pgpool_main.c:2017<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: [33-1] 2019-10-21 18:22:26: pid 9763:<br>
&gt; LOG:  execute command: /usr/local/bin/pgpool-failover.sh 0 postgres1 0 -1<br>
&gt; &quot;&quot; &quot;&quot;<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: [33-2] 2019-10-21 18:22:26: pid 9763:<br>
&gt; LOCATION:  pgpool_main.c:3064<br>
&gt; Oct 21 18:22:26 proxy1 pgpool[9763]: quarantine done. shutdown host<br>
&gt; postgres1(5432)Mon 21 Oct 2019 06:22:26 PM CEST<br>
&gt; ================================================================<br>
&gt; <br>
&gt; failover_command is:<br>
&gt; failover_command = &#39;/usr/local/bin/pgpool-failover.sh %d %h %P %m %H %R&#39;<br>
&gt; <br>
&gt; So when PgPool executes the failover command, %H is empty (5th argument):<br>
&gt; /usr/local/bin/pgpool-failover.sh 0 postgres1 0 -1 &quot;&quot; &quot;&quot;<br>
&gt; <br>
&gt; For this reason the command is not executed on any PostgreSQL backend and<br>
&gt; the SSH command exits without doing anything, and the PgPool cluster<br>
&gt; becomes inconsistent (I have to restart everything to resume it).<br>
&gt; <br>
&gt; ================================================================<br>
&gt; This is the node status in PgPool:<br>
&gt; <br>
&gt; postgres=# SHOW POOL_NODES;<br>
&gt; DEBUG:  SimpleQuery<br>
&gt; DETAIL:  nodes reporting<br>
&gt;  node_id | hostname  | port | status | lb_weight |  role   | select_cnt |<br>
&gt; load_balance_node | replication_delay | last_status_change<br>
&gt; ---------+-----------+------+--------+-----------+---------+------------+-------------------+-------------------+---------------------<br>
&gt;  0       | postgres1 | 5432 | up     | 0.333333  | primary | 0          |<br>
&gt; true              | 0                 | 2019-10-21 18:29:33<br>
&gt;  1       | postgres2 | 5432 | down   | 0.333333  | standby | 0          |<br>
&gt; false             | 0                 | 2019-10-21 18:29:33<br>
&gt;  2       | postgres3 | 5432 | down   | 0.333333  | standby | 0          |<br>
&gt; false             | 0                 | 2019-10-21 18:29:33<br>
&gt; (3 rows)<br>
&gt; ================================================================<br>
&gt; <br>
&gt; Could you help me please?<br>
&gt; Thanks!<br>
</blockquote></div>