MySQL 5.1 NDB Cluster on EC2 – Part 1

Can you use MySQL Cluster and have persistent storage?

Yes, if you run enough cluster (data) nodes that it can survive the loss of one or more nodes.
So if reliability is required, the minimum number of nodes would be 3 data nodes.

The real solution would be to use MySQL Cluster replication. It requires more nodes but almost guarantees no loss data even if you lose one whole cluster.

Use MySQL 5.1 cluster
http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster.html

As this version will give you the ability to have non-indexed data on disk, otherwise the whole lot has to be in memory. So on EC2 that is 1-1.2Gig or so.

As to persistent storage, you will need either to

  • Run enough nodes (n+1) so that any crash of your AMI is handled ok. You can then use /mnt as storage.
  • Use a S3 filesystem, there are couple of people providing solutions. You could still use S3 as a backup storage, as you still need backups even if you are running a fault tolerant cluster.

I would use option 1, if you are really paranoid use a Master MySQL 5.1 cluster 3 nodes replicating to a Slave MySQL 5.1 cluster 3 nodes.

The MySQL Cluster replication is documented here
http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-replication.html

I have made a MySQL 5.0 NDB cluster of 4 nodes (1 master, 2 data and 1 mysql) so the next thing is built a Mysql 5.1 NDB master and mysql node and a MySQL 5.1 NDB data node for EC2 AMI (Amazon Machine Images).

The process continues in Part 2

Have Fun

Paul

2 thoughts on “MySQL 5.1 NDB Cluster on EC2 – Part 1

  1. Thank Barmijo for the comment.My primary use of EC2 is as a stepping stone onto virtualization. There are a bunch of companies offering similar.I can use any EC2 AMI that is already built as sporadically as I currently do, without a monthly flat fee apart from storage.When I need a more robust solution I can expand onto a different platform.At the end of the day, this is about learning the products I deal with or will potentially deal with in the near future, without waiting on the availability of hardware. Just time.

Comments are closed.