On 2/6/2015 2:19 PM, Mathis, Jason wrote:
Why can't you stream?
Did you read " The
connection must be made with a superuser or a user having REPLICATION permissions
(see Section
20.2),
and pg_hba.conf must
explicitly permit the replication connection. The server
must also be configured with max_wal_senders set
high enough to leave at least one session available for the
backup."
Yes, the script runs as postgres and I placed an entry in the
pg_hba.conf file for postgres with replication. The problem I've hit
is that when you specify "-Ft" to pg_basebackup to make a tarball,
it will error if you also specify "-X s". I think that's because the
"-X s" specifies that it spawns another process to stream the
transaction log in parallel. You can't really write a single tar
file with multiple processes.
Also
why not do one basebackup and setup archiving through
the day? You can do a incremental in the middle of the
day (if you really wanted to), may make the recovery a
bit shorter. Or you can setup a streaming slave and stop
postgres and tar/compress the data dir there. Although
watch the wal_keep_segments there as well or set an
restore_command if you are archiving.
The reason is more political
than anything else, and the result of a contract obligation. You
know those that get negotiated without discussing the matter
with the DBA? I'm just thinking that so long as
the most recent couple wal segments are included in the tarball,
then the backup should restorable without issue. Just trying to
confirm that.
|