Home > Archive > Slony1 PostgreSQL Replication > February 2006 > Local node ID









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Local node ID
Franco Pieressa

2006-02-07, 3:24 am

Hi! I have a simple question, how can I do to know which is the local node
ID of a DB that is members of a slony cluster? Are there some SQL to find
it? I'm playing with failovers, and I want to know if it's running OK...

And now, the difficult question :-) I read the article in
http://www.linuxjournal.com/article/7834, and I test the script promote.sh.
After running it, clear the orginal master db and replicate the schema from
the original slave, how can I do the switchback, witch a slonik script? May
be with a "move set" command, but how?

Thanks!

Christopher Browne

2006-02-07, 9:24 am

Franco Pieressa <fpieressa- Re5JQEeQqe8AvxtiuMwx
3w@public.gmane.org> writes:
> Hi!=A0 I have a simple question, how can I do to know which is the
> local node ID of a DB that is members of a slony cluster?=A0 Are there
> some SQL to find it?=A0 I'm playing with failovers, and I want to know
> if it's running OK...


It is stored in a sequence in the special schema, in sl_local_node_id.

The function (again, in the special Slony-I schema), getlocalnodeid()
is the "portable" way you're intended to get at the value.

Thus, if the cluster is called T1, then you could do...

select "_T1". getlocalnodeid('_T1'
);

> And now, the difficult question :-) I read the article in
> http://www.linuxjournal.com/article/7834, and I test the script
> promote.sh.=A0 After running it, clear the orginal master db and
> replicate the schema from the original slave, how can I do the
> switchback, witch a slonik script? May be with a "move set" command,
> but how?


The slonik script would involve two steps:

1. Lock the replication set

lock set (id=3D1);

2. Move the set origin

move set (id=3D1, old origin =3D 2, new origin =3D 1);

This would all go into one slonik script consisting of preamble and
contents, something like:

----------------------------------------------------
cluster name =3D 'T1';
node 1 admin conninfo =3D 'some dsn';
node 2 admin conninfo =3D 'some dsn';
lock set (id=3D1);
move set (id=3D1, old origin =3D 2, new origin =3D 1);
----------------------------------------------------

You'll obviously have to rename nodes, connection info, and the
cluster to correspond with your system's configuration.
-- =

(reverse (concatenate 'string "ofni.sailifa.ac" "@" "enworbbc"))
<http://dba2.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com