Ready to supercharge your data management? Apache Cassandra, an open-source, highly scalable NoSQL database, is here to help. Known for handling large amounts of data across many servers, it promises high availability without compromising on performance.
CentOS 9 Stream, the rolling release of the popular CentOS Linux, offers a stable and up-to-date foundation. Pairing it with Cassandra ensures robust and resilient data solutions tailored for modern applications.
In this guide, you’ll learn how to smoothly install Cassandra on CentOS 9 Stream. Whether you’re setting up for the first time or fine-tuning your configuration, we’ve got you covered. Expect a step-by-step walkthrough, peppered with tips to make the process seamless and efficient.
Grab your terminal, and let’s dive in!
Installing Prerequisites for Apache Cassandra on CentOS 9 Stream
Before diving into Cassandra’s installation, a little prep work ensures a smoother ride. Setting up the right environment is crucial, so let’s tackle the prerequisites.
Updating System Packages
First things first—let’s ensure your system packages are up to date. Open your terminal and run:
sudo dnf update -y
This command refreshes your package index and upgrades installed packages to their latest versions, minimizing any potential compatibility issues during the Cassandra setup.
Installing Java Development Kit (JDK)
Cassandra relies on Java, so installing the Java Development Kit is next on our checklist. Run the following command to install OpenJDK:
sudo dnf install java-11-openjdk -y
Verifying the installation is just as important. Check the installed Java version using:
java -version
You should see Java version 11 or newer listed. With Java in place, you’re one step closer to unlocking Cassandra’s capabilities!
This groundwork sets the scene for installing Cassandra itself. Let’s move forward to the main event!
Downloading and Installing Apache Cassandra
So, your prerequisites are all set—great job! Now, let’s get to the exciting part: bringing Apache Cassandra itself into the mix. The key steps involve adding the Cassandra repository and then installing the package, so let’s get to it.
Adding the Cassandra Repository
First, we need to let CentOS know where to find Cassandra. Create a repository file with this command:
sudo tee /etc/yum.repos.d/cassandra.repo
Configuring Apache Cassandra on CentOS 9 Stream
You’ve got Cassandra installed—fantastic! Now, it’s time to configure it to suit your environment. This involves tweaking a few configuration files and setting up necessary directories. Let’s go through it step-by-step.
Editing Configuration Files
Cassandra uses a main configuration file called cassandra.yaml located in the /etc/cassandra/ directory. Open it with your favorite text editor:
sudo nano /etc/cassandra/cassandra.yaml
You’ll want to pay special attention to key parameters like cluster_name, which defines your cluster’s name, and listen_address, which sets the IP address for connections. Edit these fields based on your setup requirements.
Remember, setting the proper rpc_address is crucial too, allowing client applications to interface with your Cassandra instance. Save your changes once you’re done.
Setting Up Cassandra Directories
Cassandra stores its data in specific directories, and ensuring these are properly set up is essential. By default, data, commit log, and saved caches are managed in directories defined in the configuration file.
Create these directories if they’re not already present:
sudo mkdir -p /var/lib/cassandra/data
sudo mkdir -p /var/lib/cassandra/commitlog
sudo mkdir -p /var/lib/cassandra/saved_caches
Ensure Cassandra has the right permissions:
sudo chown -R cassandra:cassandra /var/lib/cassandra
And there you go! With your configuration files edited and directories ready, Cassandra is prepped to start managing your data efficiently.
Starting and Enabling Apache Cassandra Service
With Cassandra installed and configured, it’s time to get things running. Starting the service and ensuring it launches on boot will help keep your system ready to manage data at any moment.
Starting the Cassandra Service
Kicking off with starting Cassandra, use the following command:
sudo systemctl start cassandra
Verify it’s running smoothly by checking the status:
sudo systemctl status cassandra
You’ll see an active status if everything’s set up correctly. Any errors? Consider revisiting configuration files for possible tweaks.
Enabling Cassandra to Start on Boot
To ensure Cassandra is always ready after reboots, enable it to start automatically with:
sudo systemctl enable cassandra
This command adds Cassandra to your system’s startup sequence. Reboot your system and rest easy knowing your database will be up and running without manual intervention.
Now, with Cassandra up and always ready, you can focus on building robust data-driven applications!

Conclusion
And there you have it—a fully operational Apache Cassandra setup on CentOS 9 Stream! With this powerful NoSQL database at your fingertips, managing extensive data with ease and reliability is well within reach.
By following the steps outlined in this guide, you’ve laid a solid foundation for scalable, high-performance data management. From installing prerequisites to configuring Cassandra, each step brings you closer to harnessing its full power.
Remember, familiarity with your setup ensures smoother operations and better troubleshooting down the line. Keep exploring the possibilities Cassandra offers and how it can enhance your applications.
Now, it’s time to let Cassandra take your data game to the next level! Whether you’re scaling up or diving into new projects, you’re well-equipped to handle it all with confidence.




