0

我可以知道当我在 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

如何在酒保服务器上安装 pg_receivexlog?

谢谢

伊娃

4

2 回答 2

2

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

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
于 2019-10-24T19:45:59.087 回答
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
于 2018-07-16T18:00:47.267 回答