简体   繁体   English

WAL归档文件:FAILED(请确保已设置WAL装运)

[英]WAL archive: FAILED (please make sure WAL shipping is setup)

I am trying to configure Barman to backup. 我正在尝试配置Barman进行备份。 When I do a barman check replica I keep getting: 当我做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

I am using Postgresql 9.6 and barman 2.1; 我正在使用Postgresql 9.6和Barman 2.1; I am not sure as to what the issue is could someone help? 我不确定有人可以提供什么帮助? Here is my Barman server configuration: 这是我的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 tries to confirm that archiving is set up correctly by asserting that there's actually something in the archive. barman check试图通过断言档案中确实有东西来确认归档设置正确。 However, WAL segments are generally only archived once they're filled up, and if your server is idle, this is never going to happen. 但是,WAL段通常仅在填满后才归档,并且如果您的服务器空闲,则永远不会发生。

To work around this, Barman provides a command to force a segment switch, wait for the completed WAL to show up, and then archive it immediately: 要解决此问题,Barman提供了一个命令来强制进行分段切换,等待完整的WAL出现,然后立即将其归档:

barman switch-xlog --force --archive replica

in brief 简单来说

Barman's incoming_wals_directory and Postgresql.conf's archive_command not matched as described in details here 巴曼的incoming_wals_directory和postgresql.conf中的archive_command的详细描述不匹配这里

details 细节

Another cause is that the not matched between 另一个原因是不匹配之间

  • Barman's incoming_wals_directory 酒保的incoming_wals_directory
  • Postgresql.conf's archive_command Postgresql.conf的archive_command

Bash util to check Bash util进行检查

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' 

We must have same path in :output1 and :output2 我们必须在:output1和:output2中使用相同的路径

Make them matched if they don't and don't forget to restart postgres afterward. 如果它们不匹配,则使它们匹配,并且不要忘记随后重新启动postgres。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM