How To Install Apache Cassandra On Debian 11

In this article we will learn how to install Apache Cassandra version 4.0 on Debian 11 (Bullseye) operating system. Apache Cassandra is a popular open-source distributed database management system that is designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. It is a NoSQL database, which means it doesn’t use the traditional table-based relational database model. Instead, it uses a column-family data model, which allows for a flexible schema that can handle large amounts of data.\
Here are some key features of Apache Cassandra:
- Distributed architecture: Cassandra is designed to run on a cluster of commodity hardware, providing high availability and fault tolerance. Data is replicated across multiple nodes, ensuring that it is always available, even if some nodes fail.
- High scalability: Cassandra can scale horizontally by adding more nodes to the cluster. This allows it to handle large amounts of data and high traffic loads with ease.
- Flexible data model: Cassandra’s column-family data model allows for a flexible schema that can handle a wide range of data types, including structured, semi-structured, and unstructured data.
- High performance: Cassandra is designed to provide high throughput and low latency, making it ideal for use cases that require fast data access and real-time analytics.
- Tunable consistency: Cassandra allows you to configure the level of consistency you need for your application, from eventual consistency to strong consistency.
- Open-source and community-driven: Cassandra is an open-source project with a large and active community of developers and users.
To use Apache Cassandra, we will need to install it on our system or use a cloud-based service that provides Cassandra hosting. The installation process will vary depending on our operating system and the version of Cassandra you want to install.
Apache Cassandra Installation
Prerequisites
In this tutorial we will use Apache Casandra 4.0, before we proceed to the Apache Cassandra installation process, there are several prerequisites that must be met, namely :
- A Debian 11 operating system.
- Java installed on the system.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- A root user access or normal user with administrative privileges.
As mentioned above, Apache Cassandra requires Java installed on the system, then we need to verify it first. To verify Java installed on the system, we will submit following command line :
Output :
If our system has no Java installed on the system, then we will install it first. For Installing OpenJDK 11 on Debian 11 BullsEye can be found at How To Install OpenJDK 11 On Debian 11 article.
The Apache Cassandra installation will be consist of several steps, as mentioned below :
- Update Debian 11 Local Repository
- Adding Apache Cassandra Repository
- Installing Apache Cassandra
- Verify Cassandra Installation
1. Update Debian 11 Local Repository
Before installing Apache Cassandra on Debian 11 Bullseye, we have to prepare the environment first. We will update our system to ensure that we have the latest security patches and updates. We can do this by running the appropriate command Debian 11 system.
2. Adding Apache Cassandra Repository
In this step, we will add Apache Cassandra repository to our Debian 11 system. For this purpose, we will submit the following command line :
Output :
3. Installing Apache Cassandra
In this step, we will install Apache Cassandra on Debian 11 operating system. We will do following commands line:
Output :
By default Apache Cassandra will be started after installation was completed. Then we will check its service by submitting command line :
Output :
4. Verify Apache Cassandra Installation
When Apache Cassandra installation was competed done, then we will verify if Apache Cassandra was installed on the system. For this purpose, we will use a command line to check the node status.
Output :
5. CQLSH (Cassandra Query Language Shell)
CQLSH (Cassandra Query Language Shell) is a command-line tool that allows you to interact with Apache Cassandra using the Cassandra Query Language (CQL). CQL is a SQL-like language that is used to interact with Cassandra’s column-family data model.
To use CQLSH, you will need to have Apache Cassandra installed on your system. Once Cassandra is installed, you can start CQLSH by opening a terminal or command prompt and entering the following command:
Output :
Example of using CQLSH
1. Create a keyspace:
2. Create a table
3. Insert data into a table:
4. Query data in a table:
5. Update data in a table :
6. Delete data from a table:
Conclusion
In this short article, we have installed Apache Cassandra 4.0 on Debian 11 (Bulls Eye) operating system successfully. I hope this article will be helpful.