nodetool resetfullquerylog¶
Resets the full query logging path to the configured value.
Synopsis¶
nodetool [connection_options] resetfullquerylog
Description¶
nodetool resetfullquerylog stops full query logging and cleans up log files in the configured log directory (and any path specified via JMX). This command effectively disables FQL if it was enabled.
Cleans Log Directory
This command stops FQL and cleans log files in the configured directories. It does not simply reset the path—it deactivates logging and removes log data.
Examples¶
Basic Usage¶
nodetool resetfullquerylog
Reset and Verify¶
nodetool resetfullquerylog
nodetool getfullquerylog
Behavior¶
When resetfullquerylog is executed:
- FQL is disabled if it was enabled
- Log files in the configured directory are cleaned up
- Log files in any JMX-specified path are also cleaned
- The FQL configuration is reset to defaults
What Changes¶
| Aspect | Before | After |
|---|---|---|
| FQL enabled | Yes (if was enabled) | No |
| Log files | Present | Cleaned |
| Log path | Custom or configured | Reset to config |
When to Use¶
Restore Default Path¶
After using a temporary custom path:
# Previously enabled with custom path
nodetool enablefullquerylog --path /tmp/fql_debug
# Reset to configured path
nodetool resetfullquerylog
# Verify
nodetool getfullquerylog
Configuration Consistency¶
Align runtime settings with configuration file:
# Check current runtime path
nodetool getfullquerylog | grep log_dir
# Check configured path
grep "log_dir" /etc/cassandra/cassandra.yaml
# Reset to match config
nodetool resetfullquerylog
After Debugging Session¶
Return to normal operation after debug session:
# Debug session used custom path
# Now restore normal path
nodetool resetfullquerylog
# Continue with normal FQL path
nodetool getfullquerylog
Workflow: Debug Session with Custom Path¶
#!/bin/bash
# fql_debug_session.sh
DEBUG_PATH="/tmp/fql_debug_$(date +%Y%m%d_%H%M%S)"
mkdir -p $DEBUG_PATH
echo "=== FQL Debug Session ==="
# 1. Save current configuration
echo "1. Current FQL configuration:"
nodetool getfullquerylog
# 2. Enable with debug path
echo ""
echo "2. Enabling FQL with debug path: $DEBUG_PATH"
nodetool enablefullquerylog --path $DEBUG_PATH --roll-cycle MINUTELY
# 3. Wait for data collection
echo ""
echo "3. Collecting data... Press Enter when done."
read
# 4. Disable FQL
echo ""
echo "4. Disabling FQL..."
nodetool disablefullquerylog
# 5. Process debug logs
echo ""
echo "5. Debug logs captured at: $DEBUG_PATH"
echo " Size: $(du -sh $DEBUG_PATH)"
echo " Entries: $(fqltool dump $DEBUG_PATH 2>/dev/null | wc -l)"
# 6. Reset to default path
echo ""
echo "6. Resetting to default path..."
nodetool resetfullquerylog
# 7. Verify reset
echo ""
echo "7. Configuration after reset:"
nodetool getfullquerylog
echo ""
echo "=== Debug Session Complete ==="
echo "Debug logs remain at: $DEBUG_PATH"
Configuration Reference¶
cassandra.yaml Setting¶
# cassandra.yaml
full_query_logging_options:
log_dir: /var/log/cassandra/fql
# ... other settings
Runtime Override¶
# Override configured path at runtime
nodetool enablefullquerylog --path /custom/path
# Reset to cassandra.yaml path
nodetool resetfullquerylog
Cluster-Wide Operations¶
Reset on All Nodes¶
#!/bin/bash
# reset_fql_cluster.sh
echo "Resetting 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 resetfullquerylog 2>/dev/null && echo "reset" || echo "FAILED"'
done
echo ""
echo "Verification:"
for node in $nodes; do
echo "=== $node ==="
ssh "$node" 'nodetool getfullquerylog 2>/dev/null | grep "log_dir"'
done
Troubleshooting¶
Reset Has No Effect¶
# Check if cassandra.yaml has FQL configuration
grep -A 10 "full_query_logging_options" /etc/cassandra/cassandra.yaml
# If no config, reset has nothing to reset to
# The path may remain unchanged or empty
Path Not Changed After Reset¶
# Verify the reset command succeeded
nodetool resetfullquerylog
# Check current configuration
nodetool getfullquerylog
# Check cassandra.yaml for configured path
grep "log_dir" /etc/cassandra/cassandra.yaml
# If cassandra.yaml doesn't have a path configured,
# the runtime path may remain
Logs at Old Path¶
# After reset, existing logs remain at old path
# They are not moved or deleted
# Check old path
ls -la /old/custom/path/
# Move or archive if needed
mv /old/custom/path/* /archive/
Managing Multiple Paths¶
After Reset¶
#!/bin/bash
# cleanup_fql_paths.sh
# Get current configured path
current_path=$(nodetool getfullquerylog | grep "log_dir" | awk '{print $2}')
echo "Current FQL path: $current_path"
echo ""
# Find other potential FQL directories
echo "Potential FQL directories on this system:"
find /var/log/cassandra /tmp -type d -name "*fql*" 2>/dev/null
echo ""
echo "Review and clean up old FQL directories as needed."
Best Practices¶
Reset Guidelines
- Document custom paths - Track when and why custom paths are used
- Clean up after reset - Archive or remove logs at old paths
- Verify configuration - Check
cassandra.yamlhas valid FQL config - Cluster consistency - Reset on all nodes if custom path was cluster-wide
- Check disk space - Ensure default path has sufficient space
When to Reset
- After temporary debugging sessions
- To align runtime with configuration
- After maintenance operations that used custom paths
- To restore normal operational logging
Related Commands¶
| Command | Relationship |
|---|---|
| enablefullquerylog | Enable FQL (with optional custom path) |
| disablefullquerylog | Disable FQL |
| getfullquerylog | View FQL configuration |