Sat May 13 14:19:22 PDT 2006
- Previous message: [Slony1-general] logtrigger not firing
- Next message: [Slony1-general] Cloning a database
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I have been looking at the notion of CLONE NODE...
To refresh memories, this involves copying a database from the
filesystem level and turning that into a new node.
Here's a stream of queries to apply to the two participating nodes
while system is down that seems to "do the trick."
- Old node: node 3, port 5532, localhost, dbname=rt3
- New node: node 6, port 5533, localhost, dbname=rt3
The below is applied whilst slon for node #3 is down.
-- Queries to apply to node #3 database:
select _rt3.storenode(6, 'Node 6 - clone of node 3', 'f');
select _rt3.storepath(6,pa_client, 'port=5533 dbname=rt3 host=localhost', 10) from _rt3.sl_path where pa_client <> 6;
select _rt3.storepath(pa_server, 6, pa_conninfo, 10) from _rt3.sl_path where pa_server <> 6;
select _rt3.subscribeset(sub_set, 3, 6, sub_forward) from _rt3.sl_subscribe where sub_receiver = 3 and sub_forward = 't' and sub_active = 't';
select _rt3.enablesubscription(sub_set, 3, 6) from _rt3.sl_subscribe where sub_receiver = 3 and sub_forward = 't' and sub_active = 't';
insert into _rt3.sl_confirm select con_origin, 6, con_seqno, con_timestamp from _rt3.sl_confirm where con_received = 3;
insert into _rt3.sl_confirm select 6, con_received, con_seqno, con_timestamp from _rt3.sl_confirm where con_origin = 3;
-- Queries to apply to node #6 database:
select _rt3.storenode_int(6, 'Node 6 - clone of node 3', 'f');
select setval('"_rt3".sl_local_node_id', 6);
select _rt3.storepath(6,pa_client, 'port=5533 dbname=rt3 host=localhost', 10) from _rt3.sl_path where pa_client <> 6;
select _rt3.storepath(pa_server, 6, pa_conninfo, 10) from _rt3.sl_path where pa_server <> 6;
select _rt3.subscribeset_int(sub_set, 3, 6, sub_forward) from _rt3.sl_subscribe where sub_receiver = 3 and sub_forward = 't' and sub_active = 't';
select _rt3.enablesubscription(sub_set, 3, 6) from _rt3.sl_subscribe where sub_receiver = 3 and sub_forward = 't' and sub_active = 't';
insert into _rt3.sl_confirm select con_origin, 6, con_seqno, con_timestamp from _rt3.sl_confirm where con_received = 3;
insert into _rt3.sl_confirm select 6, con_received, con_seqno, con_timestamp from _rt3.sl_confirm where con_origin = 3;
After both of these, I start slons, and things seem to progress
properly from there...
Node #6 didn't seem to start SYNCs unless I set up sl_confirm...
- This is overadequate in that it generates way more paths than should
be needful
- This doesn't deal with "cloning the master." There is an easy
answer: Lock all sets on a given origin, before duplicating DBs...
At any rate, if anyone sees manifestly broken things about this, let
me know... The above seemed to work, today...
--
(reverse (concatenate 'string "ofni.sailifa.ac" "@" "enworbbc"))
<http://dba2.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)
- Previous message: [Slony1-general] logtrigger not firing
- Next message: [Slony1-general] Cloning a database
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list