
Apache Cassandra is a NoSQL database used for storing large amounts of data. It has a distributed architecture and is designed to manage large volumes of data with dynamic replication. It is used by thousands of companies to save and retrieve thousands of terabytes of data. Apache Cassandra is the best choice for you if you are looking for a database management system with scalability and high availability.
In this tutorial, we will go through the installation of Apache Cassandra on Ubuntu 20.04.
Table of Contents
Prerequisites
- An Ubuntu 20.04 VPS (we’ll be using our SSD 2 VPS plan)
- Access to the root user account (or access to an admin account with root privileges)
Step 1: Log in to the Server & Update the Server OS Packages
First, log in to your Ubuntu 20.04 server via SSH as the root user:
You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.
Before starting, you have to make sure that all Ubuntu OS packages installed on the server are up to date. You can do this by running the following commands:
Step 2: Install Java
Apache Cassandra requires Java version 8 to be installed in your system. You can install it using the following command:
Once the installation is completed, verify the installed version of Java with the following command:
You should get the following output:
Step 3: Install Apache Cassandra
By default, the Apache Cassandra is not available in the Ubuntu default repository. So you will need to add the Cassandra repository to your system.
First, install the required dependencies with the following command:
Next, download and add the GPG key with the following command:
Next, add the Cassandra repository to the APT with the following command:
Next, update the repository cache and install the Apache Cassandra with the following command:
Once the Cassandra has been installed, verify the status of the Cassandra with the following command:
You should get the following output:
You can also verify the Cassandra using the nodetool command-line utility:
You should get the following output:
Step 4: Configure Apache Cassandra
By default, Apache Cassandra is configured to listen on localhost. You don’t need to configure Cassandra if your client and database is on the same host.
Cassandra also provides a cqlsh command-line tool to interact with Cassandra. You can launch it with the following command:
You should get the following output:
Step 5: Change Cassandra Cluster Name
By default, the Cassandra cluster name is set to “Test Cluster”. You can change it using the the cqlsh utility:
Once connected, run the following command to change the cluster name:
Next, exit from the cqlsh shell with the following command:
Next, you will also need to define your new cluster name in cassandra.yaml file:
Change the following line:
Save and close the file then clear the system cache with the following command:
Next, restart the Cassandra service to apply the changes:
Next, verify your new cluster name with the following command:
You should see your new cluster name in the following output:
Use HELP for help. cqlsh>
Congratulations! you have successfully installed Apache Cassandra on Ubuntu 20.04 VPS.
Of course, you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.
yes you are right…To start with Apache Cassandra vs Datastax Cassandra, let’s have a look at them first! Apache Cassandra can be defined as a distributed DBMS(Database Management System) that is designed to handle vast volumes of data across many data centers and the cloud
I want to install cassandra 3.11.6 how can I