'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



Solution 1:[1]

Depends on you distribution. E.g. on Debian based distributions is pg_receivexlog part of client for specific version postgresql-client-9.6, postgresql-client-10 (``postgresql-client-commoncontainspg_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 e.g.:

/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

Solution 2:[2]

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

Solution 3:[3]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tombart
Solution 2 Rafael Souza
Solution 3 Sheikh Wasiu Al Hasib