nodetool resetfullquerylog
Resets the full query logging path to the configured value.
Synopsis
Section titled “Synopsis”nodetool [connection_options] resetfullquerylogSee connection options for connection options.
Description
Section titled “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
Section titled “Examples”Basic Usage
Section titled “Basic Usage”nodetool resetfullquerylogReset and Verify
Section titled “Reset and Verify”nodetool resetfullquerylognodetool getfullquerylogBehavior
Section titled “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
Section titled “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
Section titled “When to Use”Restore Default Path
Section titled “Restore Default Path”After using a temporary custom path:
# Previously enabled with custom pathnodetool enablefullquerylog --path /tmp/fql_debug
# Reset to configured pathnodetool resetfullquerylog
# Verifynodetool getfullquerylogConfiguration Consistency
Section titled “Configuration Consistency”Align runtime settings with configuration file:
# Check current runtime pathnodetool getfullquerylog | grep log_dir
# Check configured pathgrep "log_dir" /etc/cassandra/cassandra.yaml
# Reset to match confignodetool resetfullquerylogAfter Debugging Session
Section titled “After Debugging Session”Return to normal operation after debug session:
# Debug session used custom path# Now restore normal pathnodetool resetfullquerylog
# Continue with normal FQL pathnodetool getfullquerylogWorkflow: Debug Session with Custom Path
Section titled “Workflow: Debug Session with Custom Path”#!/bin/bashDEBUG_PATH="/tmp/fql_debug_$(date +%Y%m%d_%H%M%S)"mkdir -p $DEBUG_PATH
echo "=== FQL Debug Session ==="
# 1. Save current configurationecho "1. Current FQL configuration:"nodetool getfullquerylog
# 2. Enable with debug pathecho ""echo "2. Enabling FQL with debug path: $DEBUG_PATH"nodetool enablefullquerylog --path $DEBUG_PATH --roll-cycle MINUTELY
# 3. Wait for data collectionecho ""echo "3. Collecting data... Press Enter when done."read
# 4. Disable FQLecho ""echo "4. Disabling FQL..."nodetool disablefullquerylog
# 5. Process debug logsecho ""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 pathecho ""echo "6. Resetting to default path..."nodetool resetfullquerylog
# 7. Verify resetecho ""echo "7. Configuration after reset:"nodetool getfullquerylog
echo ""echo "=== Debug Session Complete ==="echo "Debug logs remain at: $DEBUG_PATH"Configuration Reference
Section titled “Configuration Reference”cassandra.yaml Setting
Section titled “cassandra.yaml Setting”full_query_logging_options: log_dir: /var/log/cassandra/fql # ... other settingsRuntime Override
Section titled “Runtime Override”# Override configured path at runtimenodetool enablefullquerylog --path /custom/path
# Reset to cassandra.yaml pathnodetool resetfullquerylogCluster-Wide Operations
Section titled “Cluster-Wide Operations”Reset on All Nodes
Section titled “Reset on All Nodes”#!/bin/bashecho "Resetting FQL cluster-wide..."
# Get list of node IPs from local nodetool statusnodes=$(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"'doneTroubleshooting
Section titled “Troubleshooting”Reset Has No Effect
Section titled “Reset Has No Effect”# Check if cassandra.yaml has FQL configurationgrep -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 emptyPath Not Changed After Reset
Section titled “Path Not Changed After Reset”# Verify the reset command succeedednodetool resetfullquerylog
# Check current configurationnodetool getfullquerylog
# Check cassandra.yaml for configured pathgrep "log_dir" /etc/cassandra/cassandra.yaml
# If cassandra.yaml doesn't have a path configured,# the runtime path may remainLogs at Old Path
Section titled “Logs at Old Path”# After reset, existing logs remain at old path# They are not moved or deleted
# Check old pathls -la /old/custom/path/
# Move or archive if neededmv /old/custom/path/* /archive/Managing Multiple Paths
Section titled “Managing Multiple Paths”After Reset
Section titled “After Reset”#!/bin/bash# Get current configured pathcurrent_path=$(nodetool getfullquerylog | grep "log_dir" | awk '{print $2}')
echo "Current FQL path: $current_path"echo ""
# Find other potential FQL directoriesecho "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
Section titled “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
Section titled “Related Commands”| Command | Relationship |
|---|---|
| enablefullquerylog | Enable FQL (with optional custom path) |
| disablefullquerylog | Disable FQL |
| getfullquerylog | View FQL configuration |