One of the NoSQL database managers available on the market is Cassandra, which comes from the Apache Foundation. Even though NoSQL database managers like Cassandra aren’t as popular as other SQL database managers, they nevertheless have a strong point of differentiation: scalability.
Step 1: Access server with SSH
Similar to any other installations made for any Linux distribution, it is important to access your server using SSH.
Step 2: Add Cassandra repository file
After accessing the server through SSH, the Cassandra repository will need to be added to the server’s repository file. To achieve that, run the following command line.
echo “deb http://www.apache.org/dist/cassandra/debian 40x main” | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
Step 3: Add GPG Key
First, install curl if curl isn’t installed in the system yet. To install curl, run the following command.
sudo apt install curl
The reason for installing curl is to avoid any issues with the repository when adding the GPG key. It also helps in securing the repository. The next step is to add the key, and to do so, use the curl command below to achieve it.
curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add –
Step 4: Installation
To install Cassandra, we would first need to refresh our repositories and update them by using the following command.
sudo apt update
To start the Cassandra installation after updating, run this.
sudo apt install cassandra
Step 5: Start Cassandra
After the installation, in order for Cassandra to start automatically on system boot, the Cassandra service needs to be enabled by using the following command.
sudo systemctl enable cassandra
Should you prefer to start Cassandra manually, this is the command for it.
sudo systemctl start cassandra
Step 6: Verifying
Finally, verify if Cassandra is installed correctly or not. Run the following command to check the status of the services.
sudo systemctl status cassandra
With this, the installation for Cassandra on Ubuntu 18.04 is completed. If any error persists, do refer to the earlier steps to check if any steps were missed.