How to Install Apache Cassandra on Ubuntu 16.04
How to install Apache Cassandra on a Ubuntu 16.04, with easy. Apache Cassandra is a NoSQL database management system which is free and open-source. It allows managing large amounts of data with high availability without compromising the performance. Installing Apache Cassandra on a Ubuntu 16.04 is an easy task, just follow the steps bellow and you should have it done in few minutes.
01. Apache Cassandra Prerequisites
Before installing Apache Cassandra on your server make sure that the following prerequisites are met:
– The latest version of Java 8, either the Oracle Java Standard Edition 8 or OpenJDK 8 is installed. If not, you can follow the instructions in this tutorial and we will show you how to install Java 8 on your Ubuntu VPS too.
– If you are going to use
cqlsh, make sure that the latest version of Python 2.7 is installed on your server.
02. Updating the Software on Ubuntu 16.04
First of all, connect to your Linux server via SSH, update the package index and upgrade all your installed software to the latest version available. You can do that by using the following commands:
sudo apt-get update sudo apt-get upgrade
03. Install Java 8 on Ubuntu 16.04
To install Java 8 on your Ubuntu 16.04 VPS run the following command:
sudo apt-get install default-jdk
To verify that Java 8 is installed you can use:
The output should be very similar to the one below:
openjdk version "1.8.0_131" OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11) OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
04. Install Apache Cassandra on Ubuntu 16.04
To install Apache Cassandra on your server, first you need to add the Cassandra repository. At the moment of writing this tutorial, the latest stable release of Cassandra is 3.11.0. Therefore, run the following command to add the Cassandra repository on your server:
echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
Next, add the Cassandra repository keys:
curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add - sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key A278B781FE4B2BDA
Update the package index:
sudo apt-get update
Finally, install Apache Cassandra using the following command:
sudo apt-get install cassandra
05. Start, Stop and Enable Apache Cassandra on Ubuntu 16.04
To start the Apache Cassandra service on your server, you can use the following command:
sudo systemctl start cassandra.service
To stop the service, you can use the command below:
sudo systemctl stop cassandra.service
If the service is not already enabled on system boot, you can enable it by using the command below:
sudo systemctl enable cassandra.service
06. What’s Next?
If you are new to Apache Cassandra it is recommended to use the official documentation as a starting point. The documentation is available at http://cassandra.apache.org/doc/latest/ and will help you to learn how to configure and use the service for your projects.
Of course, you don’t have to install Apache Cassandra on a Ubuntu 16.04 yourself, if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install Apache Cassandra on a Ubuntu 16.04 on your server 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.