简体   繁体   中英

Configuration of barman, pg_receivexlog failed

Can I know when I configure Barman on the HA server, do I need to install a Postgres on barman server?

When I do barman check, my output is like this:

    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

How can I install pg_receivexlog on barman server?

Thanks

Eva

Depends on you distribution. Eg on Debian based distributions is pg_receivexlog part of client for specific version postgresql-client-9.6 , postgresql-client-10 (``postgresql-client-common contains pg_wrapper` that tries to locate appropriate binary). In your case you should install:

apt-get install postgresql-client-9.4

The client binaries should be installed dedicated directory eg:

/usr/lib/postgresql/9.4/bin

Then run

barman cron

Followed by barman check :

barman check psql-server

If the local version if older than the server you're trying to backup, the barman $PATH update might be needed:

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

you can easily check where is barman looking for the binary:

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

Barman has a parameter path_prefix that can override global config for each server:

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

There are two possible issue could be happen

  1. Different PostgreSQL version installed on same server example pg12 & pg13 and that is why its bin folder already available. In that need to uninstall which actually you don't need.

  2. Another issue could be, you wrongly configured a parameter path_prefix at your "pg" server /etc/barman.d/pg.conf .

Version wise it should be different other wise you will see " pg_receivexlog compatible " issue. example:

path_prefix = "/usr/pgsql-nth/bin"
 
path_prefix = "/usr/pgsql-12/bin"

I think in your case 2nd issue happened.

Edit postgresql.conf and configure PostgreSQL database server with this options

#postgresql.conf

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

Then execute on command line following command:

createuser -P --replication streaming_barman

Thats creates barman streaming user. Then go to pg_hba.conf and configure user and barman server IP conection like below

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

On barman server run

barman cron

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM