Cassandra Cluster Management Troubleshooting
This guide covers diagnosis and resolution of common issues during topology operations.
Diagnostic Commands
Section titled “Diagnostic Commands”Essential Commands
Section titled “Essential Commands”# Cluster statenodetool status
# Streaming statusnodetool netstats
# Schema agreementnodetool describecluster
# Gossip statenodetool gossipinfo
# Active operationsnodetool compactionstatsLog Analysis
Section titled “Log Analysis”# Recent errorsgrep -i "error\|exception\|failed" /var/log/cassandra/system.log | tail -50
# Streaming issuesgrep -i stream /var/log/cassandra/system.log | tail -50
# Bootstrap/decommissiongrep -i "bootstrap\|decommission\|leaving\|joining" /var/log/cassandra/system.log | tail -50Bootstrap Issues
Section titled “Bootstrap Issues”Node Won't Join Cluster
Section titled “Node Won't Join Cluster”Symptoms: New node starts but doesn't appear in nodetool status
Diagnostic steps:
# Check if Cassandra is runningsudo systemctl status cassandra
# Check for startup errorstail -100 /var/log/cassandra/system.log | grep -i error
# Verify network connectivity to seedsnc -zv <seed_ip> 7000nc -zv <seed_ip> 9042Common causes and solutions:
| Cause | Diagnosis | Solution |
|---|---|---|
| Cluster name mismatch | grep cluster_name cassandra.yaml | Fix name, clear data, restart |
| Seeds unreachable | nc -zv seed 7000 fails | Check firewall, network |
| Wrong listen_address | Check logs for binding errors | Fix listen_address in yaml |
| Data directory not empty | Check /var/lib/cassandra/data | Clear data directories |
| Schema disagreement | nodetool describecluster shows multiple versions | Wait or restart seeds |
# Clear data for fresh startsudo systemctl stop cassandrasudo rm -rf /var/lib/cassandra/data/*sudo rm -rf /var/lib/cassandra/commitlog/*sudo rm -rf /var/lib/cassandra/saved_caches/*sudo systemctl start cassandraBootstrap Stalled
Section titled “Bootstrap Stalled”Symptoms: Node shows UJ (Joining) for extended period, streaming shows no progress
Diagnostic steps:
# Check streaming progressnodetool netstats
# Look for streaming errorsgrep -i "stream.*error\|stream.*failed" /var/log/cassandra/system.log
# Check source nodesnodetool statusCommon causes and solutions:
| Cause | Diagnosis | Solution |
|---|---|---|
| Source node overloaded | High CPU/IO on source | Wait or reduce stream throughput |
| Network issues | Packet loss, timeouts in logs | Fix network |
| Large partitions | Timeout errors in logs | Increase streaming_socket_timeout_in_ms |
| Disk full | Check df -h | Free space |
# cassandra.yaml - increase timeouts for large partitions# 4.0: streaming_socket_timeout_in_ms: 86400000# 4.1+: streaming_socket_timeout: 24h (duration syntax)streaming_socket_timeout_in_ms: 86400000 # 24 hours (4.0 syntax)Version Differences
Cassandra 4.1+ uses duration syntax (e.g., 24h) instead of _in_ms suffixes. Check the version-specific configuration documentation.
Bootstrap Failed Mid-Way
Section titled “Bootstrap Failed Mid-Way”Symptoms: Node crashed or was stopped during bootstrap
Recovery:
# Clear partial data and retrysudo systemctl stop cassandrasudo rm -rf /var/lib/cassandra/data/*sudo rm -rf /var/lib/cassandra/commitlog/*sudo rm -rf /var/lib/cassandra/saved_caches/*sudo systemctl start cassandraDecommission Issues
Section titled “Decommission Issues”Decommission Stuck
Section titled “Decommission Stuck”Symptoms: Node remains in UL (Leaving) state for extended period
Diagnostic steps:
# Check streaming progressnodetool netstats
# Look for target node issuesnodetool status
# Check logsgrep -i "decommission\|stream" /var/log/cassandra/system.log | tail -50Common causes and solutions:
| Cause | Diagnosis | Solution |
|---|---|---|
| Target nodes unavailable | nodetool status shows DN | Fix target nodes |
| Network issues | Streaming errors in logs | Fix network |
| Target disk full | Check target df -h | Free space on targets |
| Streaming throttled | Low throughput in netstats | Increase stream throughput |
Cannot Cancel Decommission
Once decommission starts, it must complete. If truly stuck:
- Try waiting longer (decommission can take many hours)
- Fix underlying issues (network, disk, node health)
- As last resort: stop the node and use
nodetool removenodefrom another node
Decommission Interrupted
Section titled “Decommission Interrupted”Symptoms: Decommissioning node was stopped or crashed
Recovery options:
| Scenario | Solution |
|---|---|
| Node can be restarted | Restart; decommission should resume |
| Node cannot be restarted | Use nodetool removenode from other node |
| Data partially streamed | Run repair after recovery |
Removenode Issues
Section titled “Removenode Issues”Removenode Not Progressing
Section titled “Removenode Not Progressing”Symptoms: nodetool removenode status shows no progress
Diagnostic steps:
# Check removenode statusnodetool removenode status
# Check streamingnodetool netstats
# Check logs on executing nodegrep -i "remove\|stream" /var/log/cassandra/system.log | tail -50Solutions:
# If stuck for > 1 hour with no progressnodetool removenode force <host_id>
# After force removal, run repairnodetool repair -fullWrong Node Removed
Section titled “Wrong Node Removed”Symptoms: Accidentally removed wrong node
Recovery:
- If node still has data: restart it (will try to rejoin)
- If data cleared: add as new node (bootstrap)
- Run repair to ensure consistency
Replacement Issues
Section titled “Replacement Issues”Replacement Won't Start
Section titled “Replacement Won't Start”Symptoms: Node with replace_address_first_boot won't start
Diagnostic steps:
# Check for startup errorstail -100 /var/log/cassandra/system.log | grep -i error
# Verify dead node is recognizednodetool status # Should show DN for dead nodeCommon causes and solutions:
| Cause | Diagnosis | Solution |
|---|---|---|
| Dead node not recognized | Not in nodetool status as DN | Wait for gossip timeout |
| Wrong IP in replace option | IP mismatch | Correct the JVM option |
| Data directory not empty | Has old data | Clear data directories |
| Version mismatch | Check versions | Install matching version |
Replacement Streaming Stalled
Section titled “Replacement Streaming Stalled”Symptoms: Replacement node stuck in UJ state
Same solutions as bootstrap stalled (see above)
Replacement Node Has Wrong Tokens
Section titled “Replacement Node Has Wrong Tokens”Symptoms: After replacement, node has different token count
Cause: num_tokens doesn't match dead node
Solution:
# Must restart with correct configurationsudo systemctl stop cassandrasudo rm -rf /var/lib/cassandra/data/*
# Fix cassandra.yamlnum_tokens: <match_dead_node>
# Restartsudo systemctl start cassandraStreaming Issues
Section titled “Streaming Issues”Streaming Timeouts
Section titled “Streaming Timeouts”Symptoms: Repeated timeout errors during any topology operation
# Typical error in logsERROR [Stream...] stream/StreamResultFuture.java:... Stream failed: java.net.SocketTimeoutException: Read timed outSolutions:
# cassandra.yaml - increase timeoutsstreaming_socket_timeout_in_ms: 86400000 # 24 hours (default: 1 hour)
# For Cassandra 4.0+stream_entire_sstables: true # Faster for large filesStreaming Too Slow
Section titled “Streaming Too Slow”Symptoms: Topology operations taking excessive time
Diagnosis:
# Check current throughputnodetool getstreamthroughput
# Check network utilizationiftop -i eth0 # or appropriate interfaceSolutions:
# Increase streaming throughput (MB/s)nodetool setstreamthroughput 400 # Default is 200
# Cassandra 4.0+ in cassandra.yamlstream_entire_sstables: trueStreaming Failures
Section titled “Streaming Failures”Symptoms: Repeated streaming failures
Diagnostic steps:
# Check for failuresnodetool netstats | grep -i failed
# Check specific errorsgrep -i "stream.*failed\|stream.*error" /var/log/cassandra/system.logCommon causes:
| Cause | Solution |
|---|---|
| Network instability | Fix network issues |
| Disk I/O bottleneck | Reduce concurrent streaming |
| Memory pressure | Increase heap or reduce streaming |
| Firewall issues | Open port 7000 between all nodes |
Gossip Issues
Section titled “Gossip Issues”Node Stuck in Gossip
Section titled “Node Stuck in Gossip”Symptoms: Node appears in nodetool status but shouldn't (already removed)
Cause: Gossip state not properly propagated
Solutions:
# Option 1: Assassinate the stuck nodenodetool assassinate <stuck_node_ip>
# Option 2: If that fails, rolling restart of cluster# Start with seeds, then other nodesSchema Disagreement
Section titled “Schema Disagreement”Symptoms: nodetool describecluster shows multiple schema versions
Diagnostic:
nodetool describecluster
# Example problematic output:# Schema versions:# abc-123: [10.0.1.1, 10.0.1.2]# def-456: [10.0.1.3] <-- Different!Solutions:
- Wait (schema should converge within minutes)
- If persists, restart the disagreeing node
- If still persists, restart seeds
Network Issues
Section titled “Network Issues”Port Connectivity Problems
Section titled “Port Connectivity Problems”Verification:
# From each node, verify connectivity to all othersfor ip in 10.0.1.1 10.0.1.2 10.0.1.3; do nc -zv $ip 7000 && echo "$ip:7000 OK" || echo "$ip:7000 FAILED" nc -zv $ip 9042 && echo "$ip:9042 OK" || echo "$ip:9042 FAILED"doneRequired ports:
| Port | Purpose | Required Between |
|---|---|---|
| 7000 | Internode | All nodes |
| 7001 | Internode SSL | All nodes (if SSL) |
| 9042 | Native transport | Clients and nodes |
| 7199 | JMX | Admin hosts |
Cross-DC Connectivity
Section titled “Cross-DC Connectivity”For multi-DC setups:
# Verify cross-DC latencyping <other_dc_node>
# Should be < 100ms for reasonable performance# Higher latency impacts streaming and consistencyRecovery Procedures
Section titled “Recovery Procedures”Node Completely Unrecoverable
Section titled “Node Completely Unrecoverable”If a node cannot be recovered and removenode fails:
# 1. Try removenodenodetool removenode <host_id>
# 2. If stuck, forcenodetool removenode force <host_id>
# 3. If still stuck, assassinatenodetool assassinate <node_ip>
# 4. Run full repairnodetool repair -fullCluster Partition (Split Brain)
Section titled “Cluster Partition (Split Brain)”Symptoms: Nodes in different groups can't see each other
Immediate actions:
- Stop writes if possible
- Identify the partition cause (network, firewall)
- Restore connectivity
- Run full repair
# After connectivity restorednodetool repair -fullRelated Documentation
Section titled “Related Documentation”- Cluster Management Overview - Operation selection
- Adding Nodes - Bootstrap procedures
- Removing Nodes - Removal procedures
- Replacing Nodes - Replacement procedures
- Repair Operations - Post-issue repair