How to install Apache Cassandra in Ubuntu 18.04 LTS

Cassandra is a free and open-source distributed NoSQL database used for managing voluminous amounts of data across multiple servers, while at the same time providing high availability and zero points of failure.

Apache Cassandra provides linear scale performance, fault tolerance, high availability and seamless data distribution across multiple servers and cloud availability zones. In this tutorial, you will learn how to install Apache Cassandra on Ubuntu 18.04 LTS.

Installing Apache Cassandra in Ubuntu 18.04 LTS

Let’s begin.

Step 1. Installing Oracle Java 11

To start off, install Java by following the simple commands outlined below.

Add the Oracle Java 11 PPA repository as shown below:

sudo add-apt-repository ppa:linuxuprising/java

Sample output

add oracle java 10 PPA

Next, update the software repositories:

sudo apt update

Sample output

update system repositories Ubuntu 18.04 LTS

After adding the Java PPA and updating the system, you can proceed to install Java by running the command below.

sudo apt install oracle-java11-set-default

Sample output

Install Oracle Java 11

Now you  can go ahead and verify the version of Java installed by running:

java --version

Output

checking java version

The output above is concrete proof that you have installed Java 11 on your system. Proceed to the next step.

Step 2. Adding Cassandra repository to the Ubuntu Source list

In this step, you will add Cassandra’s repository to Ubuntu’s sources list as shown in the command below:

echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a 
/etc/apt/sources.list.d/cassandra.sources.list

Output

add cassandra's repository to Ubuntu sources list

Step 3. Add Apache Cassandra’s repository Keys

Next, add Cassandra’s repository keys using the command below

curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -

Output

add Apache Cassandra repository keys

Step 4. Install Apache Cassandra

After appending Cassandra’s repository keys, update the system repositories for the changes to be registered.

sudo apt update

Run the command below to install Cassandra:

sudo apt install cassandra

Sample Output

install Cassandra on Ubuntu 18.04 LTS

To check if Cassandra is running execute:

systemctl status cassandra

Sample Output

systemctl status cassandra

Awesome! From the output above, we can clearly see that Cassandra is up and running.

Step 5. Connecting to  Apache Cassandra

With the installation of Cassandra on your system, a cluster is automatically set up with a single node as part of the cluster. To check if the cluster is running, execute:

sudo nodetool status

Sample Output

ATTACHMENT DETAILS sudo-nodetool-status.png February 12, 2019 16 KB 644 × 160 Edit Image URL https://cdn.fosslinux.com/wp-content/uploads/2019/02/07230119/sudo-nodetool-status.png

The UN in the output is a strong indicator that Cassandra is up and running. To connect to the Cassandra cluster run the following command:

cqlsh

Output

connect to Cassasndra

Great! Now you can proceed and execute your commands on this prompt.

Thank you for coming this far. Feel free to share and leave your feedback on this post.

James Kiarie
Hey! This is James, a tech enthusiast, and a certified Linux professional. I derive immense gratification in learning more about FOSS technologies more keeping tabs on the latest tools and features in several Linux distributions. Away from Linux, I love swimming, hiking and playing video games.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,533FansLike
366FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

Top 10 Reasons to use Xfce as your Desktop Environment

There are many choices for desktop environments for Linux based operating systems. Mainly, you can install any DE of your choice on most of the Linux based distributions, even if they are not offered as a package officially. In our recent articles, we discussed the best of KDE and Cinnamon. In this article, we wish to present to you the top reasons why you should consider Xfce as your desktop environment.

The 10 Best Linux Network Monitoring Tools

Having total control over your network is essential to prevent programs from overusing your network resources and slowing down the overall performance. This is why you should install a network monitoring tool on your system, giving you a visual overview of everything that's happening on your network. Networking Tools are like swiss-knife for the system administrators for troubleshooting system issues.

How to install CouchPotato on Ubuntu

Downloading movies and copying them over to your home server can get frustrating, especially if you are doing it daily! What if you have an option to download videos automatically, quickly, and above all with excellent quality. CouchPotato allows you to download movies easily once they are available and released automatically.

Top 20 Rsync Examples in Linux

The Rsync (remote sync) command is a Linux/Unix utility used to synchronize and copy files and directories either locally or remotely. Most Linux geeks use Rsync to mirror, backup or migrate data across folders, across disks and networks. One notable feature with the Rsync command is that it uses the "delta transfer algorithm."

Setting up NFS Server on Ubuntu Server

We have put together a detailed step-by-step tutorial that will guide you on how to install and set up NFS Server on Ubuntu so you too can start sharing data with other client systems. It is divided into sections, the first part discussing how to set up the host server and the second part showing you how to set up the client-side. For this tutorial, we will be using Ubuntu 20.04 LTS.

Crontab in Linux Explained With Examples

Crontab is the Linux equivalent of the Window's Task Scheduler. It can help you set up a task to run automatically at a regular...

MUST READ

Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

15 Tar command in Linux uses with examples

Tar is a famous utility that is basically used for collecting multiple files in a single archive. This file is often called a 'tarball'. Today, we are going to tell you about the different things you can do with tarballs using the tar command, with practical examples.

Beaker Browser: A P2P web browser you must try

I think we can all agree on the fact that the web browser is an integral part of our Linux systems, or any computer system, for that matter. We have had several fulfilling options for browsing the web, like Firefox, Brave, Vivaldi, Tor, etc. and they have worked pretty well, but also pretty much in the same way, except for Tor, which is much better for anonymity.

Ubuntu MATE 20.04 LTS Review: Refinement at its Best

Ubuntu MATE 20.04 LTS was released a week ago after two years of development. Official updates and security patches will be provided until April 2025. I have installed it on my test laptop for a spin and here are my observations based on almost a week usage.

13 ways to use the copy command in Linux (with examples)

Being a Linux user, copying files and directories is one of the everyday tasks that you have to carry out. It can be copying a file to make a backup or copy it to another partition, directory, or external storage drive.