My problem is same as the one asked in below topic
Streaming Replication Failover - how to point second slave at new master?
Currently I am working on Postgresql 9.5, I have one master and two slave servers, after master crashed and one of the slaves is assigned as new master, I want to change the master of other slave without full base backup.
I tried the steps written in answer, but it does not seem to work, can someone please guide me on solving this problem?
I am writing some details of my configuration, in case it helps.
standby_mode = on
primary_conninfo = 'host=10.10.10.160 port=5432 user=repuser password=*****'
restore_command = 'cp /archivedir/%f %p'
trigger_file = '/tmp/postgresql.trigger.5432'
The 10.10.10.160 is the IP address of new master server.
Also /archivedir
folder seems empty in both master and slave servers, is this normal? The below settings are present in the postgresql.conf
:
wal_level = hot_standby
archive_mode = on
archive_command = 'test ! -f /archivedir/%f && cp %p /archivedir/%f'
max_wal_senders = 3
hot_standby = on