Installation of Cassandra-3.0.14 in Ubuntu Machine


Below are the steps to install Cassandra-3.0.14 in Ubuntu Machine

1.) First, goto a Location where you would like to install Cassandra,

  userName@hostName:/$ cd /home/userName/softwares

2.) Get the Cassandra tar file using 'wget' command

 userName@hostName:~/softwares$wget 'http://redrockdigimark.com/apachemirror/cassandra/3.0.14/apache-cassandra-3.0.14-bin.tar.gz'

3.) Untar the downloaded Cassandra tar file by using below command

userName@hostName:~/softwares$ tar -xvzf apache-cassandra-3.0.14-bin.tar.gz

4.) Set the path of Cassandra in bashrc file

userName@hostName:~/softwares$ vi ~/.bashrc
export CASSANDRA_HOME=/home/userName/softwares/apache-cassandra-3.0.14
export PATH=$PATH:$JAVA_HOME/bin:$CASSANDRA_HOME/bin

5.) Create two directories, one in /var/lib folder and other in /var/log folder which will be used by Cassandra to write its log and other data as shown below

userName@hostName:~/softwares$ mkdir /var/lib/cassandra
userName@hostName:~/softwares$ mkdir /var/log/cassandra

Provide full permissions to these two files as shown below

userName@hostName:~/softwares$ chmod 777 -R  /var/lib/cassandra
userName@hostName:~/softwares$ chmod 777 -R  /var/log/cassandra

6,) Open cassandra.yaml file present in conf folder, Change the rpc_address to point to the machine's IP or hostname instead of 0.0.0.0/localhost. By default the start_rpc is set to false in the cassandra.yaml file. Set it to start_rpc: true

userName@hostName:~/softwares$ cd  apache-cassandra-3.0.14/conf

userName@hostName:~/softwares/apache-cassandra-3.0.14/conf$ vi cassandra.yaml
rpc_address: hostName
start_rpc: true

7.) Start the Cassandra Server

userName@hostName:~/softwares/apache-cassandra-3.0.14/bin$
./cassandra -f

If wanted, We can also start Cassandra Server with root user with ./cassandra -R -f command

8.) Open new Terminal and provide below command

 userName@hostName:~/softwares/apache-cassandra-3.0.14/bin$ cqlsh  hostName