how to install apache cassandra on ubuntu 20.04

3
(1)

First, we must connect via ssh.

Add the Cassandra Repository File

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

Add the GPG Key

To avoid problems with the repository, add the GPG key and increase the security of the repository.

Then we can add the key with the following command:

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

Install Cassandra on Ubuntu

sudo apt update
sudo apt install cassandra

Verify Apache Cassandra Installation
Finally, to make sure the Cassandra installation process completed properly, check cluster status:

nodetool status

The UN letters in the output signal that the cluster is working.
You can also check Cassandra status by entering:
sudo systemctl status cassandra

The output should display active (running) in green.

Optional: Start Apache Cassandra Service Automatically on Boot

When you turn off or reboot your system, the Cassandra service switches to inactive.

To start Cassandra automatically after booting up, use the following command:

sudo systemctl enable cassandra

Test Cassandra Command-Line Shell

The Cassandra software package comes with its command-line tool (CLI). This tool uses Cassandra Query Language (CQL) for communication.

To start a new shell, open the terminal and type:

csqlsh

Conclusion

By following these simple steps, you should have a working Cassandra installation on your Ubuntu system.

Additionally, we showed you how to edit the most important parameters in the Cassandra configuration file. Remember to make a backup of the conf file, just in case, and you can start using the Cassandra database software.

Similar Posts:

525

How useful was this post?

Click on a star to rate it!

Average rating 3 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top