Re: pg_backrest restore & streaming replication

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Aldo Sarmiento <aldo(at)bigpurpledot(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_backrest restore & streaming replication
Date: 2016-03-19 17:01:10
Message-ID: 20160319170110.GC3127@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Aldo,

* Aldo Sarmiento (aldo(at)bigpurpledot(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Nicolas Aubert 2016-03-21 09:20:02 vacuum analyse waiting
Previous Message Albe Laurenz 2016-03-18 09:39:14 Re: Migration from OracleDB to Postgres