Verifying the Installation of Apache Cassandra
Verifying Apache Cassandra installation using terminal command cassandra -v
Once Apache Cassandra is installed, it’s important to verify that the setup is correct and the service is running as expected. Below is a detailed, step-by-step guide to confirm a successful Cassandra installation on Linux or Windows systems.
After installation, verify that Cassandra is installed and accessible via the terminal.
Command:
cassandra -v
Expected Output:
4.1.3
(Version may vary depending on the installed release.)
This confirms that Cassandra is correctly added to your system’s PATH.
Before verifying functionality, ensure Cassandra is running.
On Linux (systemd):
sudo systemctl start cassandra
sudo systemctl status cassandra
Expected output should include:
Active: active (running)
On Windows:
Open Command Prompt as Administrator.
Navigate to the Cassandra bin folder, e.g.:
cd C:\Program Files\apache-cassandra\bin
Start Cassandra:
cassandra.bat
Cassandra generates logs that show startup details and potential errors.
Default log location:
/var/log/cassandra/system.log
Command:
tail -f /var/log/cassandra/system.log
Look for messages like:
Starting listening for CQL clients on /127.0.0.1:9042
This indicates that Cassandra is running and listening for client connections.
Cassandra Query Language Shell (cqlsh) is a command-line interface for interacting with Cassandra.
Command:
cqlsh
Expected Output:
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 6.1.0 | Cassandra 4.1.3 | CQL spec 3.4.5 | Native protocol v5]
Use HELP for help.
If you can connect successfully, your node is functioning properly.
The nodetool utility shows the health and status of your Cassandra nodes.
Command:
nodetool status
Example Output:
Datacenter: DC1
====================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 127.0.0.1 120 KB 256 100.0% e3b1b64a-24a1-42a4-8307-2d5324c1cb58 rack1
✅ Interpretation:
U → Node is Up
N → Node is in Normal state
If you see UN, it means Cassandra is working perfectly.
Once connected to cqlsh, create a test keyspace and table to ensure everything is operational.
CREATE KEYSPACE demo WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};
USE demo;
CREATE TABLE users (id UUID PRIMARY KEY, name TEXT);
INSERT INTO users (id, name) VALUES (uuid(), 'Alice');
SELECT * FROM users;
If you see the inserted data in the output, Cassandra is functioning correctly.
Cassandra requires Java to run, so confirm the Java environment is correctly configured.
Command:
java -version
Expected Output:
openjdk version "11.x" or "1.8.x"
| Step | Description | Command |
|---|---|---|
| 1 | Check Cassandra version |
cassandra -v |
| 2 | Start Cassandra service |
sudo systemctl start cassandra |
| 3 | Check logs for errors |
tail -f /var/log/cassandra/system.log |
| 4 | Connect to CQL shell |
cqlsh |
| 5 | Check cluster status |
nodetool status |
| 6 | Run test queries |
CREATE KEYSPACE demo; |
| 7 | Verify Java setup |
java -version |
By following these steps, you can confirm that Apache Cassandra has been installed and configured successfully. Checking the version, logs, and cluster status ensures your database is stable and ready for production workloads. Once verified, you can proceed with configuring a multi-node Cassandra cluster for distributed data stor