diff options
Diffstat (limited to 'sca-cpp/trunk/components/sqldb/pgsql-standby-conf')
-rwxr-xr-x | sca-cpp/trunk/components/sqldb/pgsql-standby-conf | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-standby-conf b/sca-cpp/trunk/components/sqldb/pgsql-standby-conf index b5dd238282..bc0d4e9981 100755 --- a/sca-cpp/trunk/components/sqldb/pgsql-standby-conf +++ b/sca-cpp/trunk/components/sqldb/pgsql-standby-conf @@ -63,7 +63,7 @@ mkdir -p $root/sqldb/archive # Initialize from a backup of the master if [ ! -f $root/sqldb/data/postgresql.conf ]; then - (curl -L http://$mhost:$mhttpport/pgsql-backup | tar -C $root/sqldb -xz) 2>&1 | sh $root/sqldb/logger + (curl -L -# http://$mhost:$mhttpport/pgsql-backup | tar -C $root/sqldb -xz) 2>&1 | grep -v "100.0%" | sh $root/sqldb/logger rm -rf $root/sqldb/data/postmaster.pid $root/sqldb/data/pg_xlog mkdir -p $root/sqldb/data/pg_xlog/archive_status chmod 700 $root/sqldb/data/pg_xlog/archive_status @@ -73,7 +73,18 @@ fi cp $root/sqldb/data/postgresql-init.conf $root/sqldb/data/postgresql.conf cat >>$root/sqldb/data/postgresql.conf <<EOF -# Generated by: standby-conf $* +# Generated by: pgsql-standby-conf $* + +# Setup logging +log_min_messages = NOTICE +log_min_error_statement = NOTICE +log_min_duration_statement = -1 +log_checkpoints = on +log_connections = off +log_disconnections = off +log_duration = off +log_lock_waits = on +log_statement = none # Listen listen_addresses = '$ip' @@ -95,7 +106,7 @@ EOF # Generate recovery configuration cat >$root/sqldb/data/recovery.conf << EOF -# Generated by: pgsql-slave-conf $* +# Generated by: pgsql-standby-conf $* # Start in standby mode standby_mode = 'on' @@ -104,7 +115,7 @@ primary_conninfo = 'host=$mhost port=$mport' # Failover trigger_file = '$root/sqldb/failover' -restore_command = 'curl http://$mhost:$mhttpport/pgsql-archive/%f -o "%p"' +restore_command = 'curl -L -# http://$mhost:$mhttpport/pgsql-archive/%f -o "%p" 2>&1 | grep -v "100.0%"' EOF @@ -119,7 +130,7 @@ chmod 700 $root/sqldb/scripts/backup # Configure HTTPD to serve backup and archive files if [ -f "$root/conf/httpd.conf" ]; then cat >>$root/conf/httpd.conf <<EOF -# Generated by: pgsql-conf $* +# Generated by: pgsql-standby-conf $* # Serve PostgreSQL backup and WAL archive files ScriptAlias /pgsql-backup "$root/sqldb/scripts/backup" |