Differences between revisions 13 and 14
Revision 13 as of 2011-03-30 21:33:27
Size: 3036
Editor: 195-239-234-66
Comment: nodeprobe is now nodetool.
Revision 14 as of 2011-06-14 21:05:55
Size: 5208
Editor: 84
Comment: Updated nodetool usage output to ouput from v0.7.4 - may need updating further if this has changed for later versions...
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
Running `bin/nodetool` with no arguments produces some simple usage output. Running `bin/nodetool` with no arguments produces some usage output.
Line 13: Line 13:
usage: java org.apache.cassandra.tools.NodeCmd -host <arg> <command> Starting NodeTool
Missing required option: h
usage: java org.apache.cassandra.tools.NodeCmd --host <arg> <command>
Line 15: Line 17:
 -h, -host <arg> node hostname or ip address
 -p, -port <arg> remote jmx agent port number
 -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
Line 18: Line 22:
Available commands: ring, info, version, cleanup, compact, cfstats,
snapshot [snapshotname], clearsnapshot, tpstats, flush, drain, repair,
decommission, move, loadbalance, removetoken, setcachecapacity <keyspace>
<cfname> <keycachecapacity> <rowcachecapacity>, getcompactionthreshold,
setcompactionthreshold [minthreshold] ([maxthreshold]), streams [host]
Available commands:
  ring - Print informations on the token ring
  join - Join the ring
  info - Print node informations (uptime, load, ...)
  cfstats - Print statistics on column families
  clearsnapshot - Remove all existing snapshots
  version - Print cassandra version
  tpstats - Print usage statistics of thread pools
  drain - Drain the node (stop accepting writes and flush all column families)
  decommission - Decommission the node
  loadbalance - Loadbalance the node
  compactionstats - Print statistics on compactions
  disablegossip - Disable gossip (effectively marking the node dead)
  enablegossip - Reenable gossip
  disablethrift - Disable thrift server
  enablethrift - Reenable thrift server
  snapshot [snapshotname] - Take a snapshot using optional name snapshotname
  netstats [host] - Print network information on provided host (connecting node by default)
  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 providen token
  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
  compact [keyspace] [cfnames] - Force a (major) compaction on one or more column family
  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 key cache of one or more column family
  getcompactionthreshold <keyspace> <cfname> - Print min and max compaction thresholds for a given column family
  cfhistograms <keyspace> <cfname> - Print statistic histograms for a given 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

More and more instrumentation is being added to Cassandra via standard JMX apis.

The nodetool utility (nodeprobe in versions prior to 0.6) provides a simple command line interface to these exposed operations and attributes.

See Operations for a more high-level view of when you would want to use the actions described here.

Note: This utility currently requires the same environment as cassandra itself, namely the same classpath (including log4j.properties), and a valid storage-conf property.

Running bin/nodetool with no arguments produces some usage output.

Starting NodeTool
Missing required option: h
usage: java org.apache.cassandra.tools.NodeCmd --host <arg> <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

Available commands:
  ring                   - Print informations on the token ring
  join                   - Join the ring
  info                   - Print node informations (uptime, load, ...)
  cfstats                - Print statistics on column families
  clearsnapshot          - Remove all existing snapshots
  version                - Print cassandra version
  tpstats                - Print usage statistics of thread pools
  drain                  - Drain the node (stop accepting writes and flush all column families)
  decommission           - Decommission the node
  loadbalance            - Loadbalance the node
  compactionstats        - Print statistics on compactions
  disablegossip          - Disable gossip (effectively marking the node dead)
  enablegossip           - Reenable gossip
  disablethrift          - Disable thrift server
  enablethrift           - Reenable thrift server
  snapshot [snapshotname] - Take a snapshot using optional name snapshotname
  netstats [host]        - Print network information on provided host (connecting node by default)
  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 providen token
  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
  compact [keyspace] [cfnames] - Force a (major) compaction on one or more column family
  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 key cache of one or more column family
  getcompactionthreshold <keyspace> <cfname> - Print min and max compaction thresholds for a given column family
  cfhistograms <keyspace> <cfname> - Print statistic histograms for a given 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

The -host argument is required, the -port argument is optional and will default to 8080 if not supplied.

* In 0.7, streams is replaced by netstats.

Ring

The ring command will present node status and an ascii art rendition of the ring, as determined by the node being queried.

bin/nodetool -host 10.176.0.146 ring
Address       Status     Load          Range                                      Ring
10.176.0.146  Up         459.27 MB     75603446264197340449435394672681112420     |<--|
10.176.1.161  Up         382.53 MB     137462771597874153173150284137310597304    |   |
10.176.1.162  Up         511.34 MB     63538518574533451921556363897953848387     |-->|

Info

Outputs node information including the token, load info (on disk storage), generation number (times started), uptime in seconds, and heap memory usage.

bin/nodetool -host 10.176.0.146 info
Token(137462771597874153173150284137310597304)
Load Info        : 0 bytes.
Generation No    : 1
Uptime (seconds) : 697595
Heap Memory (MB) : 28.18 / 759.81

Cleanup

Triggers the immediate cleanup of keys no longer belonging to this node.

bin/nodetool -host 10.176.0.146 cleanup

Compact

Initiates an immediate table compaction.

Note: the compacted tables will not immediately be cleared from the hard disk and will remain on the system until the JVM performs a GC. For more information, read about MemtableSSTables.

bin/nodetool -host 10.176.0.146 compact

Decommission

Tells the node to move its data elsewhere; opposite of bootstrap. Since 0.5. See https://issues.apache.org/jira/browse/CASSANDRA-435

Drain

Flushes memtables on the node and stop accepting writes. Reads will still be processed. Useful for rolling upgrades.

NodeTool (last edited 2014-10-31 23:41:27 by 162)