Uchechukwu Onyekwuluje's Knowledge & Brain Dumps

Cassandra 4.x Setup

Cassandra is an open-source, distributed, wide column store, NoSQL database management system. It is designed to handle large amounts of data across compute resource or servers. It provides high availability with no single point of failure. It offers robust support for clusters spanning multiple datacenters with asynchronous masterless replication allowing low latency operations for all clients.

This post is geared at a base installation of Apache Cassandra 4.x in one of two modes:

Systems Requirement for clustered/multi node setup

Hosts Systems Specification
cassandra01 2 CPU 4GB RAM 40GB Storage
cassandra02 2 CPU 4GB RAM 40GB Storage
cassandra03 2 CPU 4GB RAM 40GB Storage

Systems Requirement for standalone node setup

Hosts Systems Specification
cassandra 2 CPU 4GB RAM 40GB Storage

NOTE: You can make changes as needed. The above is just a base systems spec. for our POC

Package Installation

We will be running our setup on CentOS based servers. Run this command on all servers

sudo yum update -y
sudo yum group install -y 'Development Tools'
sudo yum install -y libxml2 libxml2-devel libxslt libxslt-devel wget gcc libffi-devel \
openssl-devel make openssl-devel bzip2-devel java-11-openjdk-devel java-11-openjdk 

Configure Cassandra Repository

sudo bash -c 'cat <<EOF>> /etc/yum.repos.d/cassandra.repo
[cassandra]  
name=Apache Cassandra
baseurl=https://www.apache.org/dist/cassandra/redhat/40x/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.apache.org/dist/cassandra/KEYS
EOF'

Install Cassandra

sudo yum update -y && sudo yum install -y cassandra

Enable and start cassandra services

sudo systemctl enable cassandra 
sudo systemctl start cassandra

Test out installation by running this command nodetool status. if all goes well, you should see this:

Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (effective)  Host ID                               Rack 
UN  127.0.0.1  73.28 KiB  256     ?                 74aed20b-6a72-4b88-9d55-997aa8e00283  rack1

At this point you should be all set for the standalone setup



Multi Node Cassandra Setup

The following steps outlines base configs and updates for a multi node clister setup

Reference