pgpool pcp_recovery_node deletes postgresql db

75 views Asked by At

Setting up postgresql 14 HA with 3 nodes. All config done & the actual 'master' database is already running for a while. The VIP is currently on the primary. When i want to configure the standby server, i use pcp_recovery_node -h vip-p 9898 -U postgres -n 2 (the second standby node). Enter the pw & then the cmd seems to be hanging. After a few minutes, i notice that postgresql is not available anymore on the standby server ('deactivated'). All the files related ($PGDATA) to postgresql are gone.

Meanwhile i see on my primary server, continious entries with "Password:"

I try to figure out why this is happening, but in vain tcpdump shows continious trafic between both nodes, but not clear what

A pgsql HA cluster active. Understand that this could take some time (but in same network, 10Gb nw), but here i feel it just blocks

Note that the same happened on a previous try, just totally unclear

Thx for any assist in this Remco

1

There are 1 answers

0
Dmitry Demin On

The nodes are restored from a backup, from the primary server. Before restoring from a backup, the directories with the database are deleted. All commands can be viewed in the script at /etc/pgpool-II/recovery_1st_stage.sample pgpool-II 4.4.4 Documentation Online Recovery

## Execute pg_basebackup to recovery Standby node
ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@$DEST_NODE_HOST "

    set -o errexit

    [ -d \"${DEST_NODE_PGDATA}\" ] && rm -rf ${DEST_NODE_PGDATA}
    [ -d \"${ARCHIVEDIR}\" ] && rm -rf ${ARCHIVEDIR}/*

    ${PGHOME}/bin/pg_basebackup -h $PRIMARY_NODE_HOST -U $REPLUSER -p $PRIMARY_NODE_PORT -D $DEST_NODE_PGDATA -X stream

    cat > ${RECOVERYCONF} << EOT