次のエラーを解決するために頭を悩ませていますが、あまり進歩していません。
$ barman switch-wal --force --archive --archive-timeout 180 pg
The WAL file 0000000100000059000000FF has been closed on server 'pg'
Waiting for the WAL file 0000000100000059000000FF from server 'pg' (max: 180 seconds)
ERROR: The WAL file 0000000100000059000000FF has not been received in 180 seconds
以前に使い捨てのVPSでバーテンダーを設定していたので、すべてがうまくいきました。しかし、これを最後のEC2インスタンスで複製しようとすると、上記の問題に遭遇しました。私は次のことを確認しました(VPSでこれを行ったことを覚えていませんが)。
ここの問題は何でしょうか?
編集:barman check pg
の出力を追加
Server pg:
2017-12-08 05:56:31,841 [14559] barman.server ERROR: Check 'WAL archive' failed for server 'pg'
WAL archive: FAILED (please make sure WAL shipping is setup)
PostgreSQL: OK
is_superuser: OK
PostgreSQL streaming: OK
wal_level: OK
2017-12-08 05:56:34,174 [14559] barman.server ERROR: Check 'replication slot' failed for server 'pg'
replication slot: FAILED (slot 'pgbackup' not active: is 'receive-wal' running?)
directories: OK
retention policy settings: OK
2017-12-08 05:56:34,175 [14559] barman.server ERROR: Check 'backup maximum age' failed for server 'pg'
backup maximum age: FAILED (interval provided: 14 days, latest backup age: No available backups)
compression settings: OK
failed backups: OK (there are 0 failed backups)
2017-12-08 05:56:34,175 [14559] barman.server ERROR: Check 'minimum redundancy requirements' failed for server 'pg'
minimum redundancy requirements: FAILED (have 0 backups, expected at least 3)
pg_basebackup: OK
pg_basebackup compatible: OK
pg_basebackup supports tablespaces mapping: OK
pg_receivexlog: OK
pg_receivexlog compatible: OK
2017-12-08 05:56:34,367 [14559] barman.server ERROR: Check 'receive-wal running' failed for server 'pg'
receive-wal running: FAILED (See the Barman log file for more details)
archiver errors: OK
編集:barman receive-wal pg
の出力を追加
$ Sudo barman receive-wal pg
2017-12-10 01:48:01,129 [25410] barman.utils WARNING: Failed opening the requested log file. Using standard error instead.
Starting receive-wal for server pg
2017-12-10 01:48:01,138 [25410] barman.server INFO: Starting receive-wal for server pg
2017-12-10 01:48:03,087 [25410] barman.wal_archiver INFO: Activating WAL archiving through streaming protocol
pg: pg_receivexlog: starting log streaming at 5A/A000000 (timeline 1)
2017-12-10 01:48:03,391 [25410] barman.command_wrappers INFO: pg: pg_receivexlog: starting log streaming at 5A/A000000 (timeline 1)
^CSIGINT received. Terminate gracefully.
2017-12-10 01:50:42,512 [25410] barman.wal_archiver INFO: SIGINT received. Terminate gracefully.
編集:設定ファイル-
; --------------------
; Contents of /etc/barman.conf after removing all commented lines.
; --------------------
[barman]
barman_user = ubuntu
path_prefix = /home/ubuntu/pg/bin
configuration_files_directory = /home/ubuntu/barman.conf.d
barman_home = /home/ubuntu/barman
log_file = /var/log/barman/barman.log
log_level = INFO
compression = bzip2
retention_policy = RECOVERY WINDOW OF 1 MONTH
last_backup_maximum_age = 2 WEEKS
minimum_redundancy = 3
retention_policy = RECOVERY WINDOW OF 4 WEEKS
/home/ubuntu/barman.conf.d/pg.conf
:
; --------------------
; Contents of /home/ubuntu/barman.conf.d/pg.conf after removing all commented lines.
; --------------------
[pg]
description = "Postgres DB"
conninfo = Host=REDACTED user=REDACTED dbname=REDACTED
backup_method = postgres
archiver = off
streaming_conninfo = Host=REDACTED user=REDACTED dbname=REDACTED
streaming_archiver = on
slot_name = pgbackup
このような問題が発生した場合は、ログとbarman check
コマンドを再確認し、barman cron
エントリを設定してbarman receive-wal
を開始するようにしてください。 barman switch-wal
を実行して設定を完了する前に、これを実行する必要があります。 =)
PostgreSQLとBarmanのどのバージョンを使用していますか?
PG 9.3より前は、FFで終わるWALファイルはなく、FEから00になりました。
PG <9.3を使用しているようですが、Barmanのバージョンはそれを期待していません。