Apache Cassandra is a high-performance opensource NoSQL database engine that gives fault tolerance, linear scalability, and consistency throughout a number of nodes. Give its distributed structure, Apache Cassandra handles large volumes of information with dynamo-style replication. That is the place replicas are saved on a number of nodes in a cluster thus offering excessive availability and 0 factors of failure.
Apache Cassandra is good in IoT purposes the place huge knowledge is collected. It additionally turns out to be useful in social media analytics, messaging companies, and retail purposes.
Among the many firms that make use of Apache Cassandra embody Netflix, Fb, Cisco, Hulu, Twitter, and lots of extra.
On this article, you’ll discover ways to set up and configure Apache Cassandra on Ubuntu 20.04 and Ubuntu 18.04.
Step 1: Putting in Java on Ubuntu
Set up of Apache Cassandra begins with checking whether or not Java is put in. To be extra particular, OpenJDK is what’s required to work seamlessly with Apache Cassandra. Putting in a distinct model is extra possible to provide you errors throughout configuration.
To test whether or not Java is put in, run the command:
$ java -version
If Java shouldn’t be but put in, you will see that the output printed as proven in your terminal.
Test Java Set up on Ubuntu
To put in OpenJDK, execute the next apt command.
$ sudo apt set up openjdk-8-jdk
As soon as once more, affirm that Java is put in by operating the command.
$ java -version
Test Java Model in Ubuntu
Step 2: Set up Apache Cassandra in Ubuntu
With Java put in, we are going to proceed to put in Apache Cassandra. First, set up the apt-transport-https bundle to permit entry of repositories by way of the https protocol.
$ sudo apt set up apt-transport-https
Subsequent, Import the GPG key utilizing following wget command as proven.
$ wget -q -O – https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add –
Then add Apache Cassandra’s repository to the system’s sources listing file as proven.
$ sudo sh -c ‘echo “deb http://www.apache.org/dist/cassandra/debian 311x important” > /and so forth/apt/sources.listing.d/cassandra.listing’
Earlier than putting in Apache Cassandra, that you must replace the bundle listing first.
$ sudo apt replace
Then set up the NoSQL database utilizing the command:
$ sudo apt set up cassandra
Set up Apache Cassandra in Ubuntu
Often, Apache Cassandra begins mechanically. To substantiate its standing, run the next command:
$ sudo systemctl standing cassandra
The output beneath confirms that Cassandra is up and operating as anticipated.
Test Apache Cassandra Standing
Moreover, you’ll be able to confirm the stats of your node by operating the command.
$ sudo nodetool standing
Test Node Software Standing
To log in to Cassandra on the terminal, invoke the command.
Begin Cassandra cqlsh Shell
Step 3: Configuring Apache Cassandra in Ubuntu
Apache Cassandra configuration recordsdata are stacked within the /and so forth/cassandra listing while knowledge is saved in /var/lib/cassandra listing. Begin-up choices could be tweaked within the /and so forth/default/cassandra file.
Cassandra’s default cluster identify is ‘Check Cluster’. To alter this to a extra significant identify, log in to Cassandra.
To set the Cluster identify to your individual choice, run the command proven beneath. On this case, we’re setting the cluster identify to ‘Tecmint Cluster‘
UPDATE system.native SET cluster_name = ‘Tecmint Cluster’ WHERE KEY = ‘native’;
Exit the immediate by typing:
Thereafter, head out to the cassandra.yaml file as proven:
$ sudo vim /and so forth/cassandra/cassandra.yaml
Seek for the cluster_name directive and edit the cluster identify accordingly as proven beneath.
Set Cassandra Cluster Title
Save and exit the configuration file and restart the Cassandra service. You’ll be able to log in once more to verify the cluster identify as proven.
Verify Cassandra Cluster Title
And that concludes the subject on the set up of Apache Cassandra on Ubuntu 20.04 LTS.
If You Admire What We Do Right here On TecMint, You Ought to Contemplate:
TecMint is the quickest rising and most trusted group website for any sort of Linux Articles, Guides and Books on the internet. Hundreds of thousands of individuals go to TecMint! to look or browse the 1000’s of revealed articles accessible FREELY to all.
Should you like what you might be studying, please contemplate shopping for us a espresso ( or 2 ) as a token of appreciation.
We’re grateful to your by no means ending assist.