postgresqlbarman

Barman geo-redundancy configuration error


I trying to config the geo-redundancy on my barman setup, but i get an error when i try to copy from primary to secundary backup, my configuration is:

SERVER 1

backup_method = rsync
archiver = on
compression = gzip
reuse_backup = link
backup_options = concurrent_backup
parallel_jobs = 2
network_compression = true
basebackup_retry_times = 20
basebackup_retry_sleep = 120
[comauto_20200921_95]
description =  "Comauto Local Postgres 9.5 - 21/09/2020"
conninfo = host=192.168.0.102 user=barman dbname=postgres
ssh_command = ssh postgres@192.168.0.102
retention_policy = RECOVERY WINDOW OF 2 WEEKS
backup_options = exclusive_backup

SERVER 2

backup_method = rsync
archiver = on
compression = gzip
reuse_backup = link
backup_options = concurrent_backup
parallel_jobs = 2
network_compression = true
basebackup_retry_times = 20
basebackup_retry_sleep = 120
; the only difference
primary_ssh_command = barman@192.168.0.103
[comauto_20200921_95]
description =  "Comauto Local Postgres 9.5 - 21/09/2020"
conninfo = host=192.168.0.102 user=barman dbname=postgres
ssh_command = ssh postgres@192.168.0.102
retention_policy = RECOVERY WINDOW OF 2 WEEKS
backup_options = exclusive_backup

On server 1:

sudo su barman
ssh barman@192.168.0.102 -C true
 # OK
barman check comauto_20200921_95
 # All OK
barman backup comauto_20200921_95
 # OK
barman list-backup comauto_20200921_95
 # comauto_20200921_95 20201111T172643 - Wed Nov 11 17:26:50 2020 - Size: 6.2 GiB - WAL Size: 0 B
 # comauto_20200921_95 20201111T114656 - Wed Nov 11 11:47:08 2020 - Size: 6.2 GiB - WAL Size: 79.9 KiB
 # comauto_20200921_95 20201111T112906 - Wed Nov 11 11:33:10 2020 - Size: 6.2 GiB - WAL Size: 96.4 KiB

The error happens here

On server 2:

sudo su barman
ssh barman@192.168.0.103 -C true
 # OK
barman check comauto_20200921_95
 # WAL archive: FAILED
 # ssh: FAILED (Connection failed using 'barman@192.168.0.103 -o BatchMode=yes -o StrictHostKeyChecking=no' return code 127)
barman cron
 # ERROR: Failed to retrieve the primary node status: sync-info execution on remote primary server comauto_20200921_95 failed: /bin/sh: 1: barman@192.168.0.103: not found
barman list-backup comauto_20200921_95
 #

Solution

  • One obvious issue is that primary_ssh_command is missing the actual ssh; it should presumably be:

    ; the only difference
    primary_ssh_command = ssh barman@192.168.0.103
    

    See example in the documentation here: https://docs.pgbarman.org/#configuration-1