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.
$ 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
CODE
To verify Java 8 is installed you can use:
$ java -version
CODE
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:
[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
CODE
You can now install Cassandra by running the following command:
$ yum install cassandra
CODE
After installation is completed, you should start cassandra service by:
$ sudo systemctl start cassandra
CODE
If you want Cassandra to automatically start at boot time you should enable it by using systemctl utility:
$ sudo systemctl enable cassandra
CODE
Verify that cassandra is running by invoking nodetool status from the command line.
$ 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
CODE