pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Trouble setting up Streaming Replication with Barman
4+ messages / 4 participants
[nested] [flat]

* Trouble setting up Streaming Replication with Barman
@ 2019-11-21 22:07 Evan Walter <ewalter@decisionanalyst.com>
  2019-11-22 01:58 ` Re: Trouble setting up Streaming Replication with Barman Ian Barwick <ian.barwick@2ndquadrant.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Evan Walter @ 2019-11-21 22:07 UTC (permalink / raw)
  To: 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

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Trouble setting up Streaming Replication with Barman
  2019-11-21 22:07 Trouble setting up Streaming Replication with Barman Evan Walter <ewalter@decisionanalyst.com>
@ 2019-11-22 01:58 ` Ian Barwick <ian.barwick@2ndquadrant.com>
  2019-11-23 23:21   ` Re: Trouble setting up Streaming Replication with Barman swadesh mondal <swadeshmondal24@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Ian Barwick @ 2019-11-22 01:58 UTC (permalink / raw)
  To: Evan Walter <ewalter@decisionanalyst.com>; pgsql-admin

On 2019/11/22 7:07, Evan Walter wrote:
> 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'

 >
 > $cat /etc/barman.d/pg.conf
 > [pg]
(...)
 > streaming_conninfo = host=<my-pg-server-ipaddress-here> user=streaming_barman dbname=postgres

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

The "streaming_barman" user should be a user with replication permissions
(if not already set, execute "ALTER USER streaming_barman REPLICATION")
and appropriate permission granted in "pg_hba.conf":

   host replication 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

Check the replication connection works with:

   psql -c 'IDENTIFY_SYSTEM' 'host=<my-ipaddress-here> dbname=postgres user=streaming_barman replication=1'


Regards

Ian Barwick


-- 
  Ian Barwick                   https://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Trouble setting up Streaming Replication with Barman
  2019-11-21 22:07 Trouble setting up Streaming Replication with Barman Evan Walter <ewalter@decisionanalyst.com>
  2019-11-22 01:58 ` Re: Trouble setting up Streaming Replication with Barman Ian Barwick <ian.barwick@2ndquadrant.com>
@ 2019-11-23 23:21   ` swadesh mondal <swadeshmondal24@gmail.com>
  2019-11-25 08:09     ` Re: Trouble setting up Streaming Replication with Barman Jakub Olczyk <jwo@disroot.org>
  0 siblings, 1 reply; 4+ messages in thread

From: swadesh mondal @ 2019-11-23 23:21 UTC (permalink / raw)
  To: Ian Barwick <ian.barwick@2ndquadrant.com>; +Cc: Evan Walter <ewalter@decisionanalyst.com>; pgsql-admin

Hi All,

Any idea  how to prepare a script to populate multiple tables with random
data ?

Regards,
Swadesh

On Fri, Nov 22, 2019 at 2:58 AM Ian Barwick <ian.barwick@2ndquadrant.com>
wrote:

> On 2019/11/22 7:07, Evan Walter wrote:
> > 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'
>
>  >
>  > $cat /etc/barman.d/pg.conf
>  > [pg]
> (...)
>  > streaming_conninfo = host=<my-pg-server-ipaddress-here>
> user=streaming_barman dbname=postgres
>
> (...)
>  > $nano /etc/postgresql/12/main/pg_hba.conf
> (...)
> > host all streaming_barman  <my-barman-ipaddress-here>/32    md5
>
> The "streaming_barman" user should be a user with replication permissions
> (if not already set, execute "ALTER USER streaming_barman REPLICATION")
> and appropriate permission granted in "pg_hba.conf":
>
>    host replication 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
>
> Check the replication connection works with:
>
>    psql -c 'IDENTIFY_SYSTEM' 'host=<my-ipaddress-here> dbname=postgres
> user=streaming_barman replication=1'
>
>
> Regards
>
> Ian Barwick
>
>
> --
>   Ian Barwick                   https://www.2ndQuadrant.com/
>   PostgreSQL Development, 24x7 Support, Training & Services
>
>
>

-- 
Regards,
Swadesh Mondal

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Trouble setting up Streaming Replication with Barman
  2019-11-21 22:07 Trouble setting up Streaming Replication with Barman Evan Walter <ewalter@decisionanalyst.com>
  2019-11-22 01:58 ` Re: Trouble setting up Streaming Replication with Barman Ian Barwick <ian.barwick@2ndquadrant.com>
  2019-11-23 23:21   ` Re: Trouble setting up Streaming Replication with Barman swadesh mondal <swadeshmondal24@gmail.com>
@ 2019-11-25 08:09     ` Jakub Olczyk <jwo@disroot.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Jakub Olczyk @ 2019-11-25 08:09 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi Swadesh,

> Any idea  how to prepare a script to populate multiple tables with
> random data ?

I recommend using Datafiller[1] for that. You just need to have the DDL
of the tables. Based on that the program will create a script that
inserts randomly generated data.

[1] - https://www.cri.ensmp.fr/people/coelho/datafiller.html

Cheers,
jwo





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2019-11-25 08:09 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 22:07 Trouble setting up Streaming Replication with Barman Evan Walter <ewalter@decisionanalyst.com>
2019-11-22 01:58 ` Ian Barwick <ian.barwick@2ndquadrant.com>
2019-11-23 23:21   ` swadesh mondal <swadeshmondal24@gmail.com>
2019-11-25 08:09     ` Jakub Olczyk <jwo@disroot.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox