Postgresql

WAL 存檔:失敗(請確保設置了 WAL 運輸)

  • February 23, 2021

我正在嘗試將 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 和調酒師 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 switch-xlog --force --archive <server_name>按照酒保文件中的說明執行以驗證 WAL 歸檔過程。

在信中

Barman’sincoming_wals_directory和 Postgresql.conf’sarchive_command不匹配,如這裡詳細描述的那樣

細節

另一個原因是之間不匹配

  • 調酒師incoming_wals_directory
  • Postgresql.conf 的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。

引用自:https://dba.stackexchange.com/questions/166195