Add pg_baseclone script
That's follow up on request for improvement in regards to tooling helping with database replication recovery process. Hoping you'll find it helpful/useful, enjoy!
New script pg_baseclone
offers similar functionality as the current script (clones database data from primary node to local node using pg_basebackup
), only runs in fail-early regime (-eu, pipefail)) and makes extra effort to verify prerequisites before proceeding:
- verifies status of the cluster and confirms status of the local node (inspects
crm status
output andiptables
rules) - confirms
psql
access to the primary node - (optional) goes extra mile to verify status of the primary node using
readiness
healthcheck
In a wee test environment new script worked fine, still in production caution is advised.