Apache Cassandra is one of the most popular NoSQL databases. Though there are other versions of NoSQL that are available. But, why Apache Cassandra is popular? let’s have a look. Here we will see the features and installation of Apache Cassandra.
Introduction
Organizations handling a huge amount of unstructured data, preferring it. It is a java-based NoSQL database. Without a fixed schema, Cassandra is able to handle and manage a really huge data volume. It works with Peer to peer-based model, where each node is connected to all other nodes. Nodes have read-write permission, so no need for a master node. You can add endless nodes in the cluster.
Features
1. Peer-to-Peer Architecture
There is no master server dependency, all nodes treated equally here. There is no point in failure due to peer to peer and server model.
2. High Scalablity
Due to Read/Write throughput design. A new node or machine gets added in, without interrupting any running application or live operations.
3. Fault Tolerance
Each node has the same copy of data. Assume 5 nodes are there in the cluster and one of them stops working, that faulty node canbe removed quickly.
4. Flexible Data Storage
It can supports all kinds of data structured like- semi-structured, structured, and unstructured data formats.
5. Fast data storage and access
It can run on even cheap hardware structures, it can store a huge amount of data without sacrificing the speed of the data center.
Installation
Prerequisites:
- In this installation demonstration, we will be using Rocky Linux.
- Updated JAVA and YUM are required to get the configuration done.
Update System first:
# yum update
Install JAVA and python
# yum install java-1.8.0-openjdk
After the command run, check what version of JAVA installed.
# java -version
openjdk version "1.8.0_302"
OpenJDK Runtime Environment (build 1.8.0_302-b08)
OpenJDK 64-Bit Server VM (build 25.302-b08, mixed mode)
Now, let’s install the Cassandra repo to Server.
Create a new repo file for Cassandra, ammend the file as follows.
$ sudo vim /etc/yum.repos.d/cassandra.repo
[cassandra]
name=Apache Cassandra
baseurl=https://downloads.apache.org/cassandra/redhat/40x/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://downloads.apache.org/cassandra/KEYS
Install package.
$ sudo yum install cassandra -y
Change required settings for cluster.
The default cluster named as “Test Cluster” by default. You require to rename it. All configurations are stored in /etc/cassandra. All cluter data is stored in /var/lib/cassandra
Change cluster name, switch to command line.
# cqlsh
cqlsh> UPDATE system.local SET cluster_name = 'unixcop Cluster' WHERE KEY = 'local';
# service cassandra restart
Open cassandra.yaml, rename cluster name. Save file and exit.
# cd /etc/cassandra/default.conf
Open File and make required changed.
# vim cassandra.yaml
Restart the service and here we go.
Conclusion
Today, we have shown how to configure and rename Cassandra database. Though its one of the most popular NoSQL database, its doesn’t meat that will suit for all complicated database requirements. Initially, it was an open-source project, now a part of the Apache project.