Skip to content

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

nodetool ring

Displays the token ring information showing token assignments for each node in the cluster.


Terminal window
nodetool [connection_options] ring [options] [keyspace]

See connection options for connection options.

OptionDescription
-r, --resolve-ipShow DNS names instead of IP addresses

nodetool ring displays detailed token ring information including:

  • Token values assigned to each node
  • Node addresses and their datacenter/rack placement
  • Load and ownership statistics

This command is useful for understanding data distribution and troubleshooting token-related issues.

In modern Cassandra deployments, each node owns multiple virtual nodes (vnodes) rather than a single token. The number of vnodes per node is configured in cassandra.yaml:

num_tokens: 16 # Default in Cassandra 4.0+
# Older versions defaulted to 256, some used 16

With vnodes enabled, nodetool ring output shows one row per token, meaning a 3-node cluster with num_tokens: 256 displays 768 rows (256 × 3 nodes). Each row represents a token range boundary owned by a node.

Terminal window
# Count tokens per node
nodetool ring | grep -c "192.168.1.101"
# Output: 16 (if num_tokens: 16)

Why vnodes matter:

AspectSingle Token (Legacy)Virtual Nodes
Tokens per node1Typically 16-256
Data distributionCan be unevenMore uniform
Adding nodesLarge data movementSmaller, distributed transfers
Removing nodesLarge data movementSmaller, distributed transfers
Streaming impactHigh (all data at once)Lower (distributed)
Hot spotsMore likelyLess likely

Checking vnode Configuration

Terminal window
# Check num_tokens setting
grep num_tokens /etc/cassandra/cassandra.yaml
# Verify tokens per node in the cluster
nodetool ring | awk '{print $1}' | sort | uniq -c | sort -rn

ArgumentDescription
keyspaceOptional. Show ownership for specific keyspace's replication strategy

Datacenter: dc1
==========
Address Rack Status State Load Owns Token
9223372036854775807
192.168.1.101 rack1 Up Normal 256.12 GiB 33.33% -9223372036854775808
192.168.1.102 rack2 Up Normal 248.87 GiB 33.34% -6148914691236517206
192.168.1.103 rack3 Up Normal 251.44 GiB 33.33% -3074457345618258604
192.168.1.101 rack1 Up Normal 256.12 GiB 33.33% -2
192.168.1.102 rack2 Up Normal 248.87 GiB 33.34% 3074457345618258600
192.168.1.103 rack3 Up Normal 251.44 GiB 33.33% 6148914691236517202

FieldDescription
AddressIP address of the node
RackRack assignment from snitch
StatusUp or Down
StateNormal, Leaving, Joining, or Moving
LoadData size on this node
OwnsPercentage ownership of data
TokenToken value (end of range owned)

Terminal window
nodetool ring

Displays all tokens for all nodes.

Terminal window
nodetool ring my_keyspace

Shows ownership percentages based on the keyspace's replication factor.

Terminal window
nodetool ring | grep "192.168.1.101" | wc -l

Counts the number of tokens (vnodes) for a specific node.

Terminal window
nodetool ring | grep "192.168.1.101" | awk '{print $NF}'

Lists all tokens owned by a specific node.


Each token value represents the end of a range that a node owns:

NodeTokenRange Owned
Node A-3074...From previous token to -3074...
Node B-6148...From previous token to -6148...
Node C-4611...From previous token to -4611...

With vnodes, each node owns multiple non-contiguous ranges distributed around the ring for better load balancing.

Each token value represents the end of a range that a node owns. Data with partition tokens up to and including this value is stored on this node.

Node A owns token -3074457345618258604
Node B owns token -6148914691236517206
Range for Node A: -6148914691236517206 < token <= -3074457345618258604

With vnodes enabled (recommended), tokens should be:

  • Evenly distributed across nodes
  • Each node has the same number of tokens (typically 256)
  • Ownership percentages roughly equal
192.168.1.101 rack1 Up Normal 256.12 GiB 33.33% 0
192.168.1.102 rack2 Up Normal 248.87 GiB 33.34% 3074457345618258602
192.168.1.103 rack3 Up Normal 251.44 GiB 33.33% 6148914691236517204

Single Token Nodes

Single-token setups (one token per node) are legacy configurations. They:

  • Make adding/removing nodes very disruptive
  • Can cause uneven data distribution
  • Should be migrated to vnodes for new clusters

If ownership percentages vary significantly (>5%):

CauseSolution
Different num_tokens settingsStandardize configuration
Manual token assignment issuesUse vnode auto-assignment
Recent topology changesWait for streaming to complete

ScenarioPurpose
Debugging data distributionUnderstand which nodes own what ranges
Planning node additionsSee current token landscape
Investigating hot spotsIdentify if specific ranges are overloaded
Migration planningDocument current token assignments
Troubleshooting queriesUnderstand why queries hit specific nodes

Prefer Other Commands

  • For quick health checks: Use nodetool status instead
  • For replica locations: Use nodetool getendpoints for specific keys
  • For continuous monitoring: Use metrics, not manual commands

Datacenter: dc1
==========
Address Rack Status State Load Owns Token
192.168.1.101 rack1 Up Normal 256.12 GiB 16.67% -9223372036854775808
192.168.1.102 rack2 Up Normal 248.87 GiB 16.67% -3074457345618258604
Datacenter: dc2
==========
Address Rack Status State Load Owns Token
192.168.2.101 rack1 Up Normal 256.12 GiB 16.67% -9223372036854775808
192.168.2.102 rack2 Up Normal 248.87 GiB 16.67% -3074457345618258604

With NetworkTopologyStrategy and multiple datacenters:

  • Tokens may overlap across DCs (same token in different DCs)
  • Each DC manages its own replica set
  • Ownership percentages reflect global distribution

For more detailed output including Host IDs:

Terminal window
nodetool describering my_keyspace

This shows token ranges with start and end tokens plus replica endpoints.


Owns: ?

Ownership calculation requires a keyspace with defined replication:

Terminal window
nodetool ring my_keyspace

If a node doesn't appear in the ring output:

  1. Check if node is running
  2. Verify nodetool status shows the node
  3. Check for gossip issues with nodetool gossipinfo

Duplicate tokens across nodes (same DC) indicate configuration errors:

Duplicate Tokens

Duplicate tokens cause data inconsistency. Never manually assign the same token to multiple nodes in the same datacenter.


CommandRelationship
statusSimpler cluster overview
getendpointsFind replicas for specific key
infoSingle node details