Christopher Browne cbbrowne
Wed Oct 13 19:46:36 PDT 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian Hirt wrote:
| i have a simple two node set up, a master and slave and one set. i know
| the node admin conninfo and node id of both nodes and the id for the set
| being replicated. is there a slonik command that will tell me which node
| is the master for the given set?
|
| i know which is which, but my scripts don't. I'm working on some
| switchover scripts which would be simplified by dealing with this aspect
| automatically. I can store this information somewhere if i have too, but
| it would suite my purposes better if i didn't have to.


Here is a query I use to determine the master node

oxrsorg=# select sub_provider from sl_subscribe s1 where sub_set = 1 and
not exists (select * from sl_subscribe s2 where s2.sub_receiver =
s1.sub_provider and s1.sub_set = 1 and s2.sub_set = 1 and s1.sub_active
= 't' and s2.sub_active = 't') group by sub_provider;
~ sub_provider
- --------------
~            1
(1 row)

The 1's in the query indicate set 1; change that as needed.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBbXgJCVn6LJfHIAIRAnB4AJ0U8DdZkoLzEDwb+7ubLNhru+XtxwCgki2r
5vthJ9BIC8LJkAJc21S29Yg=
=6d7E
-----END PGP SIGNATURE-----


More information about the Slony1-general mailing list