Under the bin directory you will find the nodetool utility. This can be used to help manage a cluster. Usage:
bin/nodetool -h HOSTNAME [-p JMX_PORT] COMMAND...
The available commands are:
ring
Displays node status and an ASCII art rendition of the ring as determined by the node being queried. This can give you a quick idea of how balanced the load is around the ring and if any nodes are down. If your cluster is not properly configured, different nodes may show a different ring, so this is a good way to check that every node views the ring the same way.
info
Outputs node information including the token, load info (on disk storage), generation number (times started), uptime in seconds, and heap memory usage.
version
Prints the Cassandra release version for the node being queried.
cleanup [keyspace]
Triggers the immediate cleanup of keys no longer belonging to this node. This has roughly the same effect on a node that a major compaction does in terms of a temporary increase in disk space usage and an increase in disk I/O.
compact [keyspace]
Initiates an immediate major compaction of all column families in keyspace. For each column family in keyspace, this compacts all existing SSTables into a single SSTable. This will cause considerable disk I/O and will temporarily cause up to twice as much disk space to be used.
cfstats
Prints statistics for every keyspace and column family.
snapshot [snapshot-name]
Takes an online snapshot of Cassandra’s data. Before taking the snapshot, the node is flushed. The results can be found in Cassandra’s data directory (typically /var/lib/cassandra/data) under the snapshots directory of each keyspace. See also:
clearsnapshot
Deletes all existing snapshots.
tpstats
Prints the number of active, pending, and completed tasks for each of the thread pools that Cassandra uses for stages of operations. A high number of pending tasks for any pool can indicate performance problems. For more details, see:
flush keyspace
Flushes all memtables for a keyspace to disk, allowing the commit log to be cleared.
drain
Flushes all memtables for a node and causes the node to stop accepting write operations. Read operations will continue to work. This is typically used before upgrading a node to a new version of Cassandra.
repair keyspace
Begins an AntiEntropy repair process. This causes all replicas for each key that the node is responsible for to be compared and all replicas are updated to the newest version. See http://wiki.apache.org/cassandra/AntiEntropy for a more thorough explanation.
decommission
Tells a live node to decommission itself (streaming its data to the next node on the ring) See also:
move new_token
Moves a node to a new token. This essentially combines decommission and bootstrap. See:
loadbalance
Moves the node to a new token so that it will split the range of whatever token currently has the highest load (this is the same heuristic used for bootstrap). This is rarely called for, as it does not balance the ring in a meaningful way. See:
removetoken token
Removes a dead node’s token. This token’s range is assumed by another node and the data is streamed there from the remaining live replicas. See:
setcachecapacity keyspace cfname key_cache_capacity row_cache_capacity
Sets the size of the key cache and row cache. These may be either an absolute number or a percentage in the form of a floating point number.
getcompactionthreshold keyspace cf_name
Gets the current compaction threshold settings for a column family. See:
setcompactionthreshold cf_name min_threshold [max_threshold]
The min_threshold parameter controls how many SSTables of a similar size must be present before a minor compaction is scheduled. The max_threshold sets an upper bound on the number of SSTables that may be compacted in a single minor compaction. See also:
streams host
Shows the status of streaming operations such as bootstrap, repair, and decommission. See: