nodetool disablefullquerylog
Disables full query logging (FQL) on the node.
Synopsis
Section titled “Synopsis”nodetool [connection_options] disablefullquerylogSee connection options for connection options.
Description
Section titled “Description”nodetool disablefullquerylog deactivates full query logging on a Cassandra node. When disabled, the node stops recording query execution details to the FQL log files.
This command is typically used after completing performance analysis or debugging sessions where query logging was temporarily enabled.
Non-Persistent Setting
This setting is applied at runtime only and does not persist across node restarts. After a restart, full query logging reverts to the full_query_logging_options configuration in cassandra.yaml.
To permanently disable full query logging, ensure it is not configured in cassandra.yaml, or set:
full_query_logging_options: # log_dir: /var/log/cassandra/fql # Comment out or remove to disableExamples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”nodetool disablefullquerylogDisable and Verify
Section titled “Disable and Verify”nodetool disablefullquerylognodetool getfullquerylog# Expected output includes: enabled: falseBehavior
Section titled “Behavior”When full query logging is disabled:
- No new queries are logged
- Existing log files remain on disk
- Log archival continues for existing files
- Disk I/O overhead from logging is eliminated
What Continues
Section titled “What Continues”| Feature | Status |
|---|---|
| Existing FQL log files | Preserved |
| Archive command | Runs for existing logs |
| Query execution | Continues normally |
What Stops
Section titled “What Stops”| Feature | Status |
|---|---|
| New query logging | Stops |
| FQL log growth | Stops |
| Logging overhead | Eliminated |
When to Use
Section titled “When to Use”After Performance Analysis
Section titled “After Performance Analysis”When analysis session is complete:
# Analysis completenodetool disablefullquerylog
# Process collected logsfqltool dump /var/log/cassandra/fql/ > analysis_queries.txtEmergency Disk Space
Section titled “Emergency Disk Space”If FQL is consuming too much disk:
# Disable logging immediatelynodetool disablefullquerylog
# Check disk space recovereddf -h /var/log/cassandra/
# Clean up logs if neededrm -rf /var/log/cassandra/fql/*After Debugging Session
Section titled “After Debugging Session”When issue investigation is complete:
# Debug session completenodetool disablefullquerylog
# Archive logs for referencetar -czf debug_fql_$(date +%Y%m%d).tar.gz /var/log/cassandra/fql/rm -rf /var/log/cassandra/fql/*Performance Issue Resolution
Section titled “Performance Issue Resolution”If FQL is causing latency problems:
# Check current impactnodetool proxyhistograms
# Disable FQLnodetool disablefullquerylog
# Verify latency improvementnodetool proxyhistogramsImpact Assessment
Section titled “Impact Assessment”Immediate Effects
Section titled “Immediate Effects”| Aspect | Impact |
|---|---|
| Query logging | Stops immediately |
| Disk I/O | Decreases |
| Query latency | May improve (if blocking was enabled) |
| Log file growth | Stops |
Performance Recovery
Section titled “Performance Recovery”| Metric | Expected Change |
|---|---|
| Write latency | May decrease |
| Disk utilization | Decreases |
| CPU usage | Slight decrease |
| Query throughput | May increase |
Workflow: Complete FQL Session
Section titled “Workflow: Complete FQL Session”#!/bin/bashFQL_PATH="/var/log/cassandra/fql"ARCHIVE_DIR="/archive/cassandra/fql"
echo "=== FQL Session Management ==="
# 1. Check if FQL is currently enabledecho "1. Current FQL status:"nodetool getfullquerylog
# 2. Disable FQLecho ""echo "2. Disabling FQL..."nodetool disablefullquerylog
# 3. Verify disabledecho ""echo "3. Verification:"nodetool getfullquerylog
# 4. Check captured dataecho ""echo "4. Captured FQL data:"if [ -d "$FQL_PATH" ] && [ "$(ls -A $FQL_PATH 2>/dev/null)" ]; then echo "Log directory size: $(du -sh $FQL_PATH)" echo "Query count: $(fqltool dump $FQL_PATH 2>/dev/null | wc -l)"else echo "No FQL data found"fi
# 5. Archive if requestedecho ""read -p "Archive FQL logs? (y/n): " archiveif [ "$archive" = "y" ]; then mkdir -p $ARCHIVE_DIR archive_file="${ARCHIVE_DIR}/fql_$(date +%Y%m%d_%H%M%S).tar.gz" tar -czf $archive_file $FQL_PATH echo "Archived to: $archive_file"fi
# 6. Clean up if requestedecho ""read -p "Clean up FQL directory? (y/n): " cleanupif [ "$cleanup" = "y" ]; then rm -rf ${FQL_PATH}/* echo "FQL directory cleaned"fi
echo ""echo "=== FQL Session Complete ==="Managing FQL Logs After Disable
Section titled “Managing FQL Logs After Disable”Preserve Logs
Section titled “Preserve Logs”# After disabling, logs remainls -la /var/log/cassandra/fql/
# View log contentsfqltool dump /var/log/cassandra/fql/Archive Logs
Section titled “Archive Logs”# Create archivetar -czf fql_$(date +%Y%m%d).tar.gz /var/log/cassandra/fql/
# Move to archive locationmv fql_*.tar.gz /archive/cassandra/Analyze Before Cleanup
Section titled “Analyze Before Cleanup”# Quick analysis before cleanupecho "Query Distribution:"fqltool dump /var/log/cassandra/fql/ | grep -oE "^(SELECT|INSERT|UPDATE|DELETE)" | sort | uniq -c
echo ""echo "Log Size:"du -sh /var/log/cassandra/fql/Clean Up Logs
Section titled “Clean Up Logs”# Remove all FQL logsrm -rf /var/log/cassandra/fql/*
# Verify cleanupdu -sh /var/log/cassandra/fql/Cluster-Wide Operations
Section titled “Cluster-Wide Operations”Disable on All Nodes
Section titled “Disable on All Nodes”#!/bin/bashecho "Disabling FQL cluster-wide..."# Get list of node IPs from local nodetool status
nodes=$(nodetool status | grep "^UN" | awk '{print $2}')
for node in $nodes; do echo -n "$node: " ssh "$node" "nodetool disablefullquerylog 2>/dev/null && echo "disabled" || echo "FAILED""done
echo ""echo "Verification:"for node in $nodes; do echo -n "$node: " status=$(ssh "$node" "nodetool getfullquerylog 2>/dev/null | grep "enabled")" echo "$status"doneCollect Logs from All Nodes
Section titled “Collect Logs from All Nodes”#!/bin/bashDEST_DIR="/data/fql_collection_$(date +%Y%m%d)"mkdir -p $DEST_DIR# Get list of node IPs from local nodetool status
nodes=$(nodetool status | grep "^UN" | awk '{print $2}')
for node in $nodes; do echo "Collecting FQL from $node..." scp -r $node:/var/log/cassandra/fql/ $DEST_DIR/$node/done
echo "FQL logs collected to $DEST_DIR"Troubleshooting
Section titled “Troubleshooting”Cannot Disable
Section titled “Cannot Disable”# Check JMX connectivitynodetool info
# Check for errorsgrep -i "fql\|fullquery" /var/log/cassandra/system.log | tail -20Logs Still Growing After Disable
Section titled “Logs Still Growing After Disable”# Verify disablednodetool getfullquerylog
# If still enabled, retrynodetool disablefullquerylog
# Check for persistence in cassandra.yamlgrep -A 10 "full_query_logging" /etc/cassandra/cassandra.yamlPerformance Not Improved
Section titled “Performance Not Improved”# FQL may not have been the bottleneck# Check other metricsnodetool tpstatsnodetool compactionstatsiostat -x 1Best Practices
Section titled “Best Practices”Disable Guidelines
- Disable when done - Don't leave FQL running indefinitely
- Archive before cleanup - Preserve logs if analysis is needed
- Check disk space - Verify space is freed after cleanup
- Document findings - Record analysis results before cleanup
- Cluster consistency - Disable on all nodes if enabled cluster-wide
- Verify disabled - Always check with
getfullquerylog
Post-Disable Workflow
After disabling FQL:
- Verify disabled with
getfullquerylog - Analyze captured logs with
fqltool dump - Archive logs if needed for future reference
- Clean up log directory to reclaim space
- Document any findings from the analysis
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| enablefullquerylog | Enable FQL |
| getfullquerylog | View FQL configuration |
| resetfullquerylog | Reset FQL path |
| disableauditlog | Disable audit logging |