pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Andrus <kobruleht2@hot.ee>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Hot and PITR backups in same server
Date: Mon, 18 May 2020 08:32:39 +0200
Message-ID: <aebcc9a67954ea23ce43a01d4326e2a18da9d11b.camel@cybertec.at> (raw)
In-Reply-To: <6D4B5482A2F645E6A7D4EF0BF098F3E0@dell2>
References: <6D4B5482A2F645E6A7D4EF0BF098F3E0@dell2>

On Sun, 2020-05-17 at 17:41 +0300, Andrus wrote:
> 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.

This is confused or at least confusing.

- "max_wal_size" of 5TB is clearly insane.

- I don't understand what you mean by "Start backup server for hot standby backups".

Do I get it right that you want to copy a streaming replication standby server's data
directory to perform PITR?  That doesn't see like a good plan, because the standby
usually won't be much behind the primary server, and you can only recover to a later
point in time.

If you care to elaborate, perhaps the question can be answered.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (5+ messages)  latest in thread

Message-ID: <aebcc9a67954ea23ce43a01d4326e2a18da9d11b.camel@cybertec.at>
Permalink:  ../aebcc9a67954ea23ce43a01d4326e2a18da9d11b.camel@cybertec.at/
Also on:    postgresql.org/message-id/aebcc9a67954ea23ce43a01d4326e2a18da9d11b.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, kobruleht2@hot.ee
  Subject: Re: Hot and PITR backups in same server
  In-Reply-To: <aebcc9a67954ea23ce43a01d4326e2a18da9d11b.camel@cybertec.at>
  References: <6D4B5482A2F645E6A7D4EF0BF098F3E0@dell2> <aebcc9a67954ea23ce43a01d4326e2a18da9d11b.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox