Re: no pg_hba.conf entry for replication connection from host

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Volkan Unsal <spocksplanet(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: no pg_hba.conf entry for replication connection from host
Date: 2015-04-09 18:20:35
Message-ID: 5526C2F3.3010707@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/09/2015 10:15 AM, Volkan Unsal wrote:
> I have been configuring a slave server that needs to connect to the
> host. Both the master and the standby servers have a pg_hba.conf that
> looks like this:
>
> # Allow anyone to connect remotely so long as they have a valid
> username and
> # password.
> host replication ${REP_USER} 0.0.0.0/0 <http://0.0.0.0/0>
> md5
> host ${DB_NAME} ${DB_USER} 0.0.0.0/0 <http://0.0.0.0/0>
> md5
>
> This should allow access from every IP address, right? Evidently,
> though, the standby server cannot connect using the REP_USER credentials
> via `primary_conninfo`
>
> primary_conninfo = 'host=${MASTER_PORT_5432_TCP_ADDR} port=5432
> user=${REP_USER} password=${REP_PASS}'
>
> I know this doesn't work because I never see in my logs:
>
> LOG: streaming replication successfully connected to primary
>
> Instead, what I see is
>
> LOG: database system was interrupted; last known up at 2015-04-09
> 16:35:05 GMT
> LOG: entering standby mode
> LOG: redo starts at 0/E000028
> LOG: consistent recovery state reached at 0/E0000F0
>
>
> What am I doing wrong?

What interface is the primary database listening on?

http://www.postgresql.org/docs/9.4/interactive/runtime-config-connection.html#RUNTIME-CONFIG-CONNECTION-SETTINGS

listen_addresses (string)

Can you connect remotely from the standby using psql?

>
>
> --
> *Volkan Unsal*
> /web and mobile development/
> volkanunsal.com <http://bit.ly/1h1ebjy>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Volkan Unsal 2015-04-09 19:03:47 Re: no pg_hba.conf entry for replication connection from host
Previous Message Melvin Davidson 2015-04-09 18:12:09 Re: no pg_hba.conf entry for replication connection from host