forked from ISTI-ansible-roles/ansible-roles
library/roles/postgresql: Some cleanup of the recovery scripts.
This commit is contained in:
parent
98689422b6
commit
e2a75c2e8e
|
@ -32,14 +32,6 @@ rm $archive_dir/*
|
||||||
# archive WAL files.
|
# archive WAL files.
|
||||||
touch $archive_dir/backup_in_progress
|
touch $archive_dir/backup_in_progress
|
||||||
|
|
||||||
# Perform a backup of the database.
|
|
||||||
# ssh -T $RECOVERY_TARGET \
|
|
||||||
# "pg_basebackup -h $MASTER_HOST -D $archive_dir --xlog"
|
|
||||||
|
|
||||||
# Configure the restore_command to use the archive_log WALs we’ll copy
|
|
||||||
# over in 2nd_stage.sh.
|
|
||||||
# echo "restore_command = 'cp $archive_dir/%f %p'" | ssh -T $RECOVERY_TARGET "cat > $RECOVERY_DATA/recovery.conf"
|
|
||||||
|
|
||||||
psql -c "select pg_start_backup('pgpool-recovery')" postgres
|
psql -c "select pg_start_backup('pgpool-recovery')" postgres
|
||||||
echo "restore_command = 'scp $MASTER_HOST:$archive_dir/%f %p'" > $RECOVERY_DATA/recovery.conf
|
echo "restore_command = 'scp $MASTER_HOST:$archive_dir/%f %p'" > $RECOVERY_DATA/recovery.conf
|
||||||
tar -C $MASTER_DATA_BASE_DIR -zcf pgsql.tar.gz main
|
tar -C $MASTER_DATA_BASE_DIR -zcf pgsql.tar.gz main
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Online recovery 2nd stage script
|
# Online recovery 2nd stage script
|
||||||
# Reference: http://michael.stapelberg.de/Artikel/replicated_postgresql_with_pgpool
|
|
||||||
#
|
#
|
||||||
MASTER_DATA_BASE_DIR={{ psql_data_dir }}
|
MASTER_DATA_BASE_DIR={{ psql_data_dir }}
|
||||||
MASTER_DATA=$1
|
MASTER_DATA=$1
|
||||||
|
|
Loading…
Reference in New Issue