• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Install Apache Cassandra on Ubuntu 22.04

Written by Admin, Updated On January 10, 2023
apache, cassandra, database, java, ubuntu
How to Install Apache Cassandra on Ubuntu 22.04

Apache Cassandra is a free and open-source NoSQL database system which includes high availability and non-compromising performance. It is using by many large companies like Github, NetFlix, Reddit and Instagram. In this tutorial we will show you how to install Apache Cassandra on Ubuntu 22.04.

Prerequisites#

  • Make sure you are login in as root or user with sudo privileges.

Perform the following steps to install Apache Cassandra on Ubuntu 22.04 system:

Step 1 – Installing Java#

It’s required to have Java installed on your system before installing Apache Cassandra. So first we will install OpenJDK by running following command. You can skip this step if your system already Java installed.

sudo apt update
sudo apt install default-jdk -y

Once the process completed, verify the Java installation by typing:

java -version

The output should look something like this:

openjdk version "11.0.17"

Step 2 – Import GPG Key & Add Repository#

Next, you need to add repository for the Apache Cassandra using wget and import the GPG key to the system:

wget -q -O - https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
sudo sh -c 'echo "deb http://www.apache.org/dist/cassandra/debian 311x main" > /etc/apt/sources.list.d/cassandra.list'

It will not show anything in output.

Step 3 – Install Apache Cassandra#

You are now ready to install Cassandra on Ubuntu.

Update the repository package list:

sudo apt update

To proceed ahead, run the following command to install Apache Cassandra:

sudo apt install Cassandra

Apache Cassandra service will automatically start after the installation process is complete.

Step 4 – Verify Installation#

You can check Cassandra installation by issuing below given command:

sudo systemctl status cassandra

Output should show something like below:

● cassandra.service - LSB: distributed storage system for structured data
     Loaded: loaded (/etc/init.d/cassandra; generated)
     Active: active (running) since Tue 2022-12-03 03:25:52 UTC; 15min 25s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 9502 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)
      Tasks: 52 (limit: 4495)

That’s it. At this step, Apache Cassandra is installed on your Ubuntu server.

Step 5 – Connecting to Cluster#

You need to use nodetool to connect the clusterIt. To check the cluster’s status type:

sudo nodetool status

It will show output as following:

Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (effective)  Host ID                               Rack 
UN  127.0

In the output, UN means it’s Up and Normal.

Then connect to the cluster using its interactive command line interface cqlsh:

cqlsh
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.0.0 | Cassandra 4.0.4 | CQL spec 3.4.5 | Native protocol v5]
Use HELP for help.

Type exit to quit.

exit

Conclusion#

You have successfully installed Apache Cassandra on Ubuntu 22.04. To learn more about Cassandra, visit the official Apache Cassandra Documentation page.

If you have a problem or suggestion, please leave a comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install CouchDB on Debian 11
Next Article   How to Install and Configure Fail2ban on Debian 11

Related Posts

  • How to Install and Use PHP Composer on Ubuntu 22.04

    How to Install Composer on Ubuntu 22.04

    January 31, 2023
  • How to Install Nginx on Ubuntu 22.04

    How to Install Nginx on Ubuntu 22.04

    January 28, 2023
  • How to Install Puppet Agent on Ubuntu 22.04

    How to Install Puppet Agent on Ubuntu 22.04

    January 22, 2023

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install SSH Keys on Ubuntu 22.04
    How to Set up SSH Keys on Ubuntu 22.04 January 7, 2023
  • How to Install Mongodb on Debian 11
    How to Install MongoDB on Debian 11 Linux January 11, 2023
  • How to Install Puppet Agent on Ubuntu 22.04
    How to Install Puppet Agent on Ubuntu 22.04 January 22, 2023
  • How to Install Jenkins on Debian 11
    How to Install Jenkins on Debian 11 January 5, 2023
  • How to Change-Hostname Ubuntu 22.04
    How to Change Hostname on Ubuntu 22.04 January 19, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook