Philippe Clérié philippe at gcal.net
Sun Mar 21 07:37:56 PDT 2010
I am trying to recover from a catastrophe and I am about to do something new 
and I need some reassurance that it's the correct procedure.

I have a Slony replication set with two nodes in a master/slave 
configuration, Postgresql 8.1, Slony 1.2.1 on Debian Etch. Node1 (master) was 
taken out of commission (think a rm -rf * type error). I've recovered from a 
previous backup that's about 3 weeks out of date, but Node2 is up to date. I 
want Node2 to update Node1 and then I want to go back to normal.

If I understood correctly, according to the docs, the MOVE SET command is 
the appropriate saviour. So I want to execute the following script on Node1:

cluster name = mycluster;
node 1 admin conninfo='host=xxxxxxx';
node 2 admin conninfo='host=yyyyyyy';
execute script (
   lock set (id = 1, origin = 1);
   wait for event (origin = 1, confirmed = 2); 
   move set (id = 1, old origin = 1, new origin = 2);
   wait for event (origin = 1, confirmed = 2);  
);

Taken right out of the book.

I'll a reasonable amount of time (an hour should suffice), then again on Node1 
I would execute the same script but reversing the origins:

cluster name = mycluster;
node 1 admin conninfo='host=xxxxxxx';
node 2 admin conninfo='host=yyyyyyy';
execute script (
   lock set (id = 1, origin = 2);
   wait for event (origin = 2, confirmed = 1); 
   move set (id = 1, old origin = 2, new origin = 1);
   wait for event (origin = 2, confirmed = 1);  
);

OK? I would really appreciate confirmation, please. :-)

Thanks in advance!

-- 


Philippe

------
The trouble with common sense is that it is so uncommon.
<Anonymous>



More information about the Slony1-general mailing list