March 15, 2017

Cassandra nodetool

nodetool (nodeprobe in versions prior to Cassandra 0.6)

nodetool -h HOSTNAME [-p JMX_PORT|8080] COMMAND
nodetool -h HOSTNAME [-p JMX_PORT|8080 -u JMX_USERNAME -pw JMX_PASSWORD] COMMAND
  -h,--host <arg>         node hostname or ip address
-p,--port <arg>         remote jmx agent port number
  -pw,--password <arg>   remote jmx agent password
  -u,--username <arg>     remote jmx agent username
nodetool status 

info                   --- Print node information (uptime, load, ...)
bin/nodetool -host 106.136.0.46 info

ring                   --- Print information of the token ring

bin/nodetool -host 106.136.0.46 ring
join                   --- Join the ring
move <new token>       --- Move node on the token ring to a new token
removetoken status|force|<token> --- Show status of current token removal, force completion of pending removal or remove provided token
nodetool removenode host_id

cfstats                 --- Print statistics of column families

cfhistograms <keyspace> <cfname> --- Print statistic histograms for a given column family
./nodetool -h -p cfhistograms
netstats [host]         --- Print network information on provided host (connecting node by default)
tpstats                 --- Print usage statistics of thread pools
compactionstats         --- Print statistics of compactions

snapshot [snapshotname] --- Take a snapshot using optional name snapshotname

$ nodetool -h localhost -p 7199 snapshot demdb
clearsnapshot           --- Remove all existing snapshots
$ nodetool -h localhost -p 7199 clearsnapshot

version                 --- Print Cassandra version


drain                   --- Drain the node (stop accepting writes and flush all column families)

decommission         --- Decommission the node
loadbalance           --- Load balance the node

disablegossip         --- Disable gossip (effectively marking the node dead)

enablegossip           --- Reenable gossip

disablethrift           --- Disable thrift server

enablethrift           --- Reenable thrift server

flush [keyspace] [cfnames] --- Flush one or more column family

repair [keyspace] [cfnames] --- Repair one or more column family
cleanup [keyspace] [cfnames] --- Run cleanup on one or more column family
bin/nodetool -host 106.136.0.46 cleanup

compact [keyspace] [cfnames] --- Force a (major) compaction on one or more column family

bin/nodetool -host 106.136.0.46 compact
scrub [keyspace] [cfnames] --- Scrub (rebuild sstables for) one or more column family
invalidatekeycache [keyspace] [cfnames] --- Invalidate the key cache of one or more column family
invalidaterowcache [keyspace] [cfnames] --- Invalidate the row cache of one or more column family

setcachecapacity <keyspace> <cfname> <keycachecapacity> <rowcachecapacity> --- Set the key and row cache capacities of a given column family

setcompactionthreshold <keyspace> <cfname> <minthreshold> <maxthreshold> --- Set the min and max compaction thresholds for a given column family
getcompactionthreshold <keyspace> <cfname> --- Print min and max compaction thresholds for a given column family
setcompactionthroughput
nodetool -h `hostname` setcompactionthroughput 99
nodetool -h `hostname` setcompactionthroughput 0    --- disabling

upgradesstables

rebuildsstables
bin/nodetool -h devbox -p 8585 rebuildsstables my_stuff

Related Articles: Cassandra-cli Commnads   Cassandra Terms/Abbreviations Hadoop Commands


No comments:

Post a Comment