我正在尝试将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
答案 0 :(得分:7)
barman check
尝试通过声明归档中存在实际内容来确认归档是否已正确设置。但是,WAL段通常只有在填满后才会存档,如果您的服务器处于空闲状态,则永远不会发生这种情况。
要解决这个问题,Barman提供了一个强制段切换的命令,等待已完成的WAL显示,然后立即存档:
barman switch-xlog --force --archive replica
答案 1 :(得分:0)
Barman的incoming_wals_directory
和Postgresql.conf的archive_command
如详细信息here所述不匹配
另一个原因是
之间的不匹配incoming_wals_directory
archive_command
要检查的Bash实用程序
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和:output2中必须具有相同的路径
使它们匹配,如果它们不匹配,并且不要忘记之后重新启动postgres。