Illustration Image

11/4/2022

Reading time:3

Installing Apache Cassandra on Ubuntu 20.04

logo

This resource is based on an article originally published here.

Cassandra is used by thousands of firms worldwide to save and retrieve thousands of terabytes of data in an environment that is both painstakingly detailed yet easily accessible. Its reliability, along with its high fault tolerance, has earned the reputation it holds today. The DB Engine Ranking puts Cassandra at the top of their wide column store ranking.

In this tutorial, you’ll learn how to set up Apache Cassandra, one of the best NoSQL databases systems that is both free and open-source, which offers high linear scalability, along with low latency operability. It was originally conceived to support the inbox search feature on Facebook and has since improved until it was hailed as the most time-efficient and scalable distribution database.

Step 1: Install Oracle JAVA

First, we need to set up JAVA on your system since Cassandra requires Oracle JAVA to operate on any OS. This step is just a simple setup guide, so readers with already installed Java may skip step 1.

To illustrate how to set up Java on desktop, we will be downloading the latest version of its open-source platform: OpenJDK 14. This open-source version works with Cassandra just as well as any paid version, so it should suffice.

Type in the following command to update the repository:

$ sudo apt update


Then, run the command below to install OpenJDK 14:

$ sudo apt install openjdk-14-jdk


OpenJDK 14 should launch automatically upon install. To verify the install, type:

$ java -version

This should be displayed in the following output:


With Java installed, you can download the latest version of Apache Cassandra from its official website. However, in this demonstration, we’ll use the official Apache repository by adding it to the local software repository.

Step 2: Installing Apache Cassandra

The following steps show the details on how to download Apache Cassandra by adding its official repository. This particular method might prove useful in cases where you’re unable to download it from the official website.

Type in the commands below to fetch the repository’s GPG key:

$ wet -q -O - https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add --


Then, use the command below to add the repository:

$ sudo sh -c 'echo "deb http://www.apache.org/dist/cassandra/debian 311x main" \
> /etc/apt/sources.list.d/cassandra.sources.list'

Step 3: Install Apache Cassandra

Type in the commands to begin installation:

$ sudo apt update

$ sudo apt install cassandra


This should install Cassandra on your Ubuntu desktop. Then, verify the installation by typing in the following commands in the terminal:

$ nodetool status


If the output says Normal/Leaving/Joining/Moving, we’re all good.

Cqlsh is a CLI interface with which you can interact with the Cassandra Query Language.

Wrapping up

I hope the instructions listed above helped you set up Apache Cassandra on your Ubuntu desktop. Apache Cassandra needs Oracle Java to function and the open-source implementation of Java, the OpenJDK works just fine with Cassandra. The method used in this tutorial first added the Apache repository to the Ubuntu software repo, then installed the database.

What makes Cassandra, in particular, a stand out compared to other database systems is the high-volume data capacity that it offers, as well as its extremely low latency operations. The fact that so many large conglomerates use this database system, including Apple, Facebook, Instagram, Spotify, Twitter, eBay, and Netflix, speaks to its utility as a reliable data management platform.

I am a freelancing software project developer, a software engineering graduate and a content writer. I love working with Linux and open-source software.

Related Articles

Placeholder
cassandra
ubuntu

Explore Further

cassandra

ubuntu

linux

Become part of our
growing community!
Welcome to Planet Cassandra, a community for Apache Cassandra®! We're a passionate and dedicated group of users, developers, and enthusiasts who are working together to make Cassandra the best it can be. Whether you're just getting started with Cassandra or you're an experienced user, there's a place for you in our community.
A dinosaur
Planet Cassandra is a service for the Apache Cassandra® user community to share with each other. From tutorials and guides, to discussions and updates, we're here to help you get the most out of Cassandra. Connect with us and become part of our growing community today.
© 2009-2023 The Apache Software Foundation under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation. Sponsored by Anant Corporation and Datastax, and Developed by Anant Corporation.

Get Involved with Planet Cassandra!

We believe that the power of the Planet Cassandra community lies in the contributions of its members. Do you have content, articles, videos, or use cases you want to share with the world?