Estou tentando configurar a replicação de streaming para um servidor Barman.
A configuração do Barman é bastante básica, estou usando o backup_method = postgres
.
[barman]
barman_home = /var/lib/barman
barman_user = barman
log_file = /var/log/barman/barman.log
log_level = DEBUG
archiver = true
backup_method = postgres
backup_options = concurrent_backup
compression = gzip
minimum_redundancy = 1
retention_policy = RECOVERY WINDOW OF 7 DAYS
retention_policy_mode = auto
streaming_archiver = true
wal_retention_policy = main
configuration_files_directory = /etc/barman.conf.d
Vou chamar o servidor DBpg
[pg]
description = "pg"
ssh_command = ssh [email protected]
conninfo = user=barman dbname=postgres host=pg.example.com port=5432
Configurei as regras do hba e configurei um .pgpass
arquivo na barman
home /var/lib/barman/.pgpass
.
Uma conexão de teste com o pg
servidor funciona bem:
barman@b01:~$ psql -c 'SELECT version()' -U barman -h pg.example.com postgres
version
----------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 10.7 (Debian 10.7-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
(1 row)
No entanto barman check pg
, falha miseravelmente e não tenho ideia do porquê:
$ barman check pg
Server pg:
WAL archive: FAILED (please make sure WAL shipping is setup)
PostgreSQL: OK
is_superuser: OK
PostgreSQL streaming: FAILED (fe_sendauth: no password supplied)
wal_level: OK
directories: OK
retention policy settings: OK
backup maximum age: OK (no last_backup_maximum_age provided)
compression settings: OK
failed backups: OK (there are 0 failed backups)
minimum redundancy requirements: FAILED (have 0 backups, expected at least 1)
pg_basebackup: OK
pg_basebackup compatible: FAILED (PostgreSQL version: None, pg_basebackup version: 11.2-1.pgdg90+1))
pg_basebackup supports tablespaces mapping: OK
archive_mode: OK
archive_command: FAILED (please set it accordingly to documentation)
pg_receivexlog: OK
pg_receivexlog compatible: FAILED (PostgreSQL version: None, pg_receivexlog version: 11.2-1.pgdg90+1))
receive-wal running: FAILED (See the Barman log file for more details)
archiver errors: OK
Existe uma maneira melhor de depurar problemas de autenticação? O .pgpass
mesmo está carregado sob barman check
?
pg.example.com:5432:postgres:barman:s3cr3tP2ssw0rd
Depois de verificar o código-fonte do barman , percebi que o barman está realmente substituindo a
conninfo
string:O que não é muito intuitivo, portanto, o
dbname
in.pgpass
deve incluirreplication
db: