Install Cassandra on Linux CentOS

Download the newest version of Cassandra

I wrote this tutorial using this version:


$ wget
$ tar -zxvf apache-cassandra-2.0.2-bin.tar.gz
$ sudo cp -r apache-cassandra-2.0.2 /usr/local
$ cd /usr/local/apache-cassandra-2.0.2/config

Open the file:

$ vim cassandra.yaml

Check the folders in environment variables inside the file:


Now, create the respective folders:

$ sudo mkdir -p /var/lib/cassandra/data
$ sudo mkdir -p /var/lib/cassandra/commitlog
$ sudo mkdir -p /var/lib/cassandra/saved_caches
$ sudo mkdir -p /var/log/cassandra

To allow the users, execute the following commands:

Current user:

$ sudo chown -R $USER:$GROUP /var/lib/cassandra
$ sudo chown -R $USER:$GROUP /var/log/cassandra

Or a specific user:

$ sudo chown -R userx:user-groupx /var/log/cassandra/
$ sudo chown -R userx:user-groupx /var/lib/cassandra/

In order to configure Cassandra to accept connections from others computers change the file:

/usr/local/apache-cassandra-2.0.2/conf/cassandra.yaml at the variable rpc_address change localhost to

Start Cassandra in the Foreground (Testing environment)

$ /usr/local/apache-cassandra-2.0.2/bin/cassandra -f

Start Cassandra in the Background

$ /usr/local/apache-cassandra-2.0.2/bin/cassandra

To kill the process:

$ pkill -f CassandraDaemon

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s