我正在尝试将流复制设置到 Barman 服务器。
Barman 配置非常基本,我使用的是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
我会打电话给数据库服务器pg
[pg]
description = "pg"
ssh_command = ssh [email protected]
conninfo = user=barman dbname=postgres host=pg.example.com port=5432
我已经配置了 hba 规则并在's home设置了一个.pgpass
文件。barman
/var/lib/barman/.pgpass
与服务器的测试连接pg
工作正常:
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)
但是barman check pg
失败得很惨,我不知道为什么:
$ 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
有没有更好的方法来调试身份验证问题?是.pgpass
偶数加载下barman check
吗?
pg.example.com:5432:postgres:barman:s3cr3tP2ssw0rd
在检查了酒保的源代码后,我意识到酒保实际上是在覆盖
conninfo
字符串:这不是很直观,因此
dbname
in.pgpass
应该包括replication
db: