Mysql – Providing high availability and failover using MySQL on EC2

amazon ec2failoverhigh-availabilityMySQLredundancy

I would like to have a highly-available MySQL system, with automatic failover, running on Amazon EC2 instances.

The standard approach to solving this is problem Heartbeat + DRBD, but I've found a lot of posts suggesting DRBD doesn't work on EC2, though none saying exactly why. Obviously, a serial heartbeat or distinct network is out of the question in the virtualised environment. It would also be good to have the different servers be in different availability zones, but we're getting into a much harder problem there.

What are peoples' opinion on having a high uptime solution in "the cloud"?

Note: This question was asked before RDS with multi-AZ was announced, which is the nice automatic answer for today's modern IT professional. 🙂

Best Answer

I think you really want a multi-zone RDS setup which was recently added to AWS.

Read more here: http://aws.typepad.com/aws/2010/05/amazon-rds-multi-az-deployment.html

If you wouldn't ask about AWS, I'd suggest a setup including DRBD. This would make sure that both servers stay in sync all the time. But I'm almost 100% sure this isn't possible yet on AWS.

Generally, I'd be careful about snapshotting and all that - it's not a silver bullet! It takes a good while on AWS. The instance storage itself is a) not fast at all and b) not persistent! Even with EBS it's not really fast and you still need to stop the i/o for a consistent snapshot.

Related Topic