Apache Cassandra Installation on Ubuntu 14.04

posted on Nov 20th, 2016

Apache Cassandra

Apache Cassandra is a free and open-source distributed database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters spanning multiple datacenters, with asynchronous masterless replication allowing low latency operations for all clients.

Cassandra also places a high value on performance. In 2012, University of Toronto researchers studying NoSQL systems concluded that "In terms of scalability, there is a clear winner throughout our experiments. Cassandra achieves the highest throughput for the maximum number of nodes in all experiments" although "this comes at the price of high write and read latencies."

Pre Requirements

1) A machine with Ubuntu 14.04 LTS operating system installed.

2) Apache Cassandra 3.2 software (Download Here)

3) Apache Cassandra 3.2 version works with only Java 8. We need to install Java 8.

Cassandra Installation on Ubuntu 14.04

The following steps to install cassandra on your ubuntu machine.

Installation Steps

Step 1 - Installing java 8. Open a terminal (CTRL + ALT + T) and type the following sudo command.

$ sudo apt-get install openjdk-8-jdk

Check it installed properly or not.

$ java -version

Step 2 - Creating cassandra directory. Open a terminal (CTRL + ALT + T) and type the following sudo command.

$ sudo mkdir /usr/local/cassandra

Step 3 - Change the ownership and permissions of the directory /usr/local/cassandra. Here 'hduser' is an Ubuntu username.

$ sudo chown -R hduser /usr/local/cassandra

$ sudo chmod -R 755 /usr/local/cassandra

Step 4 - Change the directory to /home/hduser/Desktop , In my case the downloaded apache-cassandra-3.2-bin.tar.gz file is in /home/hduser/Desktop folder. For you it might be in /downloads folder check it.

$ cd /home/hduser/Desktop/

Step 5 - Untar the apache-cassandra-3.2-bin.tar.gz file.

$ tar xzf apache-cassandra-3.2-bin.tar.gz

Step 6 - Move the contents of apache-cassandra-3.2 folder to /usr/local/cassandra

$ mv apache-cassandra-3.2/* /usr/local/cassandra

Step 7 - Edit $HOME/.bashrc file by adding the java and cassandra path.

$ sudo gedit $HOME/.bashrc

$HOME/.bashrc file

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export CASSANDRA_HOME=/usr/local/cassandra

Step 8 - Reload your changed $HOME/.bashrc settings

$ source $HOME/.bashrc

Step 9 - Change the directory to /usr/local/cassandra


Step 10- Start cassandra as a foreground process.

$ ./bin/cassandra -f

Step 11- Entering into command line cqlsh shell.

$ ./bin/clqsh

Please share this blog post and follow me for latest updates on

facebook             google+             twitter             feedburner