Hot and PITR backups in same server

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Hot and PITR backups in same server
Date: 2020-05-17 14:41:00
Message-ID: 6D4B5482A2F645E6A7D4EF0BF098F3E0@dell2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

How to implement hot standby and PITR recovery possibility in same backup server.

Plan is:

1. Create base backup using

pg_basebackup --checkpoint=fast --verbose --progress --write-recovery-conf -D /var/lib/postgresql/12/standby

2. Create backup copy of /var/lib/postgresql/12/standby directory for PITR

3. set max_wal_size in postgresql.conf to 5 TB

4. Start backup server for hot standby backups.

If data from earlier point of time is required:

1. Stop backup server
2. Replace its data dirctory from of initial data directory contents created in previous p.2
4. Copy pg_wal contents from hot standby pg_wal directory to initial pg_wal directory in base backup
5. Specify recovery time in postgresql.conf and start backup server to recover to this point of time.

The most suspicius point is p.4 : copying manually pg_wal contents from hot data to base backup data.

It this OK ? Or is some better way to implement hot stadby and PITR possibility in same computer ?
Postgres 12 in Debian is used.

Andrus.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Weatherby,Gerard 2020-05-17 16:22:19 NFS version for replication
Previous Message Peter J. Holzer 2020-05-17 13:20:25 Re: Password reset