February 2020
Intermediate to advanced
734 pages
38h 13m
English
Of course, this process does not lend itself well to extremely large database installations. Beyond a few hundred gigabytes, erasing all of the data and resynchronizing is extremely time, network, and I/O intensive. For these scenarios, we recommend a different technique. Before starting Patroni, we can manually synchronize the data files with rsync.
These are the commands we might use when rebuilding pgha2 from the contents of pgha1 if we have Secure Shell (SSH) keys in place:
psql -U rep_user -h pgha1 \
-c "SELECT pg_start_backup('resync', TRUE);" postgres
rsync -av --delete-after postgres@pgha1:/db/pgdata /db
psql -U rep_user -h pgha1 -c "SELECT pg_stop_backup();" postgres
rm /db/pgdata/postmaster*
Some more experienced ...
Read now
Unlock full access