Skip to content

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

Cassandra nodetool Reference

nodetool is the primary command-line interface for managing and monitoring Apache Cassandra nodes. It communicates with the Cassandra process via JMX (Java Management Extensions) to perform administrative operations.


nodetool connects to the local Cassandra node via JMX on port 7199:

Terminal window
# Default connection (localhost:7199)
nodetool status
# With authentication (when JMX authentication is enabled)
nodetool -u admin -pw password status
# With password file (recommended for scripts)
nodetool -u admin -pwf /path/to/jmx_password_file status

Local Execution Recommended

By default, Cassandra binds the JMX port (7199) to localhost only. This is the recommended configuration for security reasons. All nodetool commands should be executed locally on each Cassandra node rather than remotely. This approach:

  • Eliminates JMX network exposure and associated security risks
  • Removes the need for complex JMX-over-network authentication setup
  • Simplifies firewall configurations
  • Aligns with security best practices for JMX management

For cluster-wide operations, use SSH to execute nodetool commands on each node, or use orchestration tools like Ansible.

OptionDescription
-h, --hostTarget host (default: localhost). Use only when JMX is bound to a non-localhost interface.
-p, --portJMX port (default: 7199)
-u, --usernameJMX username
-pw, --passwordJMX password
-pwf, --password-fileFile containing JMX password
--sslUse SSL for JMX connection

JMX Security

  • The default JMX binding to localhost is intentional and should not be changed unless absolutely necessary
  • If remote JMX access is required, enable JMX authentication and SSL encryption
  • Never expose unauthenticated JMX ports to untrusted networks
  • Consider using SSH tunneling instead of exposing JMX ports directly

Most nodetool commands are available across all Cassandra 4.x and 5.x versions. The tables below list commands introduced in specific versions.

CommandDescription
datapathsDisplay data file locations
getauditlogGet audit log configuration
getauthcacheconfigGet auth cache configuration
getcolumnindexsizeGet column index size
getdefaultrfGet default replication factor
invalidatecredentialscacheInvalidate credentials cache
invalidatejmxpermissionscacheInvalidate JMX permissions cache
invalidatenetworkpermissionscacheInvalidate network permissions cache
invalidaterolescacheInvalidate roles cache
listpendinghintsList pending hints
recompress_sstablesRecompress SSTables
setauthcacheconfigSet auth cache configuration
setcolumnindexsizeSet column index size
setdefaultrfSet default replication factor
CommandDescription
checktokenmetadataCheck token metadata for inconsistencies
cidrfilteringstatsDisplay CIDR filtering statistics
dropcidrgroupRemove CIDR group
forcecompactForce user-defined compaction
getcidrgroupsofipGet CIDR groups for an IP
getguardrailsconfigGet guardrails configuration
invalidatecidrpermissionscacheInvalidate CIDR permissions cache
listcidrgroupsList all CIDR groups
reloadcidrgroupscacheReload CIDR groups cache
setguardrailsconfigSet guardrails configuration
updatecidrgroupCreate or update CIDR group

Commands for viewing cluster state and metadata.

CommandDescription
statusDisplay cluster status and load information
ringDisplay token ring information
infoDisplay node information
describeclusterDisplay cluster name, snitch, and partitioner
describeringDisplay token ranges for a keyspace
gossipinfoDisplay gossip information
versionDisplay Cassandra version
getendpointsDisplay endpoints for a key
datapathsDisplay data file locations
helpDisplay help information

Commands for managing cluster membership.

CommandDescription
decommissionRemove node from cluster gracefully
removenodeRemove a dead node from cluster
assassinateForce remove an unresponsive node
rebuildRebuild data from other datacenters
drainDrain the node before shutdown
stopdaemonStop Cassandra daemon
bootstrapResume bootstrap operation
joinJoin the ring after bootstrap
moveMove node to new token
failuredetectorDisplay failure detector information
checktokenmetadataCheck token metadata for inconsistencies

Commands for managing data and SSTables.

CommandDescription
flushFlush memtables to SSTables
compactForce compaction
cleanupRemove data not belonging to this node
scrubRebuild SSTables, fixing corruption
verifyVerify SSTable integrity
upgradesstablesUpgrade SSTables to current version
garbagecollectRemove deleted data from SSTables
importImport SSTables from directory
refreshLoad newly placed SSTables

Commands for advanced SSTable operations.

CommandDescription
getsstablesList SSTables for a partition key
relocatesstablesMove SSTables to correct disk
recompress_sstablesRecompress SSTables with new settings
rebuild_indexRebuild secondary indexes

Commands for anti-entropy repair operations.

CommandDescription
repairRun anti-entropy repair
repair_adminManage repair sessions

Commands for backup and snapshots.

CommandDescription
snapshotCreate a snapshot
clearsnapshotRemove snapshots
listsnapshotsList existing snapshots
enablebackupEnable incremental backup
disablebackupDisable incremental backup
statusbackupCheck incremental backup status

Commands for controlling compaction.

CommandDescription
compactionstatsDisplay compaction statistics
compactionhistoryDisplay compaction history
setcompactionthroughputSet compaction throughput
getcompactionthroughputGet compaction throughput
getcompactionthresholdGet compaction thresholds
setcompactionthresholdSet compaction thresholds
enableautocompactionEnable automatic compaction
disableautocompactionDisable automatic compaction
statusautocompactionCheck auto-compaction status
forcecompactForce user-defined compaction
stopStop compaction operations

Commands for data streaming and hints.

CommandDescription
netstatsDisplay network statistics and streaming
setstreamthroughputSet streaming throughput
getstreamthroughputGet streaming throughput
setinterdcstreamthroughputSet inter-DC streaming throughput
getinterdcstreamthroughputGet inter-DC streaming throughput
truncatehintsTruncate all hints
enablehandoffEnable hinted handoff
disablehandoffDisable hinted handoff
statushandoffCheck hinted handoff status
pausehandoffPause hint delivery
resumehandoffResume hint delivery
enablehintsfordcEnable hints for datacenter
disablehintsfordcDisable hints for datacenter
listpendinghintsList pending hints
sethintedhandoffthrottlekbSet hint delivery throttle
getmaxhintwindowGet maximum hint window
setmaxhintwindowSet maximum hint window

Commands for gossip and client protocol management.

CommandDescription
enablegossipEnable gossip
disablegossipDisable gossip
statusgossipCheck gossip status
enablebinaryEnable CQL native transport
disablebinaryDisable CQL native transport
statusbinaryCheck native transport status
enableoldprotocolversionsEnable old protocol versions
disableoldprotocolversionsDisable old protocol versions

Commands for diagnostics and performance analysis.

CommandDescription
tpstatsDisplay thread pool statistics
proxyhistogramsDisplay coordinator read/write latencies
tablehistogramsDisplay table latency histograms
tablestatsDisplay table statistics
toppartitionsSample top partitions
gcstatsDisplay garbage collection statistics
clientstatsDisplay client connection statistics
profileloadProfile read/write operations
sjkSwiss Java Knife diagnostic tool
rangekeysampleSample range keys
viewbuildstatusCheck materialized view build status
refreshsizeestimatesRefresh size estimates
replaybatchlogReplay pending batches

Commands for runtime configuration.

CommandDescription
setlogginglevelSet logging level
getlogginglevelsGet logging levels
reloadsslReload SSL certificates
gettimeoutGet operation timeout
settimeoutSet operation timeout
setcachecapacitySet cache capacity
setcachekeystosaveSet cache keys to save
getconcurrentcompactorsGet concurrent compactors
setconcurrentcompactorsSet concurrent compactors
getconcurrentviewbuildersGet concurrent view builders
setconcurrentviewbuildersSet concurrent view builders
getconcurrencyGet thread concurrency
setconcurrencySet thread concurrency
getdefaultrfGet default replication factor
setdefaultrfSet default replication factor
getsnapshotthrottleGet snapshot throttle
setsnapshotthrottleSet snapshot throttle
getcolumnindexsizeGet column index size
setcolumnindexsizeSet column index size
getseedsGet seed nodes
reloadseedsReload seed nodes
gettraceprobabilityGet trace probability
settraceprobabilitySet trace probability
getbatchlogreplaythrottleGet batch log replay throttle
setbatchlogreplaythrottleSet batch log replay throttle
reloadtriggersReload triggers
reloadlocalschemaReload local schema
resetlocalschemaReset local schema
getauthcacheconfigGet auth cache configuration
setauthcacheconfigSet auth cache configuration
getguardrailsconfigGet guardrails configuration
setguardrailsconfigSet guardrails configuration

Commands for cache invalidation.

CommandDescription
invalidatekeycacheInvalidate key cache
invalidaterowcacheInvalidate row cache
invalidatecountercacheInvalidate counter cache
invalidatepermissionscacheInvalidate permissions cache
invalidatecredentialscacheInvalidate credentials cache
invalidaterolescacheInvalidate roles cache
invalidatenetworkpermissionscacheInvalidate network permissions cache
invalidatejmxpermissionscacheInvalidate JMX permissions cache

Commands for IP-based access control.

CommandDescription
cidrfilteringstatsDisplay CIDR filtering statistics
listcidrgroupsList all CIDR groups
getcidrgroupsofipGet CIDR groups for an IP
updatecidrgroupCreate or update CIDR group
dropcidrgroupRemove CIDR group
invalidatecidrpermissionscacheInvalidate CIDR permissions cache
reloadcidrgroupscacheReload CIDR groups cache

Commands for audit log management.

CommandDescription
enableauditlogEnable audit logging
disableauditlogDisable audit logging
getauditlogGet audit log configuration

Commands for full query log management.

CommandDescription
enablefullquerylogEnable full query logging
disablefullquerylogDisable full query logging
getfullquerylogGet full query log configuration
resetfullquerylogReset full query log

TaskCommand
Check cluster healthnodetool status
Monitor compactionsnodetool compactionstats
Check thread poolsnodetool tpstats
View table metricsnodetool tablestats <keyspace>
Check client connectionsnodetool clientstats
TaskCommand
Flush before backupnodetool flush
Create snapshotnodetool snapshot -t <name>
Run repairnodetool repair -pr
Clean up after topology changenodetool cleanup
Rebuild secondary indexesnodetool rebuild_index <ks> <table> <index>
TaskCommand
Check streamingnodetool netstats
View latenciesnodetool proxyhistograms
Check gossip statenodetool gossipinfo
Find hot partitionsnodetool toppartitions <ks> <table> 60000
Check pending hintsnodetool listpendinghints
Verify SSTablesnodetool verify <keyspace>
TaskCommand
Enable audit loggingnodetool enableauditlog
Check CIDR filteringnodetool cidrfilteringstats
Invalidate auth cachenodetool invalidatepermissionscache
Reload SSL certificatesnodetool reloadssl

Operational Guidelines

  1. Always check status first - Run nodetool status before any operation
  2. One node at a time - For heavy operations, run on one node at a time
  3. Monitor during operations - Watch tpstats and compactionstats
  4. Schedule during low traffic - Run maintenance during off-peak hours
  5. Document changes - Log all nodetool commands run on production

Production Precautions

  • Never run assassinate without understanding the consequences
  • Always drain before stopping Cassandra
  • Test commands in non-production first
  • Have rollback plans for topology changes

Runtime vs Persistent Settings

Many set* commands modify settings at runtime only. These changes are lost on node restart. To make settings persistent, also update cassandra.yaml. Commands that modify persistent data (like CIDR groups) are noted in their documentation.