Pastebin

Paste #18279: No description

< previous paste - next paste>

Pasted by Anonymous Coward

Download View as text

PG Version 10.
Master is running and receiving writes throughout this plan.

Slave1 is connected as a replica using replication slot rep_slot_1.
Slave2 is the new slave.
Slave1 is to be retired and replaced by Slave2.

Plan:
1: On Slave1: stop postgresql 
2: On Slave2: rsync -a Slave1:/var/lib/postgresql/ /var/lib/postgresql/
3: On Slave2: Copy postgresql.conf from Slave1 to Slave2.
4: On Slave2: Edit recovery.conf to use a different replication user/pass and rep_slot_2
5: On Master: Create rep_slot_2 as well as replication user for Slave2 and add Slave2 to pg_hba.conf; reload config
6: On Slave2: start postgresql

Now Slave2 should start replicating from Master and receive writes and catch up.

Is this the correct approach?

Or should I have created the replication slot rep_slot_2 before stopping Slave1?
Or should I have had Slave2 use rep_slot_1 instead?

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.