Master (

Edit postgresql.conf

listen_addresses = '*'
wal_level = logical
max_wal_senders = 3
max_replication_slots = 3
hot_standby = on

Edit pg_hba.conf

host    replication     postgres   trust

Create a replication slot for the slave

select * from pg_create_physical_replication_slot('master');

Slave #1 (

Remove 9.4/main directory

rm -rf /var/lib/postgresql/9.4/main

Do a base backup of the master

pg_basebackup -P -R -X stream -c fast -h -U postgres -D /var/lib/postgresql/9.4/main

Edit recovery.conf

standby_mode = 'on'
primary_conninfo = 'user=postgres host= sslmode=prefer sslcompression=1 krbsrvname=postgres'
primary_slot_name = 'master'

Copy conf files from master

rsync -av [email protected]:/etc/postgresql/ /etc/postgresql/

Restart cluster

pg_ctlcluster 9.4 main restart

Slave #2 (

Same steps as for slave #1 except the ip of the slave is different.

The problem: A change on the master propagates the change onto slave #1 but not slave #2. Tried rebooting slave #2 and setting up again from a fresh install but still doesn't work. Any ideas?



1 Answer 1


Community Wiki answer generated from a comment left by the question author. Feel free to edit to improve

Nevermind, I fixed it. There needs to be one replication slot per slave. I added another replication slot "master2". So slave #1 is using the "master" replication slot and slave #2 is using the "master2" replication slot. Works fine now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.