Want to confirm if this is a viable solution

65 views
Skip to first unread message

Geraldine Oo

unread,
Jul 11, 2022, 10:22:48 PM7/11/22
to Barman, Backup and Recovery Manager for PostgreSQL
Hi All,

I'm currently testing barman as replacement for BART. In our production env, we have 1 primary and 2 standbys. I'd like for barman to be able to backup with minimal intervention if we have a switchover/failover.

The below is my server config. I'm having 3 hosts there, and its directed to connect to the primary DB. 
[pg14test]
description =  "PG14TEST Database (Streaming) "
conninfo = "host=ooge-pgdb01,ooge-pgdb02,ooge-pgdb04 port=5431 user=barman dbname=postgres target_session_attrs=read-write"
streaming_conninfo = "host=ooge-pgdb01,ooge-pgdb02,ooge-pgdb04 port=5431 user=streaming_barman target_session_attrs=read-write"
backup_method = postgres
streaming_archiver = on
archiver = on
slot_name = barman_pg14test
create_slot = auto
path_prefix = /u01/app/postgres/product/14.4.0/db_1/bin
backup_compression = gzip
backup_compression_format = tar
backup_compression_location = client
retention_policy = "RECOVERY WINDOW OF 3 DAYS"
compression = gzip

In our test env, I have no problems backing up even when there is failover/switchover.
So far, restore seems to be working across switchovers as well. Do you see any issue with this kind of setup? 

Thanks

Luca Ferrari

unread,
Jul 12, 2022, 3:17:40 AM7/12/22
to Barman, Backup and Recovery Manager for PostgreSQL
On Tue, Jul 12, 2022 at 4:22 AM Geraldine Oo <gerald...@gmail.com> wrote:
> streaming_conninfo = "host=ooge-pgdb01,ooge-pgdb02,ooge-pgdb04 port=5431 user=streaming_barman target_session_attrs=read-write"

The only doubt that I would have is if the "old" primary reappears
after a switch over, that I suspect you are going to do demoting it as
standby.

Luca

Geraldine Oo

unread,
Jul 12, 2022, 9:50:54 PM7/12/22
to Barman, Backup and Recovery Manager for PostgreSQL
Thank you :)

We're using EFM to manage the failover/switchover - so this should prevent us from having a case with 2 primaries running. So far barman is quite easy to setup and use. I'm planning to test pgBackRest as well ( the partial restore sounds interesting). If anyone has any experience with barman vs pgBackRest, please do share  


Thanks ! 

Luca Ferrari

unread,
Jul 13, 2022, 2:26:49 AM7/13/22
to Barman, Backup and Recovery Manager for PostgreSQL
On Wed, Jul 13, 2022 at 3:50 AM Geraldine Oo <gerald...@gmail.com> wrote:
>
> Thank you :)
>
> We're using EFM to manage the failover/switchover - so this should prevent us from having a case with 2 primaries running. So far barman is quite easy to setup and use. I'm planning to test pgBackRest as well ( the partial restore sounds interesting). If anyone has any experience with barman vs pgBackRest, please do share

I do use pgbackrest, but doing a head-to-head comparison here is out of scope.
In your particular setup, take into account that pgbackrest does not
allow you do perform backups over streaming.

Luca
Reply all
Reply to author
Forward
0 new messages