<div dir="ltr"><div><div><div><div>Hi,<br><br></div>I'm using pgpool-II 3.2.3 in recovery mode with 2 backend node cause my aim is to have a real-time replication of the primary database (bldlam server in the example is the primary and devlam0 is the backup server).<br>
</div>I do not use the streaming replication mode cause I'm using the 8.3 postgresql version.<br><br></div>Pgpool is working fine and i tested many times the online recovery using a few WAL files (10-15) and all seems to be working fine but I have a doubt and I would like to avoid any trouble in future.<br>
<br></div><div>Anyone knows if there is a way to know how many WAL files are needed to complete an online recovery after a node failover?<br></div><div><br></div><div>I ask it cause the performances of the server I use are really limited and if it's possible I would prefer not to archive all the wall files.<br>
</div><div><br>I suppose that WAL files created after "select pg_start_backup('pgpool-recovery');" can be enough<br></div><div><br></div><div>this is what my 1st  and 2nd stage commands do:<br><br></div>
<div>1st stage<br><br>#! /bin/sh<br>##let's begin recovery mode<br>/usr/local/pgsql-test/bin/psql -p 5445 -c "select pg_start_backup('pgpool-recovery');" postgres<br>#let's set the restore command<br>
echo "restore_command = 'cp /home/postgres/exchange_bldlam/wal/%f %p'" > /usr/local/pgsql-test/data/recovery.conf<br>echo "compressing base folder"<br>#tar -C /usr/local/pgsql-test/data -zcf pgsql.tar.gz base global pg_clog pg_multixact pg_subtrans pg_tblspc pg_twophase pg_xlog recovery.conf<br>
tar -cvf pgsql.tar.gz -C /usr/local/pgsql-test/data base global pg_clog pg_multixact pg_subtrans pg_tblspc pg_twophase pg_xlog recovery.conf<br>echo "stopping backup mode"<br>/usr/local/pgsql-test/bin/psql -p 5445 -c "select pg_stop_backup();" postgres<br>
echo "sending base data to devlam0"<br>scp pgsql.tar.gz devlam0:/usr/local/bldlam/pgsql/data<br><br><br></div><div>2nd stage <br><br>echo "executing pg_switch_xlog"<br>/usr/local/pgsql-test/bin/psql -p 5445 -c "SELECT pg_switch_xlog();" postgres<br>
echo "compressing wal files to send"<br>cd  /usr/local/pgsql-test/archive_wal <br>tar -cvf wal.tar.gz -C /usr/local/pgsql-test/archive_wal *<br>#inviamoli all'atro server pnella cartella di exchange<br>echo "sending wal archive to devlam0"<br>
rsync /usr/local/pgsql-test/archive_wal/wal.tar.gz postgres@devlam0:/home/postgres/exchange_bldlam/wal/wal.tar.gz </dev/null<br></div><div><br><br></div><div><br></div><div>Thanks in advance<br><br>--<br></div><div>Daniele Di Vito<br>
</div></div>