EnterpriseDB / barman

Barman - Backup and Recovery Manager for PostgreSQL
https://www.pgbarman.org/
GNU General Public License v3.0
2.03k stars 191 forks source link

Barman should automatically ignore primary_conninfo if running as primary #704

Open allanharry opened 1 year ago

allanharry commented 1 year ago

Barman can identify if server is running as primary or standby - "barman status servername" If running as primary then ignore primary_conninfo parameter when backup is taken on primary. If running as standby use primary_conninfo to switch wal on primary when finalizing backup on standby.

Then you dont have to adjust conf files each time cluster doing a fail-over

Running Barman version 3.2.0

r-chauhan16 commented 1 year ago

Hi

After the switchover to standby via repmgr. BARMAN complains about the below error. How do I overcome this?? Ideally as per the enhancement, after switchover when conninfo is pointing to primary, it should ignore primary_conninfo parameter.

BARMAN version 3.3 Error: PostgreSQL server is standby: FAILED (conninfo should point to a standby server if primary_conninfo is set) Primary server is not a standby: FAILED (primary_conninfo should point to a primary server, not a standby) Primary and standby have same system ID: OK

Barman configuration [ams] description = "ams server config" ssh_command = ssh postgres@host1 -q conninfo = host=host2 user=barman port=5438 dbname=plw_ams password=***** backup_options = concurrent_backup backup_method = postgres

archiver = on

streaming_archiver = on slot_name = barman create_slot = auto streaming_conninfo = host=host1 user=streamuser port=5438 dbname=plw_ams password=** path_prefix=/usr/pgsql-14/bin primary_conninfo = host=host1 user=barman port=5438 dbname=plw_ams password=****

Thanks