Skip to main content
Skip table of contents

How to Install Apache Cassandra on Centos 7 Instance

Apache Cassandra is a NoSQL database management system which is free and open-source.

Before downloading Cassandra , you should update your system and install Java 8.

CODE
$ sudo yum update
$ wget --no-cookies --no-check-certificate --header "Cookie:oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm" 
$ yum -y localinstall jdk-8u131-linux-x64.rpm

To verify Java 8 is installed you can use:

CODE
$ java -version

After installing Java, you need to add Cassandra repository into your repository list by creating a new repository file nano /etc/yum.repos.d/cassandra.repo with following lines:

CODE
[cassandra]
name=Apache Cassandra
baseurl=https://www.apache.org/dist/cassandra/redhat/311x/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.apache.org/dist/cassandra/KEYS

You can now install Cassandra by running the following command:

CODE
$  yum install cassandra

After installation is completed, you should start cassandra service by:

CODE
$ sudo systemctl start cassandra

If you want Cassandra to automatically start at boot time you should enable it by using systemctl utility:

CODE
$ sudo systemctl enable cassandra

Verify that cassandra is running by invoking nodetool status from the command line.

CODE
$ nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens       Owns (effective)  Host ID                               Rack
UN  127.0.0.1  136.29 KiB  256         100.0%            2a0b7fa9-23c6-40d3-83a4-e6c06e2f5736  rack1

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.