barman的配置,pg_receivexlog失败了

时间:2018-04-13 06:37:24

标签: postgresql-9.4 barman

我可以知道在HA服务器上配置Barman的时候,是否需要在barman服务器上安装Postgres?

当我做酒吧检查时,我的输出是这样的:

    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: 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: OK (have 0 backups, expected at least 0)
    pg_basebackup: OK
    pg_basebackup compatible: OK
    pg_basebackup supports tablespaces mapping: OK
    archive_mode: OK
    archive_command: OK
    continuous archiving: OK
    pg_receivexlog: FAILED
    pg_receivexlog compatible: FAILED (PostgreSQL version: 9.4.17, pg_receivexlog version: None)
    receive-wal running: FAILED (See the Barman log file for more details)
    archiver errors: OK

如何在barman服务器上安装pg_receivexlog?

由于

伊娃

2 个答案:

答案 0 :(得分:0)

编辑postgresql.conf并配置PostgreSQL数据库 具有此选项的服务器

#postgresql.conf

max_wal_senders = 2
max_replication_slots = 2
wal_level = 'replica' or 'hot_standby'

然后在命令行中执行以下命令:

createuser -P --replication streaming_barman

那将创建酒保流媒体用户。然后去pg_hba.conf 并配置用户和酒保服务器IP连接,如下所示

#pg_hba.conf
host    replication    streaming_barman            X.X.X.X/32               trust

在酒保服务器上运行

barman cron

答案 1 :(得分:0)

取决于您的分布。例如。基于Debian的发行版上的pg_receivexlog是特定版本postgresql-client-9.6 postgresql-client-10的客户端的一部分(“ postgresql-client-common contains pg_wrapper`试图找到合适的二进制文件)。根据您的情况,您应该安装:

apt-get install postgresql-client-9.4

客户端二进制文件应安装在专用目录中,例如:

/usr/lib/postgresql/9.4/bin

然后运行

barman cron

后跟barman check

barman check psql-server

如果本地版本早于您要备份的服务器,则可能需要酒保$PATH更新:

pg_receivexlog compatible: FAILED (PostgreSQL version: 12.0, pg_receivexlog version: 11.5-3.pgdg90+1))

您可以轻松检查男服务员在哪里寻找二进制文件:

$ barman show-server psql-server | grep pg_receivewal
        pg_receivexlog_path: /usr/bin/pg_receivewal

Barman具有参数path_prefix,该参数可以覆盖每个服务器的全局配置:

path_prefix = /usr/lib/postgresql/10/bin