Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Cassandra Troubleshooting Guide

This guide provides systematic approaches to diagnosing and resolving common Cassandra operational issues.

Systematic Troubleshooting

Follow the pattern: Observe (gather data) → Hypothesize (form theory) → Test (verify theory) → Fix (implement solution) → Verify (confirm resolution).


Run these commands to quickly assess cluster health:

quick-diagnostic.sh
#!/bin/bash
echo "=== Node Status ==="
nodetool status
echo -e "\n=== Ring Health ==="
nodetool describecluster | head -30
echo -e "\n=== Thread Pool Status ==="
nodetool tpstats | grep -E "Pool|Active|Pending|Blocked"
echo -e "\n=== Dropped Messages ==="
nodetool tpstats | grep -i dropped | grep -v "^0"
echo -e "\n=== Compaction Status ==="
nodetool compactionstats | head -20
echo -e "\n=== Recent Errors ==="
tail -100 /var/log/cassandra/system.log | grep -i "error\|exception\|warn" | tail -20
CheckCommandHealthy State
All nodes upnodetool statusAll UN (Up Normal)
Schema agreementnodetool describeclusterSingle schema version
No dropped messagesnodetool tpstatsAll zeros
Compaction healthynodetool compactionstats<50 pending

Symptoms: Cassandra process fails to start or crashes immediately

Diagnostic steps:

Terminal window
# Check system log for startup errors
tail -200 /var/log/cassandra/system.log | grep -i "error\|exception\|fatal"
# Check if port is already in use
netstat -tlnp | grep -E "7000|9042|7199"
# Check disk space
df -h /var/lib/cassandra
# Check file permissions
ls -la /var/lib/cassandra/
ls -la /var/log/cassandra/
# Check JVM can allocate heap
java -Xmx16G -version 2>&1

Common causes and solutions:

CauseLog PatternSolution
Port in use"Address already in use"Kill existing process or change ports
Insufficient disk"No space left on device"Free disk space or add storage
Permission denied"Permission denied"Fix ownership: chown -R cassandra:cassandra /var/lib/cassandra
Corrupt commit log"CommitLog" + "corrupt"Remove corrupt segment (data loss risk)
Heap allocation failure"Could not reserve enough space"Reduce heap or add memory
Schema corruption"Schema" + "cannot"Restore from backup or repair schema

Commit log corruption recovery:

Terminal window
# WARNING: May cause data loss for unflushed writes
# Identify corrupt segment
ls -la /var/lib/cassandra/commitlog/
# Move corrupt segment
mv /var/lib/cassandra/commitlog/CommitLog-*.log /tmp/corrupt_commitlog/
# Restart Cassandra
sudo systemctl start cassandra

Symptoms: Node running but not responding to queries or nodetool

Diagnostic steps:

Terminal window
# Check if process is running
ps aux | grep cassandra
# Check GC activity
tail -50 /var/log/cassandra/gc.log
# Generate thread dump
kill -3 $(pgrep -f CassandraDaemon)
# Or: jstack $(pgrep -f CassandraDaemon) > /tmp/thread_dump.txt
# Check system resources
top -p $(pgrep -f CassandraDaemon)
iostat -x 1 5

Common causes:

CauseIndicatorsSolution
GC stormLong GC pauses in gc.logReduce heap, tune GC, reduce load
Thread starvationBlocked threads in dumpIdentify contention, increase pool
Disk I/O saturationHigh iowait in topReduce load, faster storage
Network partitionGossip timeouts in logCheck network connectivity

Symptoms: Node shows DN in nodetool status from other nodes' perspective

Diagnostic steps:

Terminal window
# On "down" node - check if it thinks it's up
nodetool status
# Check gossip state
nodetool gossipinfo
# Check network from other nodes
nc -zv <down_node_ip> 7000
nc -zv <down_node_ip> 9042
# Check firewall
iptables -L -n
# Check for gossip issues in log
grep -i gossip /var/log/cassandra/system.log | tail -50

Common causes:

CauseSolution
Network partitionResolve network issue
Firewall blockingOpen ports 7000, 7001, 9042
GC pauses causing timeoutsTune GC
phi_convict_threshold too lowIncrease threshold (rare)

Symptoms: P99 read latency exceeds SLA, slow queries

Diagnostic steps:

Terminal window
# Check latency by table
nodetool tablestats <keyspace> | grep -A 15 "Table:"
# Check tombstone counts
nodetool tablestats <keyspace>.<table> | grep -i tombstone
# Check SSTable count
nodetool tablestats <keyspace>.<table> | grep "SSTable count"
# Check partition sizes
nodetool tablehistograms <keyspace> <table>
# Check bloom filter effectiveness
nodetool tablestats <keyspace>.<table> | grep -i bloom

Common causes and solutions:

CauseIndicatorSolution
Too many SSTablesSSTable count >20 (STCS)Force compaction, adjust strategy
Excessive tombstonesTombstones/read >1000Reduce deletes, force compaction
Large partitionsPartition size >100MBRedesign data model
Poor bloom filterFalse positive >10%Increase bloom filter FP chance
Cold cacheLow key cache hitsWarm cache, increase size
GC pausesP99 latency spikesTune GC

Symptoms: P99 write latency exceeds SLA, timeouts

Diagnostic steps:

Terminal window
# Check commit log disk
df -h /var/lib/cassandra/commitlog
iostat -x 1 5
# Check memtable flush rate
nodetool tpstats | grep -i memtable
# Check mutation stage
nodetool tpstats | grep -i mutation
# Check hints accumulation
ls -la /var/lib/cassandra/hints/

Common causes and solutions:

CauseIndicatorSolution
Commit log disk slowHigh iowaitUse faster disk, separate disk
Memtable flush backlogPending memtable flushesIncrease flush writers
Compaction backlogPending compactions >100Increase compaction throughput
Hints accumulationLarge hints directoryInvestigate down nodes
Batch too largeBatch size warningsReduce batch size

Symptoms: Non-zero dropped messages in nodetool tpstats

Terminal window
# Check which message types are dropped
nodetool tpstats | grep -i dropped
# Message types:
# MUTATION - Write requests dropped
# READ - Read requests dropped
# RANGE_SLICE - Range query requests dropped
# REQUEST_RESPONSE - Response to coordinator dropped

Interpretation:

Message TypeMeaningCommon Cause
MUTATIONWrites not processed in timeOverload, disk slow
READReads not processed in timeOverload, compaction
RANGE_SLICERange queries droppedLarge scans, overload
REQUEST_RESPONSEResponses droppedNetwork, overload

Solutions:

# Increase timeouts (cassandra.yaml)
read_request_timeout_in_ms: 10000
write_request_timeout_in_ms: 5000
# Or reduce load on cluster
# Or add capacity

Symptoms: Multiple schema versions in nodetool describecluster

Diagnostic steps:

Terminal window
# Check schema versions
nodetool describecluster
# Identify which nodes have which version
nodetool describecluster | grep -A 100 "Schema versions"
# Check for pending schema changes
grep -i schema /var/log/cassandra/system.log | tail -50

Solutions:

Terminal window
# Usually resolves automatically - wait 30 seconds
# If persistent, restart problematic nodes
# (one at a time)
# Force schema refresh
nodetool resetlocalschema # Cassandra 4.0+
# Last resort - rolling restart of cluster

Symptoms: Nodes don't see each other, split cluster

Diagnostic steps:

Terminal window
# Check gossip state
nodetool gossipinfo
# Check for gossip errors
grep -i gossip /var/log/cassandra/system.log | grep -i "error\|fail" | tail -20
# Verify seed connectivity
nc -zv <seed_ip> 7000

Common causes:

CauseSolution
Network partitionResolve network issue
Seed nodes downEnsure seeds are up
FirewallOpen port 7000 between nodes
Different cluster namesFix cassandra.yaml

Symptoms: Different data returned for same query, repair errors

Diagnostic steps:

Terminal window
# Check repair history
nodetool netstats | grep -i repair
# Run consistency check (--force required)
nodetool verify -f <keyspace> <table>
# Check for read repair errors
grep -i "read repair" /var/log/cassandra/system.log | tail -20

Solutions:

Terminal window
# Run full repair
nodetool repair -full <keyspace>
# For specific table
nodetool repair <keyspace> <table>

Symptoms: Writes failing, "No space left on device" errors

Immediate actions:

Terminal window
# Check disk usage
df -h /var/lib/cassandra
# Find large files
du -sh /var/lib/cassandra/*
du -sh /var/lib/cassandra/data/*/*
# Clear snapshots
nodetool clearsnapshot
# Clear old commit logs (if already flushed)
ls -la /var/lib/cassandra/commitlog/

Longer-term solutions:

Terminal window
# Run cleanup to remove data no longer owned
nodetool cleanup
# Drop unused snapshots
nodetool listsnapshots
nodetool clearsnapshot -t <snapshot_name>
# Compact to reclaim tombstone space
nodetool compact <keyspace> <table>
# Add storage or nodes

Symptoms: Read errors, "CorruptSSTableException" in logs

Diagnostic steps:

Terminal window
# Identify corrupt SSTable from error
grep -i corrupt /var/log/cassandra/system.log
# Verify SSTable
sstableverify <keyspace> <table>
# Check specific SSTable
tools/bin/sstablemetadata <sstable_path>

Solutions:

Terminal window
# If other replicas exist (RF > 1)
# Remove corrupt SSTable and repair
rm <corrupt_sstable>* # Remove all components
nodetool repair <keyspace> <table>
# If no other replicas
# Try scrubbing (may lose some data)
nodetool scrub <keyspace> <table>

Symptoms: Startup failures mentioning commit log

Solutions:

Terminal window
# If commit log corrupt and data can be rebuilt from replicas
# Move corrupt segments
mkdir /tmp/corrupt_commitlog
mv /var/lib/cassandra/commitlog/CommitLog-7-*.log /tmp/corrupt_commitlog/
# Restart and repair
sudo systemctl start cassandra
nodetool repair

Data Loss Risk

Removing commit log segments loses any writes not yet flushed to SSTables. Only do this if data can be recovered from other replicas.


Symptoms: Repair running for excessive time, no progress

Diagnostic steps:

Terminal window
# Check repair status
nodetool netstats | grep -i repair
# Check for streaming
nodetool netstats | grep -i stream
# Check thread pools
nodetool tpstats | grep -i repair

Solutions:

Terminal window
# Stop stuck repair
nodetool stop REPAIR
# Check for network issues between nodes
nc -zv <other_node> 7000
# Reduce repair scope
# Instead of full keyspace repair:
nodetool repair <keyspace> <single_table>
# Parallel repair is the default in Cassandra 4.0+
nodetool repair <keyspace>

Symptoms: "Repair session failed" errors

Common causes:

ErrorCauseSolution
"Connection refused"Node downEnsure all nodes up
"Timeout"Network or loadIncrease timeout, reduce load
"Out of memory"Too many rangesReduce scope, increase heap
"Anti-compaction"Incremental repair issueUse full repair

Symptoms: OOM errors in logs, node crashes

Diagnostic steps:

Terminal window
# Check heap usage before OOM
grep -i "heap\|memory" /var/log/cassandra/system.log | tail -50
# Check for large allocations
grep -i "allocat" /var/log/cassandra/debug.log | tail -50
# Analyze heap dump if generated
jmap -histo $(pgrep -f CassandraDaemon) | head -30

Common causes and solutions:

CauseIndicatorSolution
Heap too smallFrequent full GCsIncrease heap
Large partitionsQuery timeouts before OOMRedesign data model
Too many tombstonesTombstone warningsReduce deletes, compact
Memory leakGradual heap growthUpgrade Cassandra
Off-heap exhaustionNative memory errorsReduce off-heap usage

Symptoms: Long GC pauses, high GC CPU usage

Diagnostic steps:

Terminal window
# Check GC statistics
nodetool gcstats
# Analyze GC log
grep "pause" /var/log/cassandra/gc.log | tail -20
# Check for long pauses
grep -E "pause.*[0-9]{4,}ms" /var/log/cassandra/gc.log

Solutions:

Terminal window
# Reduce heap if >32GB
# jvm-server.options
-Xms24G
-Xmx24G
# Tune G1GC
-XX:MaxGCPauseMillis=300
-XX:InitiatingHeapOccupancyPercent=70
# Reduce memory pressure
# - Smaller partitions
# - Fewer tombstones
# - Lower concurrent queries

Symptoms: Nodes marking each other down, streaming failures

Diagnostic steps:

Terminal window
# Test connectivity
nc -zv <other_node> 7000 # Storage
nc -zv <other_node> 7001 # SSL storage
nc -zv <other_node> 7199 # JMX
# Check for TCP issues
netstat -s | grep -i "retransmit\|timeout"
# Check MTU issues
ping -M do -s 1472 <other_node>

Solutions:

IssueSolution
Firewall blockingOpen ports 7000, 7001, 9042
MTU mismatchSet consistent MTU across network
Network saturationIncrease bandwidth, throttle streaming
TCP timeoutsTune kernel TCP settings

Symptoms: Client can't connect, connection timeouts

Diagnostic steps:

Terminal window
# Check native transport status
nodetool statusbinary
# Test from client machine
nc -zv <cassandra_node> 9042
# Check connection limits
nodetool clientstats
# Check for connection errors
grep -i "native\|connect" /var/log/cassandra/system.log | grep -i error

Solutions:

# cassandra.yaml - ensure native transport enabled
start_native_transport: true
# Check rpc_address (should be reachable IP)
rpc_address: 0.0.0.0
broadcast_rpc_address: <public_ip>

Diagnosing Cassandra issues requires correlating metrics, logs, and cluster state across multiple nodes. AxonOps provides integrated troubleshooting capabilities.

AxonOps provides:

  • Unified log view: Search and correlate logs across all nodes
  • Metric correlation: Overlay metrics with events and errors
  • Historical analysis: Compare current state to past baselines
  • Alert context: See related metrics when alerts fire
  • Anomaly detection: ML-based identification of unusual patterns
  • Root cause suggestions: Guidance based on symptom patterns
  • Impact analysis: Understand which services are affected
  • Runbook integration: Link alerts to resolution procedures
  • Guided diagnostics: Step-by-step investigation workflows
  • Comparison tools: Compare nodes to identify outliers
  • Timeline reconstruction: Build sequence of events leading to issues
  • Knowledge base: Access to common issues and solutions

See the AxonOps documentation for troubleshooting features.


  1. Assess scope: How many nodes affected?
  2. Maintain quorum: Ensure RF/2+1 nodes per DC remain up
  3. Stop the bleeding: Prevent additional failures
  4. Communicate: Alert stakeholders
  5. Recover: Bring nodes back or replace

Document these for your organization:

  • On-call DBA/SRE contact
  • Infrastructure team contact
  • Application team contacts
  • Management escalation path
ScenarioRiskRecovery
Single node lossLow (RF>1)Replace node, repair
Rack lossLow-MediumReplace nodes, repair
DC lossMediumFailover to other DC
All replicas lostHighRestore from backup

  1. Monitor continuously: Detect issues before users report
  2. Establish baselines: Know what "normal" looks like
  3. Document incidents: Build knowledge base
  4. Practice recovery: Regular DR drills
  1. Don't panic: Methodical troubleshooting is faster
  2. Gather data first: Collect logs and metrics before changing things
  3. One change at a time: Avoid confusing multiple changes
  4. Document actions: Track what was tried and results
  1. Root cause analysis: Understand why it happened
  2. Prevent recurrence: Implement fixes
  3. Update runbooks: Capture new knowledge
  4. Share learnings: Team awareness