Friday, May 6, 2011

Replicating MySQL

We're currently running with one MySQL server. It's a pretty big deal to fix that and get some kind of replication going. I'd initially investigated using MySQL's built-in master-slave replication setup. This worked fine and I had no issues setting it up at all, but it wasn't the desired solution due to fact that failover didn't occur immediately and automatically. It still required the intervention of an administrator and more importantly, it required downtime. One the developers in my office had been working with using MySQL-MMM as a solution and passed that info on to me.

MySQL-MMM is essentially a set of scripts that almost virtualizes MySQL replication. It uses a set a virtual IPs for read and write queries, and moves those IPs around your "cluster" as needed. There's even an extension for Nagios that allows you to monitor the status of your replication.

There's decent documentation out there on it, not the least of which is on their website, There are a few things lacking in the details. For example, it's not always clear whether the instructions are asking you to do something only on the database hosts or if it needs to happen on the monitoring server as well. The version I'm using, version 2.2, is also still new enough that the amount of documentation outside of the website and user experiences reported are low. The FAQ has 3 questions in it, none of which were common things that I'd run into in my setup. The manual also has a number of sections that are still awaiting actual information (noted with TODO tags). However, I did find some other useful information at Packt Pub, a Google Groups post that hipped me to the fact that if I didn't need to split my reads and writes, I didn't have to, and a video presentation on the technology. Quite frankly I didn't make it all the way through the video even though I wanted to; the content seemed like it was worthwhile but the delivery was shaky and awkward and quite distracting. I'll be giving it another go though.

Everything is installed now, and we're off to testing!

No comments:

Post a Comment