Three things: 1. 0.0.0.0 has the specific meaning "unspecified". So you really should enter the specific ip address for the slave in the master pg_hba.conf. 2. Is ${REP_USER} defined on BOTH master & slave? IS ${REP_USER} defined as a valid user that can login in the database? 3. I do not know of any case where I've seen a variable in a pg_hba.conf, nor is it defined as a valid option in the documentation. You should specify the replication user directly, which is usually postgres. eg: host replication postgres 999.1.1.1/32 md5 note: replace 999.1.1.1/32 with actual ip of slave. After you have made changes: in psql SELECT pg_reload_conf(); Then check the postgres log on the master to verify connectcion. On 4/9/15, Volkan Unsal <spocksplanet@xxxxxxxxx> 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 md5 > host ${DB_NAME} ${DB_USER} 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? > > > -- > *Volkan Unsal* > *web and mobile development* > volkanunsal.com <http://bit.ly/1h1ebjy> > -- *Melvin Davidson* I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general