我现在正在使用 PostgreSQL 10。在 RHEL 7 上安装了最新的 Barman。
当我由酒保用户运行此命令时:
-bash-4.2$ barman receive-wal pg
Starting receive-wal for server pg
ERROR: ArchiverFailure:pg_receivexlog not present in $PATH
官方介绍
WAL streaming
Barman can reduce the Recovery Point Objective (RPO) by allowing users to add continuous WAL streaming from a PostgreSQL server, on top of the standard archive_command strategy.
Barman relies on pg_receivewal, a utility that has been available from PostgreSQL 9.2 which exploits the native streaming replication protocol and continuously receives transaction logs from a PostgreSQL server (master or standby). Prior to PostgreSQL 10, pg_receivewal was named pg_receivexlog.
IMPORTANT: Barman requires that pg_receivewal is installed on the same server. For PostgreSQL 9.2 servers, you need pg_receivexlog of version 9.2 installed alongside Barman. For PostgreSQL 9.3 and above, it is recommended to install the latest available version of pg_receivewal, as it is back compatible. Otherwise, users can install multiple versions of pg_receivewal/pg_receivexlog on the Barman server and properly point to the specific version for a server, using the path_prefix option in the configuration file.
In order to enable streaming of transaction logs, you need to:
setup a streaming connection as previously described
set the streaming_archiver option to on
The cron command, if the aforementioned requirements are met, transparently manages log streaming through the execution of the receive-wal command. This is the recommended scenario.
However, users can manually execute the receive-wal command:
barman receive-wal <server_name>
它说:
Prior to PostgreSQL 10, pg_receivewal was named pg_receivexlog.
为什么是版本10,有pg_receivexlog
错误?
检查备份
当我检查备份时,得到:
-bash-4.2$ barman check pg
Server pg:
WAL archive: FAILED (please make sure WAL shipping is setup)
PostgreSQL: OK
is_superuser: OK
PostgreSQL streaming: OK
wal_level: OK
replication slot: FAILED (slot 'barman' not initialised: is 'receive-wal' running?)
directories: OK
retention policy settings: OK
backup maximum age: OK (no last_backup_maximum_age provided)
compression settings: OK
failed backups: OK (there are 0 failed backups)
minimum redundancy requirements: OK (have 0 backups, expected at least 0)
pg_basebackup: OK
pg_basebackup compatible: OK
pg_basebackup supports tablespaces mapping: OK
systemid coherence: OK (no system Id stored on disk)
pg_receivexlog: FAILED
pg_receivexlog compatible: FAILED (PostgreSQL version: 10.12, pg_receivexlog version: None)
receive-wal running: FAILED (See the Barman log file for more details)
archiver errors: OK
如何修复失败的项目?
编辑
当我pg_receivewal
按postgres
用户检查时:
$ sudo su - postgres
-bash-4.2$ pg_receivewal
-bash: pg_receivewal: command not found
-bash-4.2$ psql
psql (9.2.24, server 10.12)
WARNING: psql version 9.2, server version 10.0.
Some psql features might not work.
Type "help" for help.
PostgreSQL 版本:10.12,pg_receivewal
不存在?
重命名时
pg_receivexlog
,酒保并没有在其代码中添加散布条件错误消息。它正在寻找pg_receivewal
,但错误消息的文本仍将“pg_receivexlog”作为涵盖任何适用者的总称。解决方案是将目录添加
pg_receivewal
到您的 $PATH。它应该已经存在,但显然不是。你是如何安装 PostgreSQL 和 barman 的?您以哪个操作系统用户身份运行此命令?export PATH=$PATH:/usr/pgsql-10/bin/
在postgres
和barman
用户下设置。