Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy Cassandra on EC2?

I know Cassandra is still extremely in beta, but I'd like to play around with it. This is in no way a production project; it's just for fun and to learn a little bit. But the best way to learn is to actually deploy and get people to put it through its paces.

I want to use Cassandra with Heroku, so I'd like to deploy it on EC2 (like Heroku is). What's the best, easiest, cheapest way to do so? Any recommendations?

I've seen a few through Google, but they warn things like: The EC2 instances are not suitable for production use. They store the data on the instance itself and will disappear when the instance is shut down.

like image 474
Stuart Avatar asked Jan 17 '11 15:01

Stuart


1 Answers

  • Use Elastic Block Storage (EBS) instances for storing Cassandra log and data files. You will need to alter /etc/cassandra/cassandra.yaml to specify where these files go. EBS instances persist beyond when the EC2 instances they are attached to shut down.

  • You can install it on one instance to try out the interface and to experiment with the data model. You don't need to set up a cluster yet.

  • To test out the clustering capabilities, you might try setting up three instances and giving all keyspaces a replication factor of 3. But this could be a later stage of experimentation than experimenting with the data model. The recommended minimum cluster size is 3.

  • You should experiment with different machine sizes. For experimenting with ultra-small instance sizes, you can use alternate vendors like Rackspace. If you run into performance issues with smaller instance sizes, see if moving up the instance sizes solves these issues.

  • There are a few alpha Cassandra-Object-Mapping libraries for Rails. You may find that these don't quite work for you. You may elect to contribute back to them, or just implement the model persistence code directly in your models. For Rails 3 applications, you may want to look at the ActiveModel interface and helper modules, so that your models work well with ActionPack and other libraries that expect ActiveModel-compatible models.

like image 102
yfeldblum Avatar answered Oct 12 '22 14:10

yfeldblum