pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_basebackup recovery failure
4+ messages / 3 participants
[nested] [flat]
* pg_basebackup recovery failure
@ 2017-03-07 20:31 Ray Stell <stellr@vt.edu>
2017-03-07 20:36 ` Re: pg_basebackup recovery failure Magnus Hagander <magnus@hagander.net>
0 siblings, 1 reply; 4+ messages in thread
From: Ray Stell @ 2017-03-07 20:31 UTC (permalink / raw)
To: pgsql-admin
On this doc page are some command examples for pg_basebackup:
https://www.postgresql.org/docs/current/static/app-pgbasebackup.html
such as:
pg_basebackup -h mydbserver -D /usr/local/pgsql/data
I've never gotten this to work. When I bring up the copy on an intended
standby system I always get the classic:
PANIC: could not locate a valid checkpoint record
Failing that, I backed up with pg_start_backup/tar/pg_stop_backup as an alternative, but I was always curious what I was doing wrong.
The wiki page on setting up replication:
https://wiki.postgresql.org/wiki/Streaming_Replication
says use the command with this options:
pg_basebackup -h 192.168.0.10 -D /srv/pgsql/standby -P -U replication --xlog-method=stream
and I stumbled into option:
--checkpoint=fast
The standby was able to recover when I used one of these, I don't remember which, maybe both.
Should the doc be updated or am I missing something?
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_basebackup recovery failure
2017-03-07 20:31 pg_basebackup recovery failure Ray Stell <stellr@vt.edu>
@ 2017-03-07 20:36 ` Magnus Hagander <magnus@hagander.net>
2017-03-07 22:11 ` Re: pg_basebackup recovery failure Jorge Torralba <jorge.torralba@gmail.com>
2017-03-08 17:43 ` Re: pg_basebackup recovery failure Ray Stell <stellr@vt.edu>
0 siblings, 2 replies; 4+ messages in thread
From: Magnus Hagander @ 2017-03-07 20:36 UTC (permalink / raw)
To: Ray Stell <stellr@vt.edu>; +Cc: pgsql-admin
On Tue, Mar 7, 2017 at 12:31 PM, Ray Stell <stellr@vt.edu> wrote:
> On this doc page are some command examples for pg_basebackup:
>
> https://www.postgresql.org/docs/current/static/app-
> pgbasebackup.html
>
> such as:
>
> pg_basebackup -h mydbserver -D /usr/local/pgsql/data
>
> I've never gotten this to work. When I bring up the copy on an intended standby system I always get the classic:
> PANIC: could not locate a valid checkpoint record
>
> Failing that, I backed up with pg_start_backup/tar/pg_stop_backup as an alternative, but I was always curious what I was doing wrong.
> The wiki page on setting up replication:
>
> https://wiki.postgresql.org/wiki/Streaming_Replication
>
> says use the command with this options:
>
> pg_basebackup -h 192.168.0.10 -D /srv/pgsql/standby -P -U replication --xlog-method=stream
>
> and I stumbled into option:
>
> --checkpoint=fast
>
> The standby was able to recover when I used one of these, I don't remember which, maybe both.
>
> Should the doc be updated or am I missing something?
>
>
>
If you are using pg_basebackup without a log archive, then yes, you need
--xlog-method=stream (or fetch). The checkpoint method only affects how
quickly the checkpoint runs, it will always run.
If you do have a log archive, it should work fine without --xlog=stream,
but you need to put your restore_command into recovery.conf manually.
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_basebackup recovery failure
2017-03-07 20:31 pg_basebackup recovery failure Ray Stell <stellr@vt.edu>
2017-03-07 20:36 ` Re: pg_basebackup recovery failure Magnus Hagander <magnus@hagander.net>
@ 2017-03-07 22:11 ` Jorge Torralba <jorge.torralba@gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: Jorge Torralba @ 2017-03-07 22:11 UTC (permalink / raw)
To: Magnus Hagander <magnus@hagander.net>; +Cc: Ray Stell <stellr@vt.edu>; pgsql-admin
For example
standby_mode = 'on'
primary_conninfo = 'host=primaryserver port=5432 user=replication
password=******* '
restore_command = 'rsync -a -e "ssh -o strictHostKeyChecking=no"
server_with_archive_wal_files:/path/to/wal/files/%f %p'
On Tue, Mar 7, 2017 at 12:36 PM, Magnus Hagander <magnus@hagander.net>
wrote:
> On Tue, Mar 7, 2017 at 12:31 PM, Ray Stell <stellr@vt.edu> wrote:
>
>> On this doc page are some command examples for pg_basebackup:
>>
>> https://www.postgresql.org/docs/current/static/app-pgbasebac
>> kup.html
>>
>> such as:
>>
>> pg_basebackup -h mydbserver -D /usr/local/pgsql/data
>>
>> I've never gotten this to work. When I bring up the copy on an intended standby system I always get the classic:
>> PANIC: could not locate a valid checkpoint record
>>
>> Failing that, I backed up with pg_start_backup/tar/pg_stop_backup as an alternative, but I was always curious what I was doing wrong.
>> The wiki page on setting up replication:
>>
>> https://wiki.postgresql.org/wiki/Streaming_Replication
>>
>> says use the command with this options:
>>
>> pg_basebackup -h 192.168.0.10 -D /srv/pgsql/standby -P -U replication --xlog-method=stream
>>
>> and I stumbled into option:
>>
>> --checkpoint=fast
>>
>> The standby was able to recover when I used one of these, I don't remember which, maybe both.
>>
>> Should the doc be updated or am I missing something?
>>
>>
>>
> If you are using pg_basebackup without a log archive, then yes, you need
> --xlog-method=stream (or fetch). The checkpoint method only affects how
> quickly the checkpoint runs, it will always run.
>
> If you do have a log archive, it should work fine without --xlog=stream,
> but you need to put your restore_command into recovery.conf manually.
>
> --
> Magnus Hagander
> Me: http://www.hagander.net/
> Work: http://www.redpill-linpro.com/
>
--
Thanks,
Jorge Torralba
----------------------------
Note: This communication may contain privileged or other confidential
information. If you are not the intended recipient, please do not print,
copy, retransmit, disseminate or otherwise use the information. Please
indicate to the sender that you have received this email in error and
delete the copy you received. Thank You.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_basebackup recovery failure
2017-03-07 20:31 pg_basebackup recovery failure Ray Stell <stellr@vt.edu>
2017-03-07 20:36 ` Re: pg_basebackup recovery failure Magnus Hagander <magnus@hagander.net>
@ 2017-03-08 17:43 ` Ray Stell <stellr@vt.edu>
1 sibling, 0 replies; 4+ messages in thread
From: Ray Stell @ 2017-03-08 17:43 UTC (permalink / raw)
To: Magnus Hagander <magnus@hagander.net>; +Cc: pgsql-admin
On 3/7/17 3:36 PM, Magnus Hagander wrote:
> On Tue, Mar 7, 2017 at 12:31 PM, Ray Stell <stellr@vt.edu
> <mailto:stellr@vt.edu>> wrote:
>
> On this doc page are some command examples for pg_basebackup:
>
> https://www.postgresql.org/docs/current/static/app-pgbasebackup.html
> <https://www.postgresql.org/docs/current/static/app-pgbasebackup.html;
>
> such as:
>
> pg_basebackup -h mydbserver -D /usr/local/pgsql/data
>
> I've never gotten this to work. When I bring up the copy on an
> intended standby system I always get the classic:
> PANIC: could not locate a valid checkpoint record
>
> Failing that, I backed up with pg_start_backup/tar/pg_stop_backup as an alternative, but I was always curious what I was doing wrong.
> The wiki page on setting up replication:
>
> https://wiki.postgresql.org/wiki/Streaming_Replication
> <https://wiki.postgresql.org/wiki/Streaming_Replication;
>
> says use the command with this options:
>
> pg_basebackup -h 192.168.0.10 -D /srv/pgsql/standby -P -U replication --xlog-method=stream
>
> and I stumbled into option:
>
> --checkpoint=fast
>
> The standby was able to recover when I used one of these, I don't remember which, maybe both.
>
> Should the doc be updated or am I missing something?
>
>
> If you are using pg_basebackup without a log archive, then yes, you
> need --xlog-method=stream (or fetch). The checkpoint method only
> affects how quickly the checkpoint runs, it will always run.
> If you do have a log archive, it should work fine without
> --xlog=stream, but you need to put your restore_command into
> recovery.conf manually.
Too funny not to post. Years ago, maybe version 7 or 8 something, I
remember needing to rm the backup_label from the restored/standby dir.
I did that without thinking and it seems that was the source of the
problem. I just repeated the process with a mv of the backup_label and
I get a: PANIC: XX000: could not locate a valid checkpoint record I
restored the backup_label file and we're happy: LOG: 00000: started
streaming WAL from primary at 0/15000000 on timeline 1 Lesson: I need to
get out more often, but I must say, the error msg gave me a pretty good
head fake.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2017-03-08 17:43 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 20:31 pg_basebackup recovery failure Ray Stell <stellr@vt.edu>
2017-03-07 20:36 ` Magnus Hagander <magnus@hagander.net>
2017-03-07 22:11 ` Jorge Torralba <jorge.torralba@gmail.com>
2017-03-08 17:43 ` Ray Stell <stellr@vt.edu>
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