Cassandra Log Analysis
Guide to analyzing Cassandra logs for troubleshooting.
Log Locations
Section titled “Log Locations”/var/log/cassandra/├── system.log # Main application log├── debug.log # Debug-level logging├── gc.log # Garbage collection└── audit/ # Audit logs (if enabled)Key Patterns to Search
Section titled “Key Patterns to Search”Errors and Exceptions
Section titled “Errors and Exceptions”# All errorsgrep -i "error\|exception" /var/log/cassandra/system.log | tail -50
# Stack tracesgrep -A 20 "Exception" /var/log/cassandra/system.log
# Specific errorsgrep -i "ReadTimeoutException" /var/log/cassandra/system.loggrep -i "WriteTimeoutException" /var/log/cassandra/system.loggrep -i "UnavailableException" /var/log/cassandra/system.logPerformance Issues
Section titled “Performance Issues”# Slow queriesgrep -i "slow" /var/log/cassandra/system.log
# Tombstone warningsgrep -i "tombstone" /var/log/cassandra/system.log
# Large partitionsgrep -i "large partition\|large row" /var/log/cassandra/system.log
# Compactiongrep -i "compaction\|compacted" /var/log/cassandra/system.logCluster Events
Section titled “Cluster Events”# Node status changesgrep -i "is now\|state jump\|marking" /var/log/cassandra/system.log
# Gossip eventsgrep -i "gossip" /var/log/cassandra/system.log
# Streaminggrep -i "streaming\|stream" /var/log/cassandra/system.logGC Log Analysis
Section titled “GC Log Analysis”# Long pausesgrep -E "pause.*[0-9]{3,}ms" /var/log/cassandra/gc.log
# Full GC eventsgrep -i "full gc\|to-space" /var/log/cassandra/gc.log
# Heap after GCgrep -E "Heap:.* -> " /var/log/cassandra/gc.logCommon Log Messages
Section titled “Common Log Messages”Normal Operations
Section titled “Normal Operations”INFO - Starting listening for CQL clientsINFO - Completed loadingINFO - Starting compactionINFO - Compacted to [sstable]Warning Signs
Section titled “Warning Signs”WARN - Dropping MUTATION messageWARN - Detected GC pause of XmsWARN - Large partition in sstableWARN - Tombstones scanned X for queryCritical Issues
Section titled “Critical Issues”ERROR - Exception in threadERROR - Error writing to channelFATAL - Cannot start CassandraLog Aggregation with AxonOps
Section titled “Log Aggregation with AxonOps”AxonOps provides centralized log collection and analysis for Cassandra clusters, eliminating the need to SSH into individual nodes or maintain separate logging infrastructure.
Key Features
Section titled “Key Features”| Feature | Description |
|---|---|
| Centralized collection | Logs from all nodes aggregated in one interface |
| Real-time streaming | View logs as they occur across the cluster |
| Pattern detection | Automatic identification of error patterns |
| Metric correlation | Link log events to performance metrics |
| Search and filter | Full-text search with time-based filtering |
| Retention management | Configurable log retention policies |
Getting Started
Section titled “Getting Started”- Enable log collection - Configure the axon-agent to collect Cassandra logs
- View logs - Access centralized logs from the AxonOps dashboard
- Set up alerts - Configure alerts for specific log patterns (errors, warnings)
See Setup Log Collection for configuration details and Logs & Events for usage.
Next Steps
Section titled “Next Steps”- Diagnosis Guide - Systematic diagnosis
- Common Errors - Error reference
- Monitoring - Proactive monitoring