Search Postgresql Archives

Re: Hot and PITR backups in same server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux