Apache Cassandra is a highly scalable, distributed NoSQL database designed to handle large volumes of data across many commodity servers with high availability and no single point of failure. It supports replication and multi-data center deployments, making it ideal for applications that require scalability, fault tolerance, and performance.
Before using this project, make sure you have the following tools installed:
This project sets up a 3-node Apache Cassandra cluster using Docker Compose. Each node is configured with a static IP and connected via a custom bridge network.
- Acts as the seed node.
- IP Address:
172.18.0.2 - Ports:
9042(CQL)
- Joins the cluster via cassandra1.
- IP Address:
172.18.0.3 - Depends on:
cassandra1
- Joins the cluster via cassandra1.
- IP Address:
172.18.0.4 - Depends on:
cassandra1,cassandra2 - Startup delay of 90 seconds to ensure cluster readiness.
- Cluster Name:
TestCluster - Seed Node:
172.18.0.2(cassandra1) - Snitch:
GossipingPropertyFileSnitch - Broadcast Address: Set to each container’s static IP
- RPC Address:
0.0.0.0(bind all)
Persistent storage for each node:
cassandra1_datacassandra2_datacassandra3_data
- Network Name:
cassandra_net - Driver:
bridge - Subnet:
172.18.0.0/16 - Static IPs assigned for predictable node discovery
docker-compose up -ddocker exec -it cassandra1 cqlshAfter the cluster is up, run the provided test script to verify node connectivity and cluster health.
chmod +x test.sh
./test.shThe test.sh script will:
- Check if each Cassandra node is reachable.
- Verify the nodes are properly connected within the cluster.
✅ If everything is fine, you will see success messages for each node!
docker-compose down -vThis project is licensed under the MIT License - see the LICENSE file for details.