From: Andrus <kobruleht2@hot.ee>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: laurenz.albe@cybertec.at
Cc: pgsql-general@postgresql.org
Subject: Re: Hot and PITR backups in same server
Date: Tue, 19 May 2020 11:26:51 +0300
Message-ID: <0B5B726FEF194328AAFABFC6AF66838D@dell2> (raw)
In-Reply-To: <20200519.161443.2239326109074731181.horikyota.ntt@gmail.com>
References: <6D4B5482A2F645E6A7D4EF0BF098F3E0@dell2>
<aebcc9a67954ea23ce43a01d4326e2a18da9d11b.camel@cybertec.at>
<5EB4D21935104DC19E271B490CD16BAA@dell2>
<20200519.161443.2239326109074731181.horikyota.ntt@gmail.com>
Hi!
Thank you.
>As Laurentz said, even if you set it to 5TB, no WAL files older than
>the files needed by the last checkpoint don't remain. If you don't
>need a hot-standby, you can use pg_receivewal to save WAL files on the
>"standby" server. If you need the hot-standby, WAL files should be
>archived.
So pg_receivewal should running in parallel with hot standy server to receive wal files to separate directory.
Will each wal file transferred two times in this case? One time by hot standby server and second time by pg_receivewal.
Main server if priced by amount of bandwidth.
How to receive each wal file only once ? This would allow to decrease network bandwidth and thus cost two times.
pg_receivewal has compression option. Will this compress WAL files before transfer over network ?
>If so, what you need seems to be pg_receivewal, not a full-fledged
>server.
For hot standby and PITR in same server the following steps are required:
1. Create base backup using pg_basebackup
2. Create copy of base backup for PITR
3. Start hot standby server using data directory created in p.1
4. Run pg_receiceval as background process to save wal files to backup created in p.2
If PITR is required, specify recovery time in base backup created in p.2 in postgresql.conf
Start second postgresql server instance in port 5433 which uses this backup for recovery.
Is this OK or should something changed?
How to run pg_receivewal in background ? Is there some option which creates such service so will automatically restart if server is
restarted ?
How to allow main server to keep sufficient number of WAL segments ?
Replication slot cannot used: if backup server stops replication_slot causes main server to fill disk space with untransferred WAL
files.
After that main server will also stop with "no space left on device" error.
Or is there some option like to reserve some disk space or limit wal size so that main server can continue on backup server crash.
Andrus.
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: kobruleht2@hot.ee, horikyota.ntt@gmail.com, laurenz.albe@cybertec.at
Subject: Re: Hot and PITR backups in same server
In-Reply-To: <0B5B726FEF194328AAFABFC6AF66838D@dell2>
References: <6D4B5482A2F645E6A7D4EF0BF098F3E0@dell2> <aebcc9a67954ea23ce43a01d4326e2a18da9d11b.camel@cybertec.at> <5EB4D21935104DC19E271B490CD16BAA@dell2> <20200519.161443.2239326109074731181.horikyota.ntt@gmail.com> <0B5B726FEF194328AAFABFC6AF66838D@dell2>
* 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