Skip to content

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

Cassandra Rolling Restart

A rolling restart cycles through cluster nodes, restarting each one while maintaining cluster availability. This procedure is used for configuration changes, JVM updates, and routine maintenance.


The following conditions must be met before starting a rolling restart:

RequirementVerification
All nodes should show UN statusnodetool status (proceed with caution if some nodes are down)
No topology changes in progressnodetool netstats
No active repairsnodetool netstats
Schema agreementnodetool describecluster
Terminal window
# Pre-flight verification
nodetool status # All nodes UN
nodetool describecluster # Single schema version
nodetool netstats # No active streaming

AxonOps performs these verification checks automatically before initiating any rolling restart operation.


  • Cluster remains available throughout the restart process
  • No data loss occurs if procedure is followed correctly
  • Client requests continue to be served (with potential latency increase)

For the cluster to maintain consistency during restarts:

Consistency LevelMinimum Nodes RequiredRestart Constraint
ONE1 node upN-1 nodes may be down
QUORUM (RF=3)2 nodes up1 node may be down
LOCAL_QUORUM (RF=3)2 nodes up per DC1 node per DC may be down
ALLAll nodes upNo restarts possible

The standard approach for rolling restarts.

Step 1: Select restart order

Restart order considerations:

ApproachUse Case
Rack-by-rackMaintains rack fault tolerance
Any orderAcceptable when only one node is down at a time

Seed Nodes

Seed nodes do not require special treatment during rolling restarts. Seeds are only used during bootstrap for initial cluster discovery. Once nodes have joined the cluster, they maintain topology information through gossip and do not depend on seeds.

Step 2: Verify all other nodes are UN

Before taking any node down, confirm all other nodes are up and running:

Terminal window
nodetool status

All nodes except the one being restarted must show UN (Up, Normal). If any node shows DN or another state, resolve that issue before proceeding. Taking down a node while another is already down may violate consistency requirements.

Step 3: Drain the node

Before stopping, drain pending writes to disk:

Terminal window
nodetool drain

This flushes memtables and stops accepting writes. The node becomes unresponsive to clients.

Step 4: Stop Cassandra

Terminal window
sudo systemctl stop cassandra

Step 5: Make configuration changes (if applicable)

Terminal window
# Edit cassandra.yaml, jvm.options, etc.
sudo vim /etc/cassandra/cassandra.yaml

Step 6: Start Cassandra

Terminal window
sudo systemctl start cassandra

Step 7: Wait for node to rejoin

Terminal window
# Wait for UN status
watch -n 5 'nodetool status'
# Verify node is serving requests
nodetool info

Step 8: Wait for hint delivery

While the node was down, other nodes accumulated hints for it. These must be delivered before proceeding:

Terminal window
# Check hint delivery progress on OTHER nodes
nodetool tpstats | grep HintedHandoff
# Example output showing pending hints:
# HintedHandoff 0 0 0 0 0
# Active Pending Completed Blocked All time blocked

Wait until Pending column shows 0 on all nodes.

Terminal window
# Alternative: check hints directory size
du -sh /var/lib/cassandra/hints/

Hint Delivery Time

Hint delivery typically completes within seconds for short outages. For longer outages or high write volumes, delivery may take several minutes. Proceeding before hints are delivered risks hint accumulation across multiple nodes. AxonOps monitors hint queue depth across all nodes and waits for delivery completion before proceeding.

Step 9: Verify stability before proceeding

Terminal window
# Check for pending compactions
nodetool compactionstats
# Verify gossip is stable
nodetool gossipinfo | grep STATUS

Wait for the node to stabilize (typically 1-2 minutes) before proceeding to the next node.

Step 10: Repeat for remaining nodes

Continue with each node until all have been restarted. Return to Step 2 for each subsequent node.

Cluster SizeRecommended Wait
< 10 nodesUntil node shows UN
10-50 nodesUN + 1-2 minutes
50+ nodesUN + 2-5 minutes

AxonOps automatically calculates and enforces appropriate wait times based on cluster size and current load metrics.


When racks are configured to match the replication factor, entire racks may be restarted simultaneously while maintaining consistency.

This approach requires:

RequirementExample
Racks ≥ RFRF=3 with 3 racks
Even node distributionSame node count per rack
NetworkTopologyStrategyEnsures one replica per rack

With RF=3 and 3 racks, Cassandra places exactly one replica in each rack:

Token Range X:
├── Replica 1 → Rack1 (Node A)
├── Replica 2 → Rack2 (Node B)
└── Replica 3 → Rack3 (Node C)

If Rack1 is completely down:

  • 2 replicas remain (Rack2 and Rack3)
  • QUORUM (2 of 3) is still achievable
  • All reads and writes at QUORUM succeed

Capacity Impact

When an entire rack is down, remaining nodes handle 50% more load (for RF=3, 3 racks):

  • Normal: Each rack handles 1/3 of requests
  • One rack down: Each remaining rack handles 1/2 of requests
  • Throughput capacity must accommodate this increase

Verify capacity before rack-level restart:

Terminal window
# Check current load metrics
nodetool tpstats
nodetool proxyhistograms
# Ensure headroom exists for 50% load increase

Step 1: Verify all nodes are UN and identify rack to restart

Terminal window
nodetool status
# ALL nodes must show UN before proceeding
# Note nodes in target rack
# Datacenter: dc1
# UN 10.0.1.1 rack1 ← Target
# UN 10.0.1.2 rack1 ← Target
# UN 10.0.1.3 rack2
# UN 10.0.1.4 rack2
# UN 10.0.1.5 rack3
# UN 10.0.1.6 rack3

All nodes in other racks must show UN before taking down any rack. If any node outside the target rack is down, resolve that issue first.

Step 2: Drain all nodes in the rack

Terminal window
# On all rack1 nodes simultaneously
nodetool drain

Step 3: Stop all nodes in the rack

Terminal window
# On all rack1 nodes
sudo systemctl stop cassandra

Step 4: Make configuration changes

Apply changes to all nodes in the rack.

Step 5: Start all nodes in the rack

Terminal window
# On all rack1 nodes
sudo systemctl start cassandra

Step 6: Wait for rack to rejoin

Terminal window
# All rack1 nodes should show UN
nodetool status

Step 7: Wait for hint delivery

While the rack was down, other racks accumulated hints. Wait for delivery to complete:

Terminal window
# On nodes in OTHER racks, check hint delivery
nodetool tpstats | grep HintedHandoff
# Wait until Pending = 0 on all nodes

With rack-level restarts, hint volume is higher since all nodes in the rack were down simultaneously.

Step 8: Verify stability

Terminal window
# Ensure all nodes are serving requests
nodetool info
# Check for streaming completion
nodetool netstats

Step 9: Proceed to next rack

Wait for stability, then repeat for remaining racks.

Rack SizeApproximate Restart Time
2-3 nodes2-5 minutes
5-10 nodes5-10 minutes
10+ nodes10-15 minutes

AxonOps detects rack topology automatically and can perform rack-level rolling restarts when the cluster configuration supports it.


In some scenarios, drain may be skipped:

ScenarioDrain Required
Configuration changeRecommended
JVM restartOptional
Emergency restartSkip
Version upgradeRequired

If drain is skipped:

Terminal window
# Stop without drain
sudo systemctl stop cassandra
# Cassandra flushes memtables on shutdown signal
# Commitlog replays on next start

Trade-offs:

With DrainWithout Drain
Clean shutdownCommitlog replay on start
Faster restartSlightly slower restart
No replay neededMay take 1-2 minutes longer

Terminal window
# On remaining nodes, monitor:
# Client request latency
nodetool proxyhistograms
# Thread pool status
nodetool tpstats
# Pending operations
nodetool compactionstats

During rolling restarts:

  • Expect latency increase (fewer nodes serving requests)
  • Expect elevated load on remaining nodes
  • Suppress alerts for expected node-down events

AxonOps automatically suppresses node-down alerts during scheduled rolling restarts and provides a unified dashboard for monitoring restart progress across all nodes.


Terminal window
# Check logs for errors
tail -100 /var/log/cassandra/system.log | grep -i error
# Common causes:
# - Configuration syntax error
# - Port already in use
# - Insufficient memory
Terminal window
# Check for commitlog replay
grep -i "replaying" /var/log/cassandra/system.log
# Check for schema sync
nodetool describecluster

If issues occur:

  1. Stop the rolling restart
  2. Wait for cluster to stabilize
  3. Investigate the issue
  4. Resume from the last successful node

AxonOps tracks restart progress and allows operations to be paused, investigated, and resumed from any point.


PracticeRationale
Verify cluster health before startingAvoid compounding issues
Wait between nodesAllow stabilization
Monitor throughoutCatch issues early
Restart during low-traffic periodsMinimize client impact
Keep configuration changes minimalEasier troubleshooting
Anti-PatternRisk
Restart multiple non-rack-aligned nodesMay break QUORUM
Skip health checks between nodesMiss cascading failures
Rush through restartsCluster instability
Restart during repairsRepair failures

AxonOps enforces these best practices automatically, preventing operators from accidentally violating safety constraints during rolling restart operations.


AxonOps provides automated rolling restart with built-in safety checks:

  • Pre-flight validation: Verifies cluster health before each node
  • Automatic pacing: Waits for node stability and hint delivery before proceeding
  • Progress tracking: Visual status of restart progress across all nodes
  • Abort capability: Stop at any point if issues arise, resume later
  • Rack awareness: Respects rack topology constraints automatically
  • Scheduling: Schedule rolling restarts during maintenance windows
  • Configuration deployment: Push configuration changes to nodes as part of the restart

See AxonOps Operations for configuration details.