我正在尝试将Barman配置为备份。当我做barman check replica
时,我会继续得到:
Server replica:
WAL archive: FAILED (please make sure WAL shipping is setup)
PostgreSQL: OK
superuser: OK
wal_level: OK
directories: OK
retention policy settings: OK
backup maximum age: FAILED (interval provided: 1 day, latest backup age: No available backups)
compression settings: OK
failed backups: OK (there are 0 failed backups)
minimum redundancy requirements: FAILED (have 0 backups, expected at least 2)
ssh: OK (PostgreSQL server)
not in recovery: FAILED (cannot perform exclusive backup on a standby)
archive_mode: OK
archive_command: OK
continuous archiving: OK
archiver errors: OK
我正在使用Postgresql 9.6和Barman 2.1;我不确定有人可以帮忙吗?这是我的Barman服务器配置:
description = "Database backup"
conninfo = host=<db-ip> user=postgres dbname=db
backup_method = rsync
ssh_command = ssh postgres@<db-ip>
archiver = on
barman check
试图通过断言档案中实际上有一些东西来确认归档的设置。但是,WAL段通常仅在填充后才存档,如果您的服务器闲置,这将永远不会发生。
为了解决此问题,Barman提供了强制限制段开关的命令,等待完整的WAL出现,然后立即存档:
barman switch-xlog --force --archive replica
在简短
中 Barman的incoming_wals_directory
和Postgresql.conf的archive_command
与此处详细说明
详细信息
另一个原因是在
之间不匹配- Barman的
incoming_wals_directory
- Postgresql.conf的
archive_command
bash uti以检查
barman@backup $ barman show-server pg | grep incoming_wals_directory
# output1
# > incoming_wals_directory: /var/lib/barman/pg/incoming
postgres@pg $ cat /etc/postgresql/10/main/postgresql.conf | grep archive_command
# output2
# > archive_command = 'rsync -a %p barman@staging:/var/lib/barman/pg/incoming/%f'
我们必须具有相同的路径在:output1 and:output2
如果他们不这样做,请让它们匹配,并且不要忘记以后重新启动Postgr。