MySQL Cluster

3 11 2006

We have been having fun with a mysql cluster,

go the Linux-HA bit up without to many real problems and the Apache failover works fine. But clustering MySQL is not that easy. Master/Slave replication works and will failover, but because of the log offsets is quite hard work getting it to fail back correctly. It certainly cant do the merry ping pong that you can do with Apache.

We could use a SAN, but that would be defeatist. So DRBD, a network mirror. You might think it was too slow, but having Done some Bonnie++ tests on it it gives close to native speed for reads. And it mirrors to the pair quite well….. provided you have a 1000BaseT switch, I am getting sync rates on the network raid of about 80-90MB/s which is Ok. The nice thing about it is you can put all your software on the network raid, and so if you are not on the primary node, you wont be able to startup the software and damage the setup since standby nodes dont have their discs mounted……so this looks like it gives the failover benefit of a SAN with normal network hardware and no iSCSI.

When we did iSCSI tests a year ago, bonnie++ was extremely successful at destroying filesystems. It appears to be really good at exposing weaknesses.



2 responses

4 11 2006
Mike Osterman

Hi Ian,

Have you taken a look at the Sequoia Project?

It’s requires a specialized JDBC driver (you configure the different nodes in the JDBC url) but is closer than anything we’ve seen to providing a true HA solution for MySQL or PostgreSQL.

The other downside is that it supports very limited, basic SQL. To do anything MySQL-specific, you need to purchase the commercial counterpart from Continuent. We looked at pricing for PostgreSQL recently, and it was not cheap.

I’ve been considering trying out a test instance of Sakai using Sequoia to figure out if the SQL we use is generic enough to work.

5 11 2006
Ian Boston

Sequoia looks nice and I guess the commercial version would work well. Im not exactly clear how it manages synchronization of the data in the database, but I can see that it would make the failover perfect and possibly do load ballencing (read only queries to slave replications)… so thanks for the pointer.

Further on the DRBD setup, it appears to work fine and fail forwards and back perfectly. In general Im getting 5s failover times which is simular to just apache on its own. The other thing I’ve noticed is that its would be a short step to migrate this setup to a SAN, and it could be used with any off the shelf service that was capable of live recorvery on failure. We have a seperate need to put OpenLDAP in HA mode, this might be an easy way of doing that without having to think to hard about the ‘correct’ way to do it with OpenLDAP…..

%d bloggers like this: