Centos 7 Postgresql 9.6 error on replication

0

I've configured replication on postgresql with wal senders. The connection to database from the slave computer works well, but when i tried to execute this sentence to replicate the master server

pg_basebackup -h MasterIP -U postgres -D /var/lib/pgsql/9.6/data -P --xlog

I got this error pg_basebackup: could not connect to server: FATAL: no pg_hba.conf entry for replication connection from host "SlaveIP", user "postgres", SSL off

I hope someone can help me.

Holly Doge

Posted 2019-03-30T05:03:49.997

Reputation: 26

Answers

1

In the case of this problem check out the pg_hba.conf because the user with the granted permissions of replication need to be inticated on the file like this

# TYPE DATABASE USER ADDRESS METHOD

host all all 127.0.0.1/32 md5

host all all LOCALIP/32 md5

host replication replica ReplicationIP/32 md5

Hope this can help.

Holly Doge

Posted 2019-03-30T05:03:49.997

Reputation: 26