Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

nodetool failuredetector

Displays the failure detector information for the cluster.


Terminal window
nodetool [connection_options] failuredetector

See connection options for connection options.

nodetool failuredetector displays information about Cassandra's failure detector, which monitors the health of nodes in the cluster using the Phi Accrual Failure Detector algorithm. This information helps understand how the cluster perceives node health and connectivity.

The failure detector uses gossip heartbeats to calculate a "phi" value representing the likelihood that a node has failed. When phi exceeds the configured threshold, the node is marked as down.


Terminal window
nodetool failuredetector

Endpoint,Phi
192.168.1.101,0.0034521
192.168.1.102,0.0028934
192.168.1.103,0.0041256
192.168.1.104,5.2341567

Note: Output is in CSV format with comma-separated values.

Phi ValueInterpretation
0 - 0.5Very healthy, recent heartbeat
0.5 - 5Healthy, normal range
5 - 8Elevated, possible issues
> 8Likely down (default threshold)

How Phi is Calculated:
1. Each node sends periodic heartbeats via gossip
2. Receiving nodes track heartbeat arrival times
3. Statistical analysis calculates expected arrival time
4. Phi = -log10(P(heartbeat will still arrive))
5. Higher phi = higher probability of failure
cassandra.yaml
phi_convict_threshold: 8

A node is marked DOWN when phi exceeds this threshold.


Terminal window
# Check all nodes' phi values
nodetool failuredetector
# Identify nodes with elevated phi
nodetool failuredetector | awk '$2 > 1 {print}'

When experiencing intermittent connectivity:

Terminal window
# Monitor phi values over time
watch -n 5 'nodetool failuredetector'

Before cluster operations:

Terminal window
# Ensure all nodes are healthy
nodetool failuredetector
# All phi values should be low

monitor_failure_detector.sh
#!/bin/bash
THRESHOLD=5.0
echo "=== Failure Detector Check ==="
echo ""
# Get failure detector info
nodetool failuredetector | tail -n +2 | while read endpoint phi; do
# Compare phi to threshold
elevated=$(echo "$phi > $THRESHOLD" | bc -l)
if [ "$elevated" -eq 1 ]; then
echo "WARNING: $endpoint has elevated phi: $phi"
else
echo "OK: $endpoint phi=$phi"
fi
done

cluster_failure_detector.sh
#!/bin/bash
echo "=== Cluster Failure Detector Status ==="
# Get list of node IPs from local nodetool status
nodes=$(nodetool status | grep "^UN\|^DN" | awk '{print $2}')
for node in $nodes; do
echo ""
echo "=== From perspective of $node ==="
ssh "$node" "nodetool failuredetector 2>/dev/null || echo 'Cannot connect to $node'"
done

If a node shows consistently high phi:

Terminal window
# Check network connectivity
ping <node_ip>
# Check if node is under load
ssh <node_ip> "nodetool tpstats"
# Check for GC issues
ssh <node_ip> "nodetool gcstats"

Indicates network instability:

Terminal window
# Check for network issues
traceroute <node_ip>
# Monitor over time
for i in {1..60}; do
echo "$(date): $(nodetool failuredetector | grep <node_ip>)"
sleep 10
done

If a healthy node is marked down:

Terminal window
# Check phi threshold
grep phi_convict_threshold /etc/cassandra/cassandra.yaml
# Consider adjusting if network is high-latency
# Higher threshold = more tolerant of delays

cassandra.yaml
phi_convict_threshold: 8 # Default
# For high-latency networks, consider increasing:
# phi_convict_threshold: 12
FactorEffect on Phi
Network latencyHigher latency → higher phi
GC pausesLong GC → spikes in phi
CPU loadHigh load → delayed heartbeats
Network packet lossMissing heartbeats → elevated phi

Failure Detector Guidelines

  1. Regular monitoring - Include in health checks
  2. Baseline values - Know normal phi ranges for your cluster
  3. Alert on elevated phi - Before nodes are marked down
  4. Investigate spikes - Don't ignore temporary elevations
  5. Tune threshold - Adjust for network characteristics

Healthy Cluster Indicators

  • All phi values < 1.0
  • Values stable over time
  • No sudden spikes
  • Symmetric across nodes (A sees B same as B sees A)

CommandRelationship
gossipinfoDetailed gossip state
statusCluster status overview
infoNode information
netstatsNetwork statistics