nodetool enablehintsfordc
Enables hints for a specific datacenter.
Synopsis
Section titled “Synopsis”nodetool [connection_options] enablehintsfordc <datacenter>See connection options for connection options.
Description
Section titled “Description”nodetool enablehintsfordc re-enables hint storage for nodes in a specific datacenter after it was disabled with disablehintsfordc. When enabled, the local node will store hints for writes destined for unavailable nodes in the specified datacenter.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
datacenter | Name of the datacenter to enable hints for |
Examples
Section titled “Examples”Enable Hints for a Datacenter
Section titled “Enable Hints for a Datacenter”nodetool enablehintsfordc dc2When to Use
Section titled “When to Use”After Datacenter Recovery
Section titled “After Datacenter Recovery”Re-enable hints after a datacenter comes back online:
# DC2 is back onlinenodetool enablehintsfordc dc2
# Verify hints are being stored againAfter Datacenter Maintenance
Section titled “After Datacenter Maintenance”Resume normal hint behavior after planned maintenance:
# Maintenance completenodetool enablehintsfordc dc2
# Monitor hint activitynodetool listpendinghintsRestore Normal Operations
Section titled “Restore Normal Operations”Return to default behavior after temporary disable:
# Re-enable hints for datacenternodetool enablehintsfordc dc2
# Verify enabled (no specific status command, but hints will accumulate)Cluster-Wide Operation
Section titled “Cluster-Wide Operation”Enable on All Nodes
Section titled “Enable on All Nodes”Hints are stored on coordinator nodes, so enable on all nodes:
#!/bin/bashDATACENTER="$1"
if [ -z "$DATACENTER" ]; then echo "Usage: $0 <datacenter>" exit 1fi
# 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 enablehintsfordc $DATACENTER" && echo "enabled" || echo "FAILED"doneUse Cases
Section titled “Use Cases”Multi-DC Recovery Workflow
Section titled “Multi-DC Recovery Workflow”#!/bin/bashDC_NAME="$1"
echo "=== Datacenter Recovery: $DC_NAME ==="
# 1. Verify DC is back onlineecho "1. Checking datacenter status..."nodetool status | grep "$DC_NAME" -A 10
# 2. Re-enable hints for this DC on all nodes via SSHecho ""echo "2. Enabling hints for $DC_NAME..."for node in $(nodetool status | grep "^UN" | awk '{print $2}'); do ssh "$node" "nodetool enablehintsfordc $DC_NAME" 2>/dev/nulldone
# 3. Run repair to restore consistencyecho ""echo "3. Consider running repair for full consistency"echo " nodetool repair -dc $DC_NAME"Impact
Section titled “Impact”When Hints Are Enabled
Section titled “When Hints Are Enabled”| Aspect | Behavior |
|---|---|
| Hint storage | Resumes for DC |
| Coordinator disk | May grow with hints |
| Automatic recovery | Restored |
| Write guarantees | Full coverage |
Troubleshooting
Section titled “Troubleshooting”Hints Not Being Stored After Enable
Section titled “Hints Not Being Stored After Enable”# Verify datacenter name is correctnodetool status
# Check if hints are accumulatingnodetool listpendinghints
# Check for errorsgrep -i "hint" /var/log/cassandra/system.log | tail -10Wrong Datacenter Name
Section titled “Wrong Datacenter Name”# List available datacentersnodetool status | grep "Datacenter:" | awk '{print $2}'
# Use exact datacenter namenodetool enablehintsfordc <exact_name>Best Practices
Section titled “Best Practices”Enable Hints Guidelines
- Verify DC is healthy - Ensure nodes are UP before enabling
- Enable cluster-wide - Run on all coordinator nodes
- Monitor after enable - Watch hint accumulation
- Consider repair - Run repair for extended outages
Default Behavior
By default, hints are enabled for all datacenters. This command is only needed after explicitly disabling hints for a DC.
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| disablehintsfordc | Disable hints for a datacenter |
| enablehandoff | Enable all hinted handoff |
| listpendinghints | List pending hints |
| statushandoff | Check handoff status |