Re: pg_backrest restore & streaming replication - Mailing list pgsql-admin

From Stephen Frost
Subject Re: pg_backrest restore & streaming replication
Date
Msg-id 20160319170110.GC3127@tamriel.snowman.net
Whole thread Raw
In response to pg_backrest restore & streaming replication  (Aldo Sarmiento <aldo@bigpurpledot.com>)
List pgsql-admin
Aldo,

* Aldo Sarmiento (aldo@bigpurpledot.com) wrote:
> This is the command I used: /usr/lib/backrest/bin/pg_backrest.pl
> --stanza=prod-9.4 restore --log-level-console=info
> --db-path=/var/lib/postgresql/9.4/replica --thread-max=4 --delta

> After starting the replica back up, I noticed that it was no longer doing
> streaming replication. Also I noticed the logs said something about not
> finding WAL logs that it expected to find (not sure if these two things are
> related).

The pgbackrest restore command which you used doesn't appear to have
included any of the settings necessary to set up a streaming replica.
I'm guessing they also weren't included in the pg_backrest.conf file.

The only parameters that pgbackrest sets in the recovery.conf by default
are those necessary to acquire the necessary XLOGs during restore (the
recovery_command option).

To add other options to the recovery.conf file (such as those required
to start the system as a replica), you can use the --recovery-option to
pgbackrest, or add a '[stanza:restore:recovery-option]' section to the
pg_backrest.conf file being used.

The pgbackrest user guide includes an example of setting up the
pg_backrest.conf file with the necessary options:

http://www.pgbackrest.org/user-guide.html

The "not found" messages are completely normal and expected, PG will ask
for XLOGs which don't exist and pgbackrest is just logging that it was
asked for an XLOG which didn't exist.

Thanks!

Stephen

Attachment

pgsql-admin by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: Migration from OracleDB to Postgres
Next
From: Nicolas Aubert
Date:
Subject: vacuum analyse waiting