Stopping Replication

Status
Not open for further replies.

Matthew Main

Member
Jan 24, 2017
92
5
8
39
Hey guys,

I have a 2 node DigiDaz cluster running, i need to stop replication and remove node 2, I have been looking at the standard bdr commands that i guess run under psql but there not working, can anyone point me in the right direction

KR

Matt
 

KonradSC

Active Member
Mar 10, 2017
166
98
28
I've had to remove BDR manually before for various reasons. If the standard bdr commands didn't work I would go to Node 1 and remove Node 2 from it's bdr.bdr_nodes and bdr.bdr_connections table.

These are my notes: ...good luck

Code:
Commands to remove a broken NODE2:
Remove the node from the cluster. Execute the following on NODE1
    SELECT bdr.bdr_part_by_node_names(ARRAY['node2-fdb2']);
    select * from bdr.bdr_nodes;
    delete from bdr.bdr_nodes where node_status='k';
    select * from bdr.bdr_connections;            #remove old connections if stuck

To remove BDR from NODE2:
su -l postgres
psql fusionpbx 
    
    select bdr.bdr_get_local_node_name();
    select * from bdr.bdr_nodes;
    select * from pg_replication_slots;
    select pg_drop_replication_slot('bdr_795788_6388070180857753308_1_5751674__');
    delete from bdr.bdr_nodes where node_status='i';
select bdr.remove_bdr_from_local_node();
DROP EXTENSION bdr;
DROP DATABASE fusionpbx;
 
  • Like
Reactions: Matthew Main

Matthew Main

Member
Jan 24, 2017
92
5
8
39
Thanks for the help, I found the error of my ways, i was not entering a DB before running the commands.

so i have run the above on all db being replicated (fusionpbx and freeswitch), All i want to do is stop node 1 filling up with failed syc logs. I have built a new cluster on 4.4 and to save monies dropped the node 2 from the original cluster while i migrate all data over.

will running just the 1st section be enough?

SELECT bdr.bdr_part_by_node_names(ARRAY['node2-fdb2']);
select * from bdr.bdr_nodes;
delete from bdr.bdr_nodes where node_status='k';
select * from bdr.bdr_connections;

Cheers Matt
 

KonradSC

Active Member
Mar 10, 2017
166
98
28
Yeah, just the first part is all you need. I have the 2nd step in my notes for when I need to break BDR and set it up again on Node 2. If the server is being decommissioned then just shut it down and remove the entries on Node 1 BDR tables.
 
  • Like
Reactions: Matthew Main

Vishal Pai

Member
May 2, 2017
35
1
8
34
Hello Everyone

I am having 4 server with replication using bdr. All 4 are replicated together now i want to remove/destroy the 3rd one out of 4. What is the best way to achieve it.

As i can see above post shall i go to individual node and run below command

SELECT bdr.bdr_part_by_node_names(ARRAY['node2-fdb2']);
select * from bdr.bdr_nodes;
delete from bdr.bdr_nodes where node_status='k';
select * from bdr.bdr_connections; #remove old connections if stuck

or any other way is there to achieve it.
 
Status
Not open for further replies.