Re: A local replication entry - Mailing list pgsql-admin

From Doiron, Daniel
Subject Re: A local replication entry
Date
Msg-id 3A8E2AE3D7AFB44F89EA82A873FBE4E655988CC1@DC-MBOX1.advisory.com
Whole thread Raw
In response to Re: A local replication entry  (John Scalia <jayknowsunix@gmail.com>)
List pgsql-admin

pg_basebackup -h $HOSTNAME -U replicant -D - -Ft -z -c fast -l hourly.backup > backup_file.gz

 

instead of –h 127.0.0.1?

 

From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of John Scalia
Sent: Wednesday, October 29, 2014 10:36 AM
To: Shreeyansh dba
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] A local replication entry

 

Ok, the line now reads:

host       replication       postgres         127.0.0.1/32              trust

And I performed a "service postgresql-9.3 reload", and it still failed with the same error. Then, I tried again using a "-h 127.0.0.1" option for the pg_basebackup. That complained "pg_basebackup: could not connect to server: connection refused." So, I did a "netstat -an | grep 5432" and I see that postgresql is not listening on that port for 127.0.0.1.

On 10/29/2014 9:58 AM, Shreeyansh dba wrote:

I suspect there is a small modification is required in pg_hba.conf file ::

 

Remove the '#' and modify the line like :: 'host    replication    postgres    127.0.0.1/32  trust' 

 

I hope this will help you to resolve the issue

 

Thanks and Regards 

 

Ajinkya Bangale

 

On Wed, Oct 29, 2014 at 6:48 PM, John Scalia <jayknowsunix@gmail.com> wrote:

I think maybe it's just too early in the morning for me, but I can't seem to get a local entry for replication working. I'm trying to create a script for hourly backups using pg_basebackup, and here's the command I'm using:

/usr/pgsql-9.3/bin/pg_basebackup -D - -Ft -z -c fast -l hourly.backup > backup_file.gz

The entry in the pg_hba.conf file is:

local    replication    postgres                            trust

And the error is: FATAL: no pg_hba.conf entry for replication connection from host "[local]", user "postgres", SSL off, but I have gotten this to work only if I use a "-h 10.10.1.129" option for the command. This only works since another entry in the pg_hba.conf satisfies the command.

Do I have an error with the local entry? Or are local entries even allowed for replication? As this has to be automatically deployed to various servers, I'd prefer to NOT specify each host's IP address both in pg_hba.conf file and in the script calling the pg_basebackup command. Oh, and at some point when this starts working, I am going to change the user from postgres to another without superuser capability.
--
Jay


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

 

 

pgsql-admin by date:

Previous
From: John Scalia
Date:
Subject: Re: A local replication entry
Next
From: Tom Lane
Date:
Subject: Re: A local replication entry