Last Updated: February 25, 2016
·
1.523K
· vidyasagar

Cassandra Installation on Linux Machine

In order to Install Cassandra , go to the path

Step 1: cd /usr/local/hadoop

Step 2: Download the TAR file from the archive.cloudera.com

sudo wget  http://apache.mirrors.pair.com/cassandra/1.2.11/apache-cassandra-1.2.11-bin.tar.gz

Step 3: Extract the tar file

tar -zxvf apache-cassandra-1.2.11-bin.tar.gz

Step 4: Create the below folders

$ mkdir /var/lib/cassandra/data
$ mkdir /var/lib/cassandra/commitlog

Step 5: Give the permissions to the above created directories.

Step 6: Write Configuration values in Cassandra.yaml file

Current Path : apache-cassandra-1.2.11/conf/cassandra.ymal. Add this to the file
"<ip1>,<ip2>,<ip3>" - seeds: "List you Ip Address"
listenaddress: Enter IP address
rpc
address: 0.0.0.0 /* This is to connect the Cassandra with the web service */

Step 4: Run Cassandra using below command

$ Cassandra

Step 5: Debugging

• If you get the following error :
“xss = -ea -javaagent:/usr/local/hadoop/apache-cassandra-1.2.11-src/lib/jamm-0.2.5.jar -XX:+UseThreadPriorities - XX:ThreadPriorityPolicy=42 -Xms242M -Xmx242M -Xmn60M -XX:+HeapDumpOnOutOfMemoryError -Xss180k”

• Go to apache-cassandra-1.2.11/conf/Cassandra-env.sh from the extracted file and do the following modifications
Change the value of JVMOPTS="$JVMOPTS –Xss180k" to JVMOPTS="$JVMOPTS -Xss280k"

• Now check whether the CassandraDaemon is running in the jps or not if running you
Cassandra has been started

Step 6: Now you can write the queries in the CQLSH shell to go to that shell run the following command

$ cqlsh