Skip to content

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

Cassandra Node Lifecycle

This section describes the complete lifecycle of a Cassandra node from initial cluster join through eventual removal. Understanding these state transitions is essential for operational management, troubleshooting, and capacity planning.


Cassandra nodes progress through well-defined states during their lifecycle:

Node Lifecycle State MachineNode Lifecycle State MachineNEW(unconfigured)STARTINGJOINING(bootstrap)NORMAL(operational)LEAVING(decommission)MOVING(rebalance)LEFT(removed)DOWN(failed)startcontact seedsbootstrap completedecommissionstreaming completemove tokenmove completefailure detectedrecoveryremovenode
StateGossip STATUSDescription
STARTING-Node process started, not yet joined cluster
JOININGBOOTBootstrapping, streaming data from existing nodes
NORMALNORMALFully operational, serving client requests
LEAVINGLEAVINGDecommissioning, streaming data to remaining nodes
MOVINGMOVINGToken reassignment in progress
LEFTLEFTRemoved from cluster, no longer participating
DOWN-Failure detected (local determination, not gossiped)

Bootstrap is the process by which a new node joins an existing cluster and receives its share of data.

Bootstrap ProcessBootstrap ProcessNode StartsReads cassandra.yamlContact SeedsRequest cluster stateReceive Gossip StateLearn all endpointsCalculate Tokens(vnodes: automatic)Determine RangesIdentify data to receiveAnnounce JOININGGossip to clusterStream DataReceive SSTablesAnnounce NORMALAccept client trafficPhase 1: DiscoveryPhase 2: Token AllocationPhase 3: StreamingPhase 4: Activation
# cassandra.yaml - Bootstrap settings
# Enable/disable automatic bootstrap
# Set to false only for first node in cluster
auto_bootstrap: true
# Number of virtual nodes per physical node
num_tokens: 16
# Initial token (only if num_tokens = 1, not recommended)
# initial_token:
# Allocate tokens using random or algorithm-based approach
allocate_tokens_for_keyspace: <keyspace_name> # Optional, for better distribution

During bootstrap, the new node streams data from existing replicas:

AspectDescription
Source selectionPrefers local datacenter, least-loaded nodes
Range calculationBased on new node's tokens and RF
ParallelismConcurrent streams from multiple sources
Resume capabilityCan resume after failures (Cassandra 4.0+)

Streaming source selection algorithm:

  1. Identify all ranges new node should own
  2. For each range, identify replica set
  3. Select replica based on:
    • Prefer same datacenter
    • Prefer least-loaded node
    • Avoid nodes already streaming

Bootstrap time depends on:

FactorImpact
Data volumeLinear with total data size
Network bandwidthLimited by stream_throughput_outbound_megabits_per_sec
Number of rangesMore ranges = more coordination overhead
Compaction during streamingMay delay completion

Estimation formula:

Time ≈ (Data per node × RF) / Stream throughput
Example: (500GB × 3) / 200Mbps ≈ 1.7 hours
Terminal window
# Check bootstrap progress
nodetool netstats
# Sample output during bootstrap:
# Mode: JOINING
# /10.0.1.2
# Receiving 234 files, 45GB total. Already received 156 files, 30GB.
# Check node status
nodetool status
# Shows UJ (Up Joining) during bootstrap
# View detailed streaming
nodetool netstats -H

A node in NORMAL state:

  • Owns specific token ranges
  • Serves as replica for data within RF
  • Accepts client read/write requests
  • Participates in gossip protocol
  • Reports metrics and health status

Each node owns ranges of the token ring:

TokenRing Token Ring Ownership (3 nodes, 4 tokens each) t0 0 t25 25 t0->t25 t50 50 t25->t50 t75 75 t50->t75 t100 100 t75->t100 t125 125 t100->t125 t125->t0 la Node A lb Node B lc Node C
IndicatorHealthyWarningCritical
Gossip stateNORMALJOINING/MOVINGDOWN
Pending compactions< 2020-100> 100
Dropped messages0< 1%> 1%
GC pause< 500ms500ms-1s> 1s

Decommission is the orderly removal of a node, ensuring all data is transferred to remaining nodes.

Decommission ProcessDecommission Process1. Initiate Decommissionnodetool decommission2. Announce LEAVINGGossip to cluster3. Calculate TargetsDetermine new owners4. Stream DataTransfer to new owners5. Announce LEFTRemove from ring6. ShutdownProcess terminates
Terminal window
# Initiate decommission (run on node being removed)
nodetool decommission
# This command:
# - Blocks until complete
# - Can be cancelled with nodetool abortdecommission
# - Requires RF nodes remain after removal
RequirementVerification
Sufficient remaining capacityCheck disk usage on remaining nodes
Replication factor satisfiedN - 1 ≥ RF for all keyspaces
No pending repairsnodetool repair_admin list
Gossip healthynodetool gossipinfo shows all nodes

During decommission, data transfers to new replica owners:

Data Redistribution During DecommissionData Redistribution During DecommissionBefore (RF=3)AfterRange XNode A(leaving)Node BNode CRange XNode BNode CNode D(new replica)replica 1replica 2replica 3replica 1replica 2replica 3stream data
Terminal window
# Check decommission progress
nodetool netstats
# Sample output:
# Mode: LEAVING
# /10.0.1.4
# Sending 456 files, 89GB total. Already sent 234 files, 45GB.
# Node status shows UL (Up Leaving)
nodetool status

The move operation reassigns a node's token position without removing it from the cluster:

Terminal window
# Move node to new token (single-token nodes only)
nodetool move <new_token>
# Not recommended with vnodes (num_tokens > 1)

Move Limitations

Token movement is generally discouraged with vnodes. For capacity rebalancing, add/remove nodes instead of moving tokens.


When a node fails, the cluster detects and responds:

Node Failure Detection and ResponseNode Failure Detection and ResponseNode Fails(crash, network, etc.)Phi Accrual Detectionφ exceeds thresholdMark as DOWNLocal failure detector determinationStore HintsFor failed nodeRoute AroundExclude from reads
ResponseDescription
Hints storedCoordinator stores writes destined for failed node
Reads reroutedFailed node excluded from read replica selection
Writes continueIf CL satisfied by remaining replicas
No automatic replacementManual intervention required

When a failed node recovers:

  1. Gossip reconnection: Node contacts seeds/peers
  2. State synchronization: Receives current cluster state
  3. Hint replay: Receives stored hints from other nodes
  4. Gradual inclusion: Phi detector marks as UP after successful communication
Terminal window
# After node restart, verify recovery
nodetool status # Should show UN (Up Normal)
nodetool gossipinfo # Verify gossip state
nodetool tpstats # Check for hint replay activity

Terminal window
# View cluster status
nodetool status
# Status output interpretation:
# UN = Up Normal (healthy)
# UJ = Up Joining (bootstrapping)
# UL = Up Leaving (decommissioning)
# UM = Up Moving (token movement)
# DN = Down Normal (failed)
# Detailed gossip state
nodetool gossipinfo
# Ring ownership
nodetool ring
CommandEffectUse Case
nodetool decommissionNORMAL → LEAVING → LEFTOrderly node removal
nodetool removenode <host_id>Force remove dead nodeNode permanently failed
nodetool assassinate <ip>Force remove stuck nodeEmergency only
nodetool move <token>Change token assignmentRebalancing (not recommended with vnodes)

Destructive Operations

The following commands can cause data loss if used incorrectly.

Terminal window
# Force remove a dead node (use when node is unrecoverable)
nodetool removenode <host_id>
# Force remove a stuck node (emergency only)
nodetool assassinate <ip_address>
# These commands:
# - Do NOT stream data
# - May require subsequent repair
# - Should be last resort

  1. Verify cluster health: nodetool status shows all UN
  2. Check pending operations: No ongoing repairs, bootstraps
  3. Ensure sufficient capacity: Remaining nodes can handle load
  4. Backup if critical: Consider snapshots before major changes
  • Schedule during low-traffic periods
  • Monitor streaming progress
  • Watch for compaction backlog on existing nodes
  • Verify RF nodes will remain
  • Allow sufficient time for completion
  • Do not force-kill the process
  • Verify nodetool status shows expected state
  • Run repair on affected ranges if needed
  • Monitor for any performance degradation