Diamond Notes

Just another WordPress weblog

Beginning MySQL Cluster

So, at work, we are implementing a cluster. Actually, we are implementing several clusters. This is my first production experience with clustering. Trust me, it’s a whole different animal.

A couple of observations:

  • I find it much easier to split up the sql and data nodes. Originally I had put a SQL node and a data node on the same physical server. Because I didn’t go with the default locations for the data I kept having trouble. Not sure why, but once I separated things out it became much easier.
  • Having multiple SQL nodes creates some complexity. We want a single IP address for the application so, obviously, we have to have a load balancer of some type. This isn’t quite as easy as it might seem. We have already had one situation where the cluster thought a SQL node failed and shut it off. The SQL node itself was up and running and unless you actually tried to execute a SQL command on the node and you couldn’t tell the SQL node wasn’t working properly.

A typical load balancer might either just ping the IP or possibly try and log in to the SQL node. Both of those would have worked in this case. So, the load balancer would assume everything was cool and keep trying to serve connections to the SQL node. This is still being investigated and any feedback would be welcome!!

  • scripting is going to be your friend. It’s one thing to make a change on three or four servers. It’s another to make a change to twenty. That is one of the cool things about the MySQL Clustering book..quite a few scripts. I have found quite a few on the old ‘net also.

There will be more posts about this in the future I am sure.

3 Comments so far

  1. Jim Dowling September 26th, 2007 5:21 am

    Check out ndbinstaller for installation/mgmt of your cluster:
    http://www.jimdowling.info/ndbinstaller-trac

    It generates and manages your config.ini file; has scripts for starting/stopping the cluster and nodes and SQL servers; and even a script for performing a rolling restart.

    Jim

  2. bmurphy September 26th, 2007 9:14 am

    Jim,

    Your script was one of the ones I had in mind. I intend on doing a posting on various scripts for clusters soon and yours will be one of the high-lighted ones. Thanks!!

    Keith

  3. Waruna December 17th, 2007 4:31 am

    Hello,
    I have a simple question for you, most probably you know the answer.
    Say we have 2 SQL nodes.
    our client programme connects to one SQL node.
    then that particular node fails.
    what will happen? will the programme automatically connects to the other SQL node or not
    Thanks

Leave a reply