Installing Cassandra on Ubuntu

Installing Cassandra on Ubuntu

Instructor-svgAl-Mamun Sarkar
Sep 18 , 2020

Cassandra has been written using the java programming language. For installing Cassandra you have to install Java first. 

Install Open JDK 8:

sudo apt install openjdk-8-jre-headless

Adding Java Path to .bashrc:

sudo vim ~/.bashrc

Paste the following line on .bashrc: 

JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

Run this command to activate latest change of .bashrc:

source ~/.bashrc

Check Java Version:

java -version

 

Install CURL:

sudo apt install curl

 

Installing Cassandra:

Adding the Apache Repository of Cassandra to cassandra.sources.list:

echo "deb http://downloads.apache.org/cassandra/debian 40x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list

Add repository key:

curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add -

Refresh packages:

sudo apt-get update

Install Cassandra:

sudo apt-get install cassandra

For monitoring status:

tail -f /var/log/cassandra/system.log

Check Cassandra status:

sudo service cassandra status
or
sudo systemctl status cassandra

Start Cassandra server:

sudo service cassandra start
or
sudo systemctl start cassandra

Stop Cassandra server:

sudo service cassandra stop
or
sudo systemctl stop cassandra

Restart Cassandra server:

sudo service cassandra restart
or 
sudo systemctl restart cassandra

Check Cassandra Configuration:

nodetool status

Run Cassandra cqlsh make sure that python is installed on your computer:

cqlsh

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram