How to make consistent backup of Patroni cluster?

1,261 views
Skip to first unread message

David Pavlíček

unread,
Nov 23, 2021, 2:10:16 AM11/23/21
to pgba...@googlegroups.com
Hello,
we have Patroni PG cluster with 3 nodes in async mode. Is there any tutorial or showcase on how to make a consistent backup with PITR (streaming replication) of such a cluster? At first, we don't want to take a backup of each node. They are pretty big (500G) with lots of changes per day and backup all of them take a lot of space (accounting for WALs, retention policies, etc). My aim is to backup only the current primary node with WALs, etc. When failover or switchover happens, then a backup is performed from the new primary. Is this scenario feasible? Or what is the best approach to this?

At first, we use veeam to take an incremental snapshot backup, but their integration with PG is pretty bad. So we move to the barman. Currently, I set up streaming-only backup on all of the nodes. Then run barman backup all and barman cron. This performs backup only on active primary because there is no replication slot on replicas. But there are lots of errors in the log about that.

It is important to note that failover/switchover takes place pretty often because we use that feature to upgrade system packages, etc.

Thanks for any advice, David

pham lan

unread,
Aug 22, 2022, 5:01:32 AM8/22/22
to Barman, Backup and Recovery Manager for PostgreSQL
Hello David,

Did you by chance get the answer/solution for your question because I am dealing now with the similar case like yours? Using barman to backup/recover a Patroni cluster of 3 nodes and I am still wondering if there is a good solution to dynamic backup only one node?

Thanks and Best regards,
Lan

Martin Marques

unread,
Aug 30, 2022, 5:48:21 AM8/30/22
to Barman, Backup and Recovery Manager for PostgreSQL
Hi Lam, David,

Thanks for bringing this up. We will be working on integrating Barman with Patroni but at the moment Patroni was never a tool we would test Barman with.

We have to think about how the two tools would interact with each other closely (in particular in cases of failover we'd like to rebuild the standbys with a barman recover instead of a basebackup from the new primary), but I assume most of this will come as Patroni features, not from Barman.

David Pavlíček

unread,
Sep 1, 2022, 6:22:00 AM9/1/22
to pgba...@googlegroups.com
Hi, sorry for my late reply. We change backup technology to pgBackrest. It plays well with Patroni and there are many tutorials on that theme. With pgbackrest, we have to give up on streaming replication of WAL files and use log shipping instead (with their own efficient protocol). But after reconsidering our use cases, we decided that this is not a major issue for us. It has worked flawlessly for a few months now. We also perform full cluster restore a few times as part of our dev environment and backup sanity checks routines and it also works flawlessly.   

út 30. 8. 2022 v 11:48 odesílatel Martin Marques <martin....@enterprisedb.com> napsal:
--
--
You received this message because you are subscribed to the "Barman for PostgreSQL" group.
To post to this group, send email to pgba...@googlegroups.com
To unsubscribe from this group, send email to
pgbarman+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pgbarman?hl=en?hl=en-GB

---
You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pgbarman+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pgbarman/9ce0e5d5-8b60-411c-a8aa-95833f12770cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages