Re: Question about wal files / pg_xlogs - Mailing list pgsql-general

From John R Pierce
Subject Re: Question about wal files / pg_xlogs
Date
Msg-id dc811774-d566-f016-8664-f1b63c8058a9@hogranch.com
Whole thread Raw
In response to Re: Question about wal files / pg_xlogs  (Patrick B <patrickbakerbr@gmail.com>)
List pgsql-general
On 8/3/2016 7:59 PM, Patrick B wrote:
postgresql.conf:
archive_command = 'exec nice -n 19 ionice -c 2 -n 7 archive_command.bash "%p" slave01 slave02'

archive_command.bash:

Basically we use TAR to ship through ssh:

# we use tar over SSH as I don't fully trust scp's exit status. The added benefit is that tar preserves all attributes
# the downside is that it's a little tricky to make the remote path relative
tar -c -O --no-same-owner -C "${WAL_SEGMENT%/*}" "${WAL_SEGMENT##*/}" | ssh -p ${NEXT_PORT} -C -o 'BatchMode=yes' -o 'CompressionLevel=3' "${USER}@${NEXT_HOST}" "exec tar -x --no-same-owner --overwrite -C '${WAL_ARCHIVE_PATH}'";
PS_CONCAT="${PIPESTATUS[*]}";

normally, you would ship the archived wal files to a file server via cp-over-nfs or scp, and have the slaves access them as needed via the recovery.conf



-- 
john r pierce, recycling bits in santa cruz

pgsql-general by date:

Previous
From: Periko Support
Date:
Subject: Tunning Server 9.1.
Next
From: John R Pierce
Date:
Subject: Re: Tunning Server 9.1.