In this article, we will have explained the necessary steps to install and configure Apache Cassandra on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.
Apache Cassandra is a highly scalable database management system that used to manage very large amounts of structured data. It can able to perform on multi-node setups. The Cassandra supports relational databases including MySQL, PostgreSQL and Microsoft SQL and Cassandra is used by a number of organizations including Apple, NetFlix, eBay, and Easou.
Install Apache Cassandra on Ubuntu
Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.
Step 2. Install Java.
Install the Java package by typing:
Verify the Java installation by running the following command which will print the Java version:
Step 2. Install Apache Cassandra.
Now, add the Apache Cassandra repository:
sudosh-c'echo "deb http://www.apache.org/dist/cassandra/debian 311x main" > /etc/apt/sources.list.d/cassandra.list'
Import the repository’s GPG using the following command:
wget-q-O-https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
Then, we can install Cassandra by running the following command:
You can verify that Cassandra is running by typing:
-- Address Load Tokens Owns(effective) HostID Rack
UN 127.0.0.1 156.55KiB 456 100.0% d8c27e24-e46-4eeb-883c-5986218ba3ca rack1
Step 3. Configuring Apache Cassandra.
Apache Cassandra data is stored in the /var/lib/cassandra directory, configuration files are located in /etc/cassandra and Java start-up options can be configured in the /etc/default/cassandra file.
To interact with Cassandra through CQL (the Cassandra Query Language) you can use a command line utility named cqlsh that is shipped with the Cassandra package: