Today I played a little with Cassandra on Amazon EC2. It was a very user friendly and pleasant experience to deploy a cluster with 2 nodes in one region using DataStax OpsCenter.
First I started a m1.small instance in Amazon EC2 where I installed OpsCenter. For this I chose Centos 6, the official AMI. Before starting to install OpsCenter, we need to configure the firewall in order to be able to access it. In AWS console, under the Security group, there is “CentOS 6 -x86_64- – with Updates-6 – 2014-09-29-AutogenByAWSMP-“. We need to righ-click on it and Edit inbound rules. Here we add a new Custom TCP Rule with port 8888 and the Source IP: My IP.
Anyway, I noticed that the instance has also an iptables firewall and the port 8888 is not open. So, on the instance I did:
iptables -I INPUT 4 -p tcp --dport 8888 -j ACCEPT iptables-save | tee /etc/sysconfig/iptables
Now, we can install OpsCenter. All you need to do is to follow the installation guide for RPM package from DataStax:
1. Edit the file:
2. Add the repository for OpsCenter
[opscenter] name = DataStax Repository baseurl = http://rpm.datastax.com/community enabled = 1 gpgcheck = 0
3. Install and start OpsCenter
yum install opscenter service opscenterd start
After the installation is finished and the service started, write in your browser: http://<YOUR_INSTANCE_IP>:8888 and you will see this nice screen.
From now on, it is pretty easy to setup a cluster with multiple nodes.
Just click “Create Brand New Cluster” and follow the steps.
You will need to add some information as in the image below:
- The cluster Name
- Your DataStax Credentials. If you do not know what these are, then you need to go to DataStax Registration page, fill your data and click “Download Now”. Don’t worry, nothing will be downloaded, but you will get an email with your username and password. These are your credentials you need to put in the form from OpsCenter.
- The total number of nodes to be created (and installed with Cassandra) – be aware, the current instance where OpsCenter is running is not counted. I created 2 nodes initially and I added another one later on.
- The Amazon EC2 Credentials – these are needed because OpsCenter will launch the instances for you. You need only to select the Availability Zone and the Size of the instances.
The job is almost done. Now you need to click Build Cluster and wait while all the necessary software is installed.
After few minutes, you will have a Cassandra cluster with 2 nodes.
In the next tutorial I will describe how to add an extra node through OpsCenter to the current cluster.