Swiftorial Logo
Home
Swift Lessons
Matchups
CodeSnaps
Tutorials
Career
Resources

On-Premise Deployment of Cassandra

Introduction

On-premise deployment refers to the process of installing and running software applications on local servers, as opposed to using cloud-based services. In this tutorial, we will focus on deploying Apache Cassandra, a highly scalable NoSQL database, in an on-premise environment. Understanding on-premise deployment is critical for organizations that require complete control over their data and infrastructure.

System Requirements

Before you begin the deployment of Cassandra, ensure that your system meets the following requirements:

  • Operating System: Linux (Ubuntu, CentOS, etc.) or Windows
  • Java: JDK 8 or later installed
  • Memory: Minimum of 4GB RAM (8GB recommended)
  • Disk Space: At least 10GB free disk space
  • Network: Properly configured network settings

Installation Steps

Follow these steps to install Cassandra on your on-premise server:

Step 1: Install Java

Cassandra requires Java to run. You can install OpenJDK using the following commands:

sudo apt-get update
sudo apt-get install openjdk-8-jdk

Verify the installation:

java -version

Step 2: Download Cassandra

Download the latest version of Cassandra from the official Apache website:

wget https://downloads.apache.org/cassandra/3.11.10/apache-cassandra-3.11.10-bin.tar.gz

Step 3: Extract the Archive

Extract the downloaded file:

tar -xvzf apache-cassandra-3.11.10-bin.tar.gz

Step 4: Configure Environment Variables

Set the environment variables for Cassandra:

export CASSANDRA_HOME=/path/to/apache-cassandra-3.11.10
export PATH=$PATH:$CASSANDRA_HOME/bin

Step 5: Start Cassandra

Run the following command to start Cassandra:

cassandra -f

You should see logs indicating that Cassandra is starting up.

Configuration

After installation, you may need to configure Cassandra according to your requirements. The main configuration file is located at $CASSANDRA_HOME/conf/cassandra.yaml.

Key configurations include:

  • cluster_name: Name of your Cassandra cluster.
  • listen_address: IP address where Cassandra listens for connections.
  • rpc_address: IP address for client connections.
  • data_file_directories: Directory where Cassandra stores data.

After modifying the configuration file, restart Cassandra using:

sudo systemctl restart cassandra

Verifying Installation

To verify that Cassandra is running properly, you can use the Cassandra Query Language shell (CQLSH). Open a new terminal and run:

cqlsh

If successful, you will enter the CQL shell prompt. You can run a simple query to check the status:

DESCRIBE KEYSPACES;

Conclusion

In this tutorial, we covered the process of deploying Apache Cassandra on-premise. We discussed system requirements, installation steps, configuration, and verification of the deployment. By following these steps, you can set up a robust and scalable NoSQL database that you control within your own infrastructure.