Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Apache Cassandra on Ubuntu 22.04 - DesignLinux

Dec 03 2022
designlinux 0 Comments
how-to-install-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.

Related

Tags: apache, cassandra, database, java, ubuntu

How to Install CouchDB on Debian 11

Prev Post

How to Install and Configure Fail2ban on Debian 11

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 502
  • 1,055,274

DesignLinux.com © All rights reserved

Go to mobile version