You might want to try to set up max_wal_senders
on your replica, and use --xlog-method=stream
instead of --xlog-method=fetch
, which would let the basebackup grab the individual WAL records as they are shipped, rather than trying to grab the WAL segments at the end of the basebackup. If you have to use --xlog-method=fetch
, then you should set wal_keep_segments
high enough to let you take a reasonable basebackup. checkpoint_segments
x2 should be reasonable as a starting point.
As a reference, the documentation for the 9.3 version of pg_basebackup is here.
I highly recommend that you test out the backup by restoring it on another server, and running a few tests against it to make sure it comes up in a consistent state, and has a reasonable snapshot of the data that you wanted backed up.
One additional note, if you set up an archive_command
under 9.3, and a restore_command
in your recovery.conf
, your streaming replica will be able to recover itself and continue if network conditions cause streaming replication to lag. An example and discussion of this problem and a solution is talked about here: http://evol-monkey.blogspot.com/2014/09/offsite-replication-problems-and-how-to.html
I hope this helps. =)
This seems to be fundamentally a question about Commvault Simpana, not PostgreSQL. As Commvault seems to be commercial software, you might have the best luck contacting their support desk.
Expected Behaviour Because Simpana is performing the backup with
PostgreSQL native commands, I expect that when Simpana has completed a
full backup or a WAL backup, that the files in the
/pgsql-backup/archive/postgres1/ directory are deleted.
I don't know what "a WAL backup" means here. Is that a terminology specific to Simpana? Does it just mean that the WAL files in your original archive directory have been copied to some off-site storage?
Questions If I weren't using Simpana for the backup, who would (have
to) delete the *.mmmmmmmm.backup files in the WAL Archive directory?
The pg_archivecleanup command?
If you weren't using Simpana, then you would be using something else. We can't tell you what that something else would be--there are lots of choices. While pg_archivecleanup
is one such method, it is starting to look pretty obsolete these days. If you only want to keep your WAL files long enough for them to be safely stored (or replayed) on a stand-by, you would now use "streaming replication", and thereby do away with log shipping altogether.
Or you could have a policy to permanently keep the first base backup ever taken (immediately after you initialized your empty database), and every WAL file archived since then, so that you can do point-in-time-recovery to anytime in the history of your database.
Why is there still a full WAL file in the Archive Log directory, when
it should have been deleted like all the other WAL files in the
Archive Log directory?
It looks to me like when Simpana decides to clean up the archive, instead of removing all WAL files older than the oldest one currently needed, it instead deletes the range of files starting with the one still needed last time it did a clean up, ending at the one just before the one currently needed.
If this is the case, then if a WAL file was archived by PostgreSQL right after you turned on archiving, but before Simpana had been activated (or before it had gotten its bearings) then that file will never be removed.
Why isn't there a 00000003000000370000007A.mmmmmmmm.backup file for
the still existing 00000003000000370000007A WAL file in the archive
log directory?
If no backup was initiated during the period that 00000003000000370000007A was the active WAL file, then there never would have been a 00000003000000370000007A.mmmmmmmm.backup file in the first place.
Best Answer
The slot to use for
-X stream
is specified with the--slot
option. Its documentation says: