pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pb_basebackup process not working
3+ messages / 3 participants
[nested] [flat]

* pb_basebackup process not working
@ 2016-10-19 14:03 Campbell, Lance <lance@illinois.edu>
  2016-10-19 14:28 ` Re: pb_basebackup process not working Albe Laurenz <laurenz.albe@wien.gv.at>
  2016-10-20 12:11 ` Re: pb_basebackup process not working Glyn Astill <glynastill@yahoo.co.uk>
  0 siblings, 2 replies; 3+ messages in thread

From: Campbell, Lance @ 2016-10-19 14:03 UTC (permalink / raw)
  To: pgsql-admin

PostgreSQL - 9.5.4

I read the PostgreSQL directions on how to do a point in time base back.  When I execute this command I get an error:


pg_basebackup --host=localhost --xlog --gzip --write-recovery-conf --format=t --pgdata=${BACKUPS_HOME}/${BACKUP_DATE_TIME}



Error message:



pg_basebackup: could not get transaction log end position from server:

ERROR:  requested WAL segment 00000001000001CD00000055 has already been removed



The PostgreSQL listserv recommend using the -xlog-method=stream.



So I tried this:



pg_basebackup --host=localhost --xlog-method=stream --gzip --write-recovery-conf --format=t --pgdata=${BACKUPS_HOME}/${BACKUP_DATE_TIME}



Error message:



pg_basebackup: WAL streaming can only be used in plain mode



So I changed it to use the plain format.  I now found that I cannot tar or gzip the output.  So my next try was to pipe it through gzip.



pg_basebackup --host=localhost --xlog-method=stream --write-recovery-conf | gzip ${BACKUPS_HOME}/${BACKUP_DATE_TIME}.gz



Now I get the error:



pg_basebackup: no target directory specified



What do I do next?

1)      Now what should I try?    I don't want to have to write out the entire backup of my database files in an uncompressed format.  That is just crazy and silly.

2)      Why offer tar and gzip as an option in my first attempt if it won't work?  Is there something I am missing?



Any help would be appreciated.



Lance Campbell

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pb_basebackup process not working
  2016-10-19 14:03 pb_basebackup process not working Campbell, Lance <lance@illinois.edu>
@ 2016-10-19 14:28 ` Albe Laurenz <laurenz.albe@wien.gv.at>
  1 sibling, 0 replies; 3+ messages in thread

From: Albe Laurenz @ 2016-10-19 14:28 UTC (permalink / raw)
  To: 'Campbell, Lance *EXTERN*' <lance@illinois.edu>; pgsql-admin

Lance Campbell wrote:
[realizes that pg_basebackup options -X s and -z are incompatible]

> 1)      Now what should I try?    I don’t want to have to write out the entire backup of my database
> files in an uncompressed format.  That is just crazy and silly.

You have basically two options:

a) Don't include the WAL files with the base backup.

   If you are planning to use PITR, you'll have to archive those separately anyway.
   So why include them in the base backup?

b) Use -X f and "set wal_keep_segments" high enough that the WAL files are not deleted.

> 2)      Why offer tar and gzip as an option in my first attempt if it won’t work?  Is there something
> I am missing?

Yes, namely that WAL files get deleted/recycled from pg_xlog when they are no longer needed.
If your backup takes too long, the earliest WAL files that are needed for recovery to a
consistent state will be gone when the backup is done.

Yours,
Laurenz Albe

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pb_basebackup process not working
  2016-10-19 14:03 pb_basebackup process not working Campbell, Lance <lance@illinois.edu>
@ 2016-10-20 12:11 ` Glyn Astill <glynastill@yahoo.co.uk>
  1 sibling, 0 replies; 3+ messages in thread

From: Glyn Astill @ 2016-10-20 12:11 UTC (permalink / raw)
  To: Campbell, Lance <lance@illinois.edu>; pgsql-admin

> From: "Campbell, Lance" <lance@illinois.edu>
>To: "pgsql-admin@postgresql.org" <pgsql-admin@postgresql.org> 
>Sent: Wednesday, 19 October 2016, 15:03
>Subject: [ADMIN] pb_basebackup process not working
> 
>So I changed it to use the plain format.  I now found that I cannot tar or gzip the output.  So my next try was to pipe it through gzip.
> 
>pg_basebackup --host=localhost --xlog-method=stream --write-recovery-conf | gzip ${BACKUPS_HOME}/${BACKUP_DATE_TIME}.gz
> 
>Now I get the error:
> 
>pg_basebackup: no target directory specified
> 

>What do I do next?

You can specify output to stdout if you use the tar format. So something like:


pg_basebackup --host=localhost --xlog-method=stream --write-recovery-conf --format=tar --pgdata - | gzip ${BACKUPS_HOME}/${BACKUP_DATE_TIME}.gz


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2016-10-20 12:11 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-19 14:03 pb_basebackup process not working Campbell, Lance <lance@illinois.edu>
2016-10-19 14:28 ` Albe Laurenz <laurenz.albe@wien.gv.at>
2016-10-20 12:11 ` Glyn Astill <glynastill@yahoo.co.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox