YouTube Icon

Code Playground.

How to Install Apache Cassandra on CentOS 8

CFG

How to Install Apache Cassandra on CentOS 8

Apache Cassandra is a free and open-source NoSQL information base with no single purpose of disappointment. It gives straight adaptability and high accessibility without trading off execution. Apache Cassandra is utilized by numerous organizations that have enormous, dynamic informational indexes, including Reddit, NetFlix, Instagram, and Github. 

This article discloses how to introduce Apache Cassandra on CentOS 8. 

Installing Apache Cassandra

The least demanding approach to introduce Apache Cassandra on CentOS 8 is by introducing the rpm bundle from the official Apache Cassandra archive. 

The most recent rendition of Apache Cassandra is 3.11 and requires OpenJDK 8 to be introduced on the framework. 

Run the accompanying order as root or client with sudo benefits to introduce OpenJDK : 

sudo dnf install java-1.8.0-openjdk-devel

When finished, confirm the establishment by printing the Java adaptation : 

java -version

The yield should look something like this: 

openjdk version "1.8.0_262"
OpenJDK Runtime Environment (build 1.8.0_262-b10)
OpenJDK 64-Bit Server VM (build 25.262-b10, mixed mode)

Since Java is introduced, the following stage is to include the Apache Cassandra archive. 

Open your content tool and make the accompanying vault document: 

sudo nano /etc/yum.repos.d/cassandra.repo

Glue the accompanying substance into the record: 

/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

Spare the record and introduce the most recent adaptation of Apache Cassandra by composing: 

sudo dnf install cassandra

When incited, type y to import the GPG keys. 

When the establishment is finished, start and empower the Cassandra administration: 


sudo systemctl start cassandra
sudo systemctl enable cassandra

Confirm that Cassandra is running by composing: 

nodetool status

You should see something like this: 

Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (effective)  Host ID                               Rack
UN  127.0.0.1  69.99 KiB  256     100.0%            ce0389a3-b48c-4cc9-b594-abe23e677d33  rack1

That is it. Now, you have Apache Cassandra introduced on your CentOS worker. 

Configuring Apache Cassandra

Apache Cassandra information is put away in the/var/lib/cassandra registry, arrangement records are situated in/and so forth/cassandra and Java fire up alternatives can be designed in the/and so on/default/cassandra document. 

As a matter of course, Cassandra is designed to tune in on localhost as it were. In the event that the customer associating with the information base is additionally running on a similar host, you don't have to change the default setup document. 

To associate with Cassandra through CQL (the Cassandra Query Language), you can utilize an order line utility named cqlsh that is sent with the Cassandra bundle. 

cqlsh requires Python 2 to be in the framework's PATH . On the off chance that you don't have Python 2 introduced on the worker, you can do it with the accompanying orders: 

sudo dnf install python2
sudo alternatives --set python /usr/bin/python2

When python is set up, run cqlsh to get to the CQL shell: 

cqlsh
[cqlsh 5.0.1 | Cassandra 3.11.7 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh> 

Renaming Apache Cassandra Cluster 

As a matter of course, the Cassandra group is named "Test Cluster". On the off chance that you need to change the group name, follow the means underneath: 

Login to the Cassandra CQL terminal with cqlsh: 

cqlsh

The accompanying order will change the group name to "Linuxize Cluster": 

UPDATE system.local SET cluster_name = 'Linuxize Cluster' WHERE KEY = 'local';

Supplant "Linuxize Cluster" with your ideal name. When done, type exit to leave the support. 

Open the cassandra.yaml arrangement record, look for "cluster_name" and enter your new group name: 

sudo nano /etc/cassandra/default.conf/cassandra.yaml
/etc/cassandra/default.conf/cassandra.yaml
cluster_name: 'Linuxize Cluster'

Clear the framework reserve: 

sudo systemctl restart cassandra

At last restart the Cassandra administration: 

We've told you the best way to introduce Apache Cassandra on CentOS 8. You would now be able to visit the official Apache Cassandra Documentation page and figure out how to begin with Cassandra. 

On the off chance that you hit an issue or have input, leave a remark beneath.




CFG