Brian "Krow" Aker (krow) wrote,
Brian "Krow" Aker
krow

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

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.
  • Subscribe
    • Post a new comment

      Error

      Comments allowed for friends only

      Anonymous comments are disabled in this journal

      default userpic

      Your reply will be screened

      Your IP address will be recorded 

    • 5 comments