Install Single Node Cassandra on Amazon EC2 Linux or CentOS
Installing Cassandra on a single node is a simple process involving creating directories as per the configuration file and setting appropriate file permissions. This guide specifically deals with the Cassandra installation process on Amazon Linux AMI or CentOS and uses Amazon EC2 to set-up the single node for testing.
1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y updatesudo ln -sf /usr/share/zoneinfo/America/Indianapolis \ /etc/localtimesudo yum install -y gcc make
2. Download, Untar, and Install Cassandra
Note: The mirror site and the Cassandra version can be updated from this link.
wget http://mirror.atlanticmetro.net/apache /cassandra/1.1.0/apache-cassandra-1.1.0-bin.tar.gz
tar -xzvf apache-cassandra-1.1.0-bin.tar.gz
sudo cp apache-cassandra-1.1.0 /opt
3. Confirm Cassandra Configuration
Note: This is an important step, and helps confirm default configuration for Cassandra directories before their creation:
cd apache-cassandra-1.1.0cd config
nano cassandra.yaml
Confirm the directory settings for:
a. data_file_directoriesb. commitlog_directoryc. saved_caches_directory
4. Create Appropriate Cassandra Directories and Set Permissions
sudo mkdir -p /var/lib/cassandra/datasudo mkdir -p /var/lib/cassandra/commitlogsudo mkdir -p /var/lib/cassandra/saved_cachessudo mkdir -p /var/log/cassandra
Set permissions:
sudo chown -R ec2-user:ec2-user /var/log/cassandra/sudo chown -R ec2-user:ec2-user /var/lib/cassandra/
5. Start Cassandra
cd /opt/apache-cassandra-1.1.0bin/cassandra -f
And that's it! This should get you going with a single node Cassandra set-up. If this tutorial was helpful to you, then please do not forget to leave a comment, or two. :)












