How to Install Apache Cassandra on CentOS 8

Install Apache Cassandra on CentOS 8

In this article, we will have explained the necessary steps to install and configure Apache Cassandra on CentOS 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Apache Cassandrais a highly scalable database management systemthat used to manage very large amounts of structured data. It can able to perform on multi-node setups. The Cassandrasupports relational databases including MySQL, PostgreSQLand Microsoft SQL. DataStax offers a free packaged distribution of Apache Cassandra. This also includes various other tools such as a Windows Installer, DevCenter, and the DataStax professional documentation.

Install Apache Cassandra on CentOS 8

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo dnf install epel-release
sudo dnf update

Step 2. Install Java.

Cassandra requires that the latest version of Java. If you don’t have Java installed, you can check out our guide on installing Java on CentOS 8.

Step 2. Download and Install Apache Cassandra on the CentOS system.

Now we add the Apache Cassandra repository:

sudo nano /etc/yum.repos.d/cassandra.repo
[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

Save the file and install Apache Cassandra by issuing the command below:

sudo dnf install cassandra

After successfully installing, issue the command to start the Cassandra service and allow it to start on boot:

sudo systemctl start cassandra
sudo systemctl enable cassandra

Verify that Cassandra using the following command:

$ nodetool status

Datacenter: datacenter-linuxtips
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (effective)  Host ID                               Rack
UN  127.0.0.1  46.01 KiB  256     100.0%            ce0389a3-b48c-gemb4-b59mae4-kimp01  rack1

Congratulation, you have learned how to install and configure Apache Cassandra on CentOS 8. If you have any question, please leave a comment below.