Trouble setting up Streaming Replication with Barman

From: Evan Walter <ewalter(at)decisionanalyst(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Trouble setting up Streaming Replication with Barman
Date: 2019-11-21 22:07:55
Message-ID: CAOHVLOG2S3NzOftT=+XRBoyYtOY=2LSF+ije7wGD7TrntS3-Cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,
I am trying to set up streaming replication with barman, going down the
tutorial.

When I run/ I get:

$barman receive-wal --create-slot pg

ERROR: Cannot connect to server 'pg'

##############################################################
Both servers Ubuntu 18.04, Postgresql 12.1

These are the configurations I have set up so far:
The Main Postgres Server: ###############################
$nano /etc/postgresql/12/main/postgresql.conf
--------------------------------------------------
....
listening_addresses = '*'
wal_level = hot_standby
archive_mode = on
archive_command = 'cp %p /<my-wal_archive-dir-here>/%f'
max_wal_senders =3
max_replication_slots = 3
wal_keep_segments = 512
hot_standby = on

$nano /etc/postgresql/12/main/pg_hba.conf
----------------------------------------------
....
host all barman <my-barman-ipaddress-here>/32 md5
host all streaming_barman <my-barman-ipaddress-here>/32 md5

The Barman Server (logged in as barman): ###############################
$psql -c 'SELECT version()' -U barman -h <my-ipaddress-here> postgres

version
-----------------------------------------------------------------------------
PostgreSQL 12.1 (Ubuntu 12.1-1.pgdg18.04+1) on x86_64-pc-linux-gnu,
compiled by gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, 64-bit
(1 row)

$cat /etc/barman.d/pg.conf
[pg]
description = "Streaming Replication"
conninfo = host=<my-pg-server-ipaddress-here> user=barman dbname=postgres
streaming_conninfo = host=<my-pg-server-ipaddress-here>
user=streaming_barman dbname=postgres
backup_method = postgres
streaming_archiver = on
slot_name = barman

When I run/ I get:

$barman receive-wal --create-slot pg

ERROR: Cannot connect to server 'pg'

Thanks

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ian Barwick 2019-11-22 01:58:35 Re: Trouble setting up Streaming Replication with Barman
Previous Message Shaun Thomas 2019-11-21 15:37:02 Re: SCRIPT FOR AUTOMATIC PROMOTION FOR PGBOUNCER