<div dir="ltr"><div>Hi Bo Peng!<br><br></div>I found the variable PORT not defined in the 
recovery_2nd_stage.sample<br><br>#!/bin/bash<br># Online recovery 2nd stage script for snapshot mode<br><br>set -o xtrace<br><br>MAIN_NODE_PGDATA="$1"              # main dabatase cluster<br>DEST_NODE_HOST="$2"                 # hostname of the DB node to be recovered<br>DEST_NODE_PGDATA="$3"              # database cluster of the DB node to be recovered<br>MAIN_NODE_PORT="$4"                 # PostgreSQL port number<br><br>echo 'recovery_2nd_stage for standby @' $DEST_NODE_HOST<br><br>PGHOME=/usr/pgsql-15<br>ARCHIVEDIR=/var/lib/pgsql/archivedir  # archive log directory<br>POSTGRESQL_STARTUP_USER=postgres<br>SSH_KEY_FILE=id_rsa_pgpool<br>SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}"<br><br># Force to flush current value of sequences to xlog<br>${PGHOME}/bin/psql -p $PORT -t -c 'SELECT datname FROM pg_database WHERE NOT datistemplate AND datallowconn' template1|<br>while read i<br>do<br>  if [ "$i" != "" ]; then<br>    psql -p $PORT -c "SELECT setval(oid, nextval(oid)) FROM pg_class WHERE relkind = 'S'" $i<br>  fi<br>done<br><br>psql -p $PORT -c "SELECT pgpool_switch_xlog('$ARCHIVEDIR')" template1<br><br># start target server as a streaming replication standby server<br>ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@$DEST_NODE_HOST "<br>        $PGHOME/bin/pg_ctl -l /dev/null -w -D $DEST_NODE_PGDATA promote<br>"<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 19, 2023 at 8:03 AM Bo Peng <<a href="mailto:pengbo@sraoss.co.jp">pengbo@sraoss.co.jp</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
You can find all the scripts here:<br>
<a href="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=tree;f=src/sample/scripts;h=4cd73845f012972d73b24be77911288486bb6c08;hb=refs/heads/V4_4_STABLE" rel="noreferrer" target="_blank">https://git.postgresql.org/gitweb/?p=pgpool2.git;a=tree;f=src/sample/scripts;h=4cd73845f012972d73b24be77911288486bb6c08;hb=refs/heads/V4_4_STABLE</a><br>
<br>
The scripts:<br>
  replication_mode_recovery_1st_stage.sample<br>
  replication_mode_recovery_2nd_stage.sample<br>
are for isolation snapshot mode.<br>
<br>
The documetation is wrong and I will fix it.<br>
<br>
On Wed, 17 May 2023 16:31:24 +0800<br>
Zhaoxun Yan <<a href="mailto:yan.zhaoxun@gmail.com" target="_blank">yan.zhaoxun@gmail.com</a>> wrote:<br>
<br>
> Hi!<br>
> I cannot find the recovery_2nd_stage.sample from<br>
> <a href="https://www.pgpool.net/docs/44/en/html/runtime-online-recovery.html" rel="noreferrer" target="_blank">https://www.pgpool.net/docs/44/en/html/runtime-online-recovery.html</a>. Is<br>
> there such a file? What does it do when snap-shot mode?<br>
> <br>
> Thanks!<br>
> Zhaoxun<br>
<br>
<br>
-- <br>
Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>><br>
SRA OSS LLC<br>
<a href="https://www.sraoss.co.jp/" rel="noreferrer" target="_blank">https://www.sraoss.co.jp/</a><br>
</blockquote></div>