nodetool disablegossip
Disables the gossip protocol, isolating the node from cluster communication.
Synopsis
Section titled “Synopsis”nodetool [connection_options] disablegossipSee connection options for connection options.
Description
Section titled “Description”nodetool disablegossip stops the node from participating in the gossip protocol. This effectively isolates the node from the rest of the cluster while keeping the Cassandra process running.
Gossip Port Configuration
Section titled “Gossip Port Configuration”The gossip protocol uses the storage port for inter-node communication, configured in cassandra.yaml:
storage_port: 7000 # Default inter-node communication port (unencrypted)ssl_storage_port: 7001 # Default inter-node communication port (encrypted)To verify the gossip port is listening:
# Check if Cassandra is listening on the gossip portnetstat -tlnp | grep 7000
# Alternative using ssss -tlnp | grep 7000
# Check the configured ports in cassandra.yamlgrep -E "storage_port|ssl_storage_port" /etc/cassandra/cassandra.yamlPort Remains Open
Unlike disablebinary, the disablegossip command does not close the storage port. The port remains open, but the node stops actively participating in the gossip protocol (no heartbeats sent, no state updates processed).
Gossip is responsible for:
- Cluster membership - Tracking which nodes are in the cluster
- Failure detection - Heartbeats to determine node liveness
- Schema propagation - Distributing DDL changes
- State sharing - Exchanging node metadata
Critical Operation
Disabling gossip is a significant action that isolates the node from the cluster. Other nodes will eventually mark this node as DOWN and stop routing requests to it.
Behavior
Section titled “Behavior”When gossip is disabled:
- The node stops sending heartbeats to other nodes
- The node stops receiving cluster state updates
- Other nodes will mark this node as DOWN (typically within 10-30 seconds)
- Schema changes made elsewhere will not be received
- The node continues running but is cluster-isolated
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”nodetool disablegossipVerify Disabled
Section titled “Verify Disabled”nodetool disablegossipnodetool statusgossip# Expected output: not runningWith Verification on Other Node
Section titled “With Verification on Other Node”# On target nodenodetool disablegossip
# After ~30 seconds, on another nodenodetool status# Target node should show as DN (Down/Normal)When to Use
Section titled “When to Use”Controlled Node Isolation
Section titled “Controlled Node Isolation”Temporarily isolate a node for maintenance:
# Isolate from clusternodetool disablegossip
# Perform maintenance that requires isolation...
# Rejoin clusternodetool enablegossipNetwork Diagnostics
Section titled “Network Diagnostics”Isolate a node to debug network issues:
# Stop gossip trafficnodetool disablegossip
# Capture network traffic without gossip noisetcpdump -i eth0 port 7000
# Re-enable when donenodetool enablegossipTesting Failure Scenarios
Section titled “Testing Failure Scenarios”Simulate node failure for testing:
# Simulate down nodenodetool disablegossip
# Test application behavior with node down
# Restorenodetool enablegossipPre-Shutdown Preparation
Section titled “Pre-Shutdown Preparation”Some maintenance procedures disable gossip before stopping:
# Stop accepting clientsnodetool disablebinary
# Stop gossip (isolated)nodetool disablegossip
# Node is now isolated before actual shutdownWhen NOT to Use
Section titled “When NOT to Use”Avoid in These Scenarios
- Extended periods in production - Node will be excluded from cluster operations
- Without a recovery plan - Always know how to re-enable
- Instead of drain - For graceful shutdown, use
draininstead - For load reduction - Use
disablebinaryto stop client connections instead
Prefer drain for Shutdown
Section titled “Prefer drain for Shutdown”For graceful shutdown, use drain rather than disablegossip:
# Correct: Graceful shutdownnodetool drain
# Incorrect: Using disablegossip for shutdownnodetool disablegossip # Leaves node in ambiguous stateWorkflow: Controlled Isolation
Section titled “Workflow: Controlled Isolation”# 1. Document current statenodetool statusnodetool statusgossip
# 2. First disable client connectionsnodetool disablebinary
# 3. Wait for in-flight requests to completesleep 10
# 4. Disable gossip (full isolation)nodetool disablegossip
# 5. Verify isolationnodetool statusgossip # not runningnodetool statusbinary # not running
# 6. Perform maintenance...
# 7. Re-enable in correct ordernodetool enablegossipsleep 5 # Allow cluster synchronizationnodetool enablebinary
# 8. Verify restorednodetool status # Node should be UNOrder of Operations
Section titled “Order of Operations”Isolating a Node
Section titled “Isolating a Node”| Step | Command | Effect |
|---|---|---|
| 1 | disablebinary | Stop new client connections |
| 2 | Wait for requests | Allow in-flight operations to complete |
| 3 | disablegossip | Isolate from cluster |
Restoring a Node
Section titled “Restoring a Node”| Step | Command | Effect |
|---|---|---|
| 1 | enablegossip | Rejoin cluster first |
| 2 | Wait 5-10 seconds | Allow state synchronization |
| 3 | enablebinary | Accept client connections |
Impact on Cluster
Section titled “Impact on Cluster”Immediate Effects
Section titled “Immediate Effects”| Aspect | Impact |
|---|---|
| Heartbeats | Stop immediately |
| Cluster view | Node has stale information |
| Schema sync | No updates received |
| New nodes | Won't learn about them |
Delayed Effects (10-30 seconds)
Section titled “Delayed Effects (10-30 seconds)”| Aspect | Impact |
|---|---|
| Node status | Marked as DOWN by others |
| Request routing | Traffic redirected to other nodes |
| Replication | This node excluded from writes |
| Hint storage | Hints stored for this node on coordinators |
Long-term Effects
Section titled “Long-term Effects”| Aspect | Impact |
|---|---|
| Data consistency | May need repair after rejoining |
| Hints | May accumulate on other nodes |
| Schema drift | May miss schema changes |
Gossip vs Binary vs Drain
Section titled “Gossip vs Binary vs Drain”| Command | Gossip | Binary | Use Case |
|---|---|---|---|
disablegossip | Disabled | Unchanged | Network debugging, testing |
disablebinary | Running | Disabled | Stop clients, stay in cluster |
drain | Disabled | Disabled | Graceful shutdown |
State Combinations
Section titled “State Combinations”| Gossip | Binary | Node State | Description |
|---|---|---|---|
| Running | Running | Fully operational | Normal state |
| Running | Disabled | In cluster, no clients | Maintenance mode |
| Disabled | Running | Dangerous | Accepts requests but isolated |
| Disabled | Disabled | Fully isolated | Prepared for shutdown |
Avoid Gossip Disabled + Binary Enabled
Never disable gossip while leaving binary enabled. The node would accept client requests but cannot properly coordinate with the cluster, leading to consistency issues.
Verification
Section titled “Verification”On the Node
Section titled “On the Node”nodetool statusgossip# Expected: not runningFrom Other Nodes
Section titled “From Other Nodes”# After 30 secondsnodetool status | grep <node_ip># Should show DN (Down/Normal)Check Gossip Info
Section titled “Check Gossip Info”# On another node, check gossip statenodetool gossipinfo | grep -A10 <node_ip>Troubleshooting
Section titled “Troubleshooting”Node Won't Isolate
Section titled “Node Won't Isolate”If status still shows "running":
# Retrynodetool disablegossip
# Check logstail /var/log/cassandra/system.log | grep -i gossipOther Nodes Don't See Change
Section titled “Other Nodes Don't See Change”If other nodes still show this node as UP:
# Wait longer (gossip failure detection takes time)sleep 60
# Check from multiple nodesfor node in node2 node3; do echo "=== $node ===" ssh "$node" "nodetool status | grep <this_node>"doneRecovery Issues
Section titled “Recovery Issues”If gossip won't re-enable after maintenance:
# Check JMX is respondingnodetool info
# Try enablingnodetool enablegossip
# If still failing, may need restart# (as last resort)Monitoring During Isolation
Section titled “Monitoring During Isolation”Track Node Status
Section titled “Track Node Status”# From another node, monitor status changewatch -n 5 'nodetool status'Check Hints Accumulation
Section titled “Check Hints Accumulation”# On other nodes, hints will accumulate for isolated nodenodetool tpstats | grep -i hintMonitor Logs
Section titled “Monitor Logs”# On isolated nodetail -f /var/log/cassandra/system.log | grep -i gossipAutomation Script
Section titled “Automation Script”#!/bin/bash# isolate_node.sh - Safely isolate a node from the cluster
echo "=== Current State ==="echo "Gossip: $(nodetool statusgossip)"echo "Binary: $(nodetool statusbinary)"
echo ""echo "=== Isolating Node ==="
# Step 1: Disable binary firstecho "Disabling client connections..."nodetool disablebinarysleep 5
# Step 2: Disable gossipecho "Disabling gossip (isolating from cluster)..."nodetool disablegossip
# Verifyecho ""echo "=== Verification ==="echo "Gossip: $(nodetool statusgossip)" # Should be: not runningecho "Binary: $(nodetool statusbinary)" # Should be: not running
echo ""echo "Node is now isolated from the cluster."echo "Other nodes will mark this node as DOWN within 30 seconds."echo ""echo "To rejoin cluster:"echo " nodetool enablegossip"echo " sleep 5"echo " nodetool enablebinary"Best Practices
Section titled “Best Practices”Gossip Disable Guidelines
- Document the reason - Note why gossip was disabled
- Set time limits - Don't leave disabled indefinitely
- Disable binary first - Stop clients before isolating
- Monitor other nodes - Watch for impact on cluster
- Plan recovery - Know the steps to re-enable
- Use drain for shutdown - Prefer
drainover manual gossip disable - Test in non-production - Understand behavior before using in production
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| enablegossip | Re-enable gossip protocol |
| statusgossip | Check gossip status |
| gossipinfo | View detailed gossip state |
| disablebinary | Disable CQL connections |
| drain | Graceful shutdown preparation |
| status | View cluster status |