Thread: PITR based recovery in a primary/standby cluster setup

PITR based recovery in a primary/standby cluster setup

From
Abhijit Gharami
Date:
Hi,

We have primary and standby PostgreSQL cluster setup and also we have PITR enabled on it. To improve the recovery time we are thinking of recovering the database to both primary and standby at the same time.

These are the steps we are following:
  1. Restore the base backup to the both primary and standby server 
  2. Replay the WAL files on both primary and standby and once the recovery target is reached stop the servers 
  3. Start one of the server as Primary and other one as standby


We have followed the above steps but when we are trying to start the servers as primary and standby we are having replication issues.

Could you please suggest what should be done here so that we can recover the database in both primary as well as in  standby server?

We are using PostgrerSQL version: 9.6.12 and for PITR we are using WAL-E.

Regards,
Abhijit

Re: PITR based recovery in a primary/standby cluster setup

From
Frank Alberto Rodriguez
Date:
Hello.
I'm not sure which replications issues you have, and I never used Wall-E before, but I get some issues with PotgreSql 10 and Barman.

Try starting the primary server at first, when it finish to recovery this should start as primary, if not then go to the postgresql data directory and rename the recovery.conf to recovery.done and start the server as primary.

Then start the standby server and when  recovery target  is reached, the standby server should not leave the recovery status and this should weep receiving wal through the 
archive_command, and should not rename the recovery.conf file.

Regards

On Tue, 2019-05-21 at 14:27 +0530, Abhijit Gharami wrote:
Hi,

We have primary and standby PostgreSQL cluster setup and also we have PITR enabled on it. To improve the recovery time we are thinking of recovering the database to both primary and standby at the same time.

These are the steps we are following:
  1. Restore the base backup to the both primary and standby server 
  2. Replay the WAL files on both primary and standby and once the recovery target is reached stop the servers 
  3. Start one of the server as Primary and other one as standby


We have followed the above steps but when we are trying to start the servers as primary and standby we are having replication issues.

Could you please suggest what should be done here so that we can recover the database in both primary as well as in  standby server?

We are using PostgrerSQL version: 9.6.12 and for PITR we are using WAL-E.

Regards,
Abhijit