?

Log in

No account? Create an account

Zeroconf, Avahi, MySQL, and do I get to go on vacation now?

« previous entry | next entry »
Feb. 16th, 2007 | 10:31 pm

mysql> select * from zeroconf;
+------------------+-----------+------+
| NAME | HOSTNAME | PORT |
+------------------+-----------+------+
| crawler | purgatory.local | 3308 |
| slave | zim.local | 3306 |
| master | hell.local | 3306 |
+------------------+-----------+------+
1 row in set (0.00 sec)


Not really fit yet for use... probably a bunch of memory leaks. I need to rework it, but the basics work.

And what is it?

It is a plugin for MySQL that has two pieces, one an information schema, and another which sets up a daemon thread to publish the server via zeroconf (via the Avahi library). The information schema just allows one server to see what others are available on the network.

What does this mean?

A few ideas:
  • All tools now can just "find" the local available servers.
  • Foundation for slaves to just find a master.
  • Load balancing via "finding" an available host

    I am a bit tired or I suspect I could list off another dozen possibilities. It has the ability to not only list a "name" but to list a message. That message could be the state of replication, or the load on the local database.

    You can read up on Zeroconf from Apple's website:
    http://www.apple.com/macosx/features/bonjour/

    Or about Avahi from here:
    http://avahi.org/

    Now the real question is, how long will take Mark to spit out a prototype in Java to make use of it? Or will Georg beat him to it for PHP?

    You can find the current spaghetti code here:
    http://hg.tangent.org/mysql_zeroconf

    The src/Makefile.am is setup for a debug server at the moment. No promises that you can get this compiled at all. The "name" is hardcoded in at the moment, it should be simple to fix this to be updated via variables (since I want to be able to do this live inside of the server).

    For those people writing plugins it has the first example of two plugins coexisting in the same dynamically loaded module.

    I am going on vacation starting now, so don't expect anything on it for at least a week.
  • Link | Leave a comment | Share

    Comments {5}

    Patrick Galbraith

    Federated

    from: capttofu
    date: Feb. 20th, 2007 02:14 pm (UTC)
    Link

    We need to talk about how I can use this in Federated. This week.

    Reply | Thread

    mdns & mysql

    from: skout23
    date: Jun. 11th, 2008 10:55 pm (UTC)
    Link

    just wanted to let you know I am about to implement / play around with your plugin, looking to do some simple round-robin SQL handling. The ideal would be that I can get avahi/mdns whatever to auto-update the dynamic-dns round-robin entry for a few sequencing servers.

    Thanks,
    Scott

    Reply | Thread

    Brian "Krow" Aker

    Re: mdns & mysql

    from: krow
    date: Jun. 11th, 2008 10:56 pm (UTC)
    Link

    Cool!

    Drop me a note if you need some help.

    Reply | Parent | Thread

    Re: mdns & mysql

    from: skout23
    date: Jun. 11th, 2008 11:37 pm (UTC)
    Link

    Hmm, so a few things... I might be misunderstanding something, however I could not find a configure script in the tgz I downloaded from the mercurial interface. "configure.in" YES... a 'chmod +x'able configure no. Am I supposed to import this project into an IDE or the like and generate my own configure script? Also conflicting docs.. Your blog post implies that it is for a debug build, while the README says the opposite. Also I was planning on just using a debian pkg for the server, do you know of any reason why that would not work.

    Thanks,
    Scott

    Reply | Parent | Thread

    Brian "Krow" Aker

    Re: mdns & mysql

    from: krow
    date: Jun. 12th, 2008 12:13 am (UTC)
    Link

    Run ./config/bootstrap, it will build the configure.

    For a packed version of MySQL, the module needs to be compiled without debug options.

    Reply | Parent | Thread