Skip to content

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

nodetool disablebinary

Disables the CQL native transport, stopping the node from accepting new client connections.


Terminal window
nodetool [connection_options] disablebinary

See connection options for connection options.

nodetool disablebinary disables the CQL native transport protocol, which handles all CQL client connections. Once disabled, the node stops listening on the native transport port, and existing connections are terminated.

The native transport port is configured in cassandra.yaml:

native_transport_port: 9042 # Default CQL port

To verify the current port and whether it is listening:

Terminal window
# Check if Cassandra is listening on the CQL port
netstat -tlnp | grep 9042
# Alternative using ss
ss -tlnp | grep 9042
# Check the configured port in cassandra.yaml
grep native_transport_port /etc/cassandra/cassandra.yaml

This command is commonly used for:

  • Controlled maintenance - Stop new traffic before maintenance
  • Load shedding - Remove node from client traffic during issues
  • Graceful node removal - First step before gossip disable or drain
  • Rolling restarts - Prevent traffic during restart procedure

Client Impact

Disabling binary causes clients to lose their connection to this node. Ensure CQL drivers are configured with multiple contact points so they can failover to other nodes.


When binary transport is disabled:

  1. The node stops listening on the native transport port
  2. New connection attempts are refused
  3. Existing connections are terminated (may take a few seconds)
  4. The node remains in the cluster and participates in gossip
  5. The node can still receive replicated writes (as a replica, not coordinator)

Terminal window
nodetool disablebinary
Terminal window
nodetool disablebinary
nodetool statusbinary
# Expected output: not running
Terminal window
nodetool disablebinary
sleep 2
netstat -tlnp | grep 9042
# Should return nothing (port not listening)

Stop client traffic before maintenance:

Terminal window
# Stop accepting new clients
nodetool disablebinary
# Wait for in-flight requests
sleep 10
# Perform maintenance...
# Restore client access
nodetool enablebinary

Graceful traffic removal before restart:

Terminal window
# Remove from client traffic
nodetool disablebinary
# Wait for connections to drain
sleep 30
# Perform drain for graceful shutdown
nodetool drain
# Restart
systemctl restart cassandra

Temporarily remove an overloaded node from client traffic:

Terminal window
# Check current load
nodetool tpstats # Look for backed up requests
# Remove from client traffic
nodetool disablebinary
# Address the issue...
# Restore
nodetool enablebinary
Terminal window
# Step 1: Remove from client traffic
nodetool disablebinary
sleep 10
# Step 2: Wait for in-flight operations
nodetool tpstats # Verify queues drain
# Step 3: Drain and stop
nodetool drain
systemctl stop cassandra
# Step 4: Perform upgrade...
# Step 5: Start Cassandra (binary auto-enables)
systemctl start cassandra
# Step 6: Verify
nodetool statusbinary # Should be: running

For full isolation, disable binary first, then gossip:

Terminal window
# Step 1: Stop client traffic
nodetool disablebinary
# Step 2: Wait for requests to complete
sleep 15
# Step 3: Isolate from cluster
nodetool disablegossip

When binary is disabled:

PhaseDurationClient Experience
Immediate0-1 secondNew connections refused
Short-term1-10 secondsExisting queries may complete
Cleanup10-30 secondsAll connections terminated

Most CQL drivers handle this gracefully:

Driver FeatureBehavior
Connection poolingDetects closed connections, removes from pool
FailoverRoutes to other nodes automatically
ReconnectionAttempts reconnect per policy
Request retryRetries on different coordinator

StepCommandWaitReason
1disablebinary10-30sStop new client traffic
2WaitvariesAllow in-flight requests to complete
3Maintenance-Perform the actual maintenance
4enablebinary2sRestore client access
5Verify-Confirm clients can connect
StepCommandWaitReason
1disablebinary10sStop clients
2drainvariesFlush data, stop gossip
3Stop service-Shutdown process

CommandBinaryGossipMemtablesUse Case
disablebinaryDisabledRunningIn memoryMaintenance (stay in cluster)
disablegossipUnchangedDisabledIn memoryNetwork isolation
drainDisabledDisabledFlushedGraceful shutdown
ScenarioUse
Quick maintenance, stay in clusterdisablebinary
Network debugging, isolationdisablegossip
Node restart or shutdowndrain
Full isolation before shutdowndisablebinarydisablegossip

Terminal window
nodetool statusbinary
# Expected: not running
Terminal window
# Port should not be listening
netstat -tlnp | grep 9042
# (no output expected)
ss -tlnp | grep 9042
# (no output expected)
Terminal window
# Before disable - count connections
netstat -an | grep 9042 | grep ESTABLISHED | wc -l
# Output: 42
# After disable
nodetool disablebinary
sleep 5
netstat -an | grep 9042 | grep ESTABLISHED | wc -l
# Output: 0

AspectImpact
Client connectionsRefused
Coordinator roleCannot serve as coordinator
Replica roleStill receives writes from coordinators
GossipStill participating
Cluster membershipStill visible as UP
AspectImpact
Client capacityReduced by one node
Coordinator loadDistributed to other nodes
ReplicationUnchanged (node still receives replicas)
ConsistencyUnchanged (if RF > 1)
AspectImpact
Active connectionsTerminated
New connectionsRefused, failover to other nodes
In-flight requestsMay fail or retry
Request latencyMay increase (fewer coordinators)

Terminal window
# Count current connections
netstat -an | grep 9042 | grep ESTABLISHED | wc -l
# Check for active requests
nodetool tpstats | grep -E "Native|Request"
Terminal window
# Watch connections drain
watch 'netstat -an | grep 9042 | wc -l'
Terminal window
# Verify status
nodetool statusbinary
# Check other nodes absorbed traffic
ssh other_node "nodetool tpstats"

If status still shows "running":

Terminal window
# Retry
nodetool disablebinary
# Check JMX connectivity
nodetool info
# Check logs
tail /var/log/cassandra/system.log | grep -i binary

If connections persist after disable:

Terminal window
# Check TIME_WAIT connections (normal)
netstat -an | grep 9042 | grep TIME_WAIT | wc -l
# These will clear automatically in ~60 seconds

If clients report errors instead of failing over:

Terminal window
# Check client driver configuration:
# - Multiple contact points configured?
# - Reconnection policy enabled?
# - Appropriate retry policy?
# Check other nodes are healthy
nodetool status

#!/bin/bash
# disable_client_access.sh - Safely remove node from client traffic
echo "=== Current State ==="
echo "Binary: $(nodetool statusbinary)"
echo "Connections: $(netstat -an 2>/dev/null | grep 9042 | grep ESTABLISHED | wc -l)"
echo ""
echo "=== Disabling Binary Transport ==="
# Disable binary
nodetool disablebinary
# Wait for connections to drain
echo "Waiting for connections to drain..."
for i in {1..30}; do
conns=$(netstat -an 2>/dev/null | grep 9042 | grep ESTABLISHED | wc -l)
if [ "$conns" -eq 0 ]; then
echo "All connections drained"
break
fi
echo " Remaining connections: $conns"
sleep 1
done
# Verify
echo ""
echo "=== Verification ==="
echo "Binary: $(nodetool statusbinary)"
echo "Connections: $(netstat -an 2>/dev/null | grep 9042 | grep ESTABLISHED | wc -l)"
# Check node still in cluster
echo ""
echo "=== Cluster Status ==="
nodetool status | head -10
echo ""
echo "Node removed from client traffic but still in cluster."
echo "To restore: nodetool enablebinary"

ScenarioRecommended Wait After Disable
Quick config change5-10 seconds
Rolling restart30-60 seconds
Before drain10-30 seconds
Heavy load node60-120 seconds
Terminal window
# Check current request rate
nodetool proxyhistograms | head -5
# General rule: wait until tpstats shows minimal pending
nodetool tpstats | grep -E "Native|Read|Write"
# Wait until "Pending" columns are near zero

Binary Disable Guidelines

  1. Monitor before disabling - Know current connection count and load
  2. Allow drain time - Wait for in-flight requests to complete
  3. Verify client failover - Ensure clients connect to other nodes
  4. Keep gossip running - Node stays in cluster for replication
  5. Document the action - Note when and why binary was disabled
  6. Set time limits - Don't leave disabled indefinitely
  7. Re-enable promptly - Restore client access after maintenance

CommandRelationship
enablebinaryRe-enable CQL transport
statusbinaryCheck transport status
disablegossipDisable gossip (further isolation)
drainFull graceful shutdown prep
tpstatsMonitor request handling
netstatsNetwork/streaming statistics