Re: pg_basebackup recovery failure

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Ray Stell <stellr(at)vt(dot)edu>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_basebackup recovery failure
Date: 2017-03-07 20:36:21
Message-ID: CABUevEy+mMPKS-6VjbwcuzFisYBhCcJwgR_Amr+04w1JotoqQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Mar 7, 2017 at 12:31 PM, Ray Stell <stellr(at)vt(dot)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/

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jorge Torralba 2017-03-07 22:11:33 Re: pg_basebackup recovery failure
Previous Message Ray Stell 2017-03-07 20:31:16 pg_basebackup recovery failure