Take a snapshot of only the playlists table in the music keyspace. On Linux, in the Cassandra bin directory, for example:
$ ./nodetool snapshot -cf playlists music
Requested creating snapshot(s) for [music] with snapshot name [1391461910600]
Snapshot directory: 1391461910600
Cassandra creates the snapshot directory named 1391461910600 that contains the backup data of playlists table in /var/lib/cassandra/data/music/playlists-bf8118508cfd11e3972273ded3cb6170/snapshots, for example.
status
Provide information about the cluster, such as the state, load, and IDs.
Provide information about the cluster, such as the state, load, and IDs.
Synopsis
nodetool <options> status (-r | --resolve-ip ) -- <keyspace>
• options are:
• ( -h | --host ) <host name> | <ip address>
• ( -p | --port ) <port number>
• ( -pw | --password ) <password >
• ( -u | --username ) <user name>
• -r, or --resolve-ip, means to provide node names instead of IP addresses.
• -- Separates an option and argument that could be mistaken for a option.
• keyspace is a keyspace name.
Synopsis Legend
• Angle brackets (< >) mean not literal, a variable
• Italics mean optional
• The pipe (|) symbol means OR or AND/OR
• Ellipsis (...) means repeatable
• Orange ( and ) means not literal, indicates scope
Description
The status command provides the following information:
• Status - U (up) or D (down)
Indicates whether the node is functioning or not.
• State - N (normal), L (leaving), J (joining), M (moving) The state of the node in relation to the cluster.
• Address
The node's URL.
• Load - updates every 90 seconds
The amount of file system data under the cassandra data directory after excluding all content in the snapshots subdirectories. Because all SSTable data files are included, any data that is not cleaned up, such as TTL-expired cell or tombstoned data) is counted.
• Tokens
The number of tokens set for the node.
• Owns
The percentage of the data owned by the node per data center times the replication factor. For example, a node can own 33% of the ring, but show100% if the replication factor is 3.
Attention: If your cluster uses multiple data centers with different keyspaces that use different replication strategies or replication factors, you must specify a keyspace to get meaningful ownship information.
• Host ID
The network ID of the node.
• Rack
The rack or, in the case of Amazon EC2, the availability zone of the node.
statusbinary
Provide the status of native transport.
Provide the status of native transport.
Synopsis
nodetool <options> statusbinary options are:
• ( -h | --host ) <host name> | <ip address>
• ( -p | --port ) <port number>
• ( -pw | --password ) <password >
• ( -u | --username ) <user name>
Cassandra tools
Synopsis Legend
• Angle brackets (< >) mean not literal, a variable
• Italics mean optional
• The pipe (|) symbol means OR or AND/OR
• Ellipsis (...) means repeatable
• Orange ( and ) means not literal, indicates scope
Description
Provides the status of the binary protocol, also known as the native transport.
statusthrift
Provide the status of the Thrift server.
Provide the status of the Thrift server.
Synopsis
nodetool <options> statusthrift options are:
• ( -h | --host ) <host name> | <ip address>
• ( -p | --port ) <port number>
• ( -pw | --password ) <password >
• ( -u | --username ) <user name>
Synopsis Legend
• Angle brackets (< >) mean not literal, a variable
• Italics mean optional
• The pipe (|) symbol means OR or AND/OR
• Ellipsis (...) means repeatable
• Orange ( and ) means not literal, indicates scope
stop
Stops the compaction process.
Stops the compaction process.
Synopsis
nodetool <options> stop -- <compaction_type>
• options are:
• ( -h | --host ) <host name> | <ip address>
• ( -p | --port ) <port number>
• ( -pw | --password ) <password >
• ( -u | --username ) <user name>
• -- Separates an option and argument that could be mistaken for a option.
• A compaction type: COMPACTION, VALIDATION, CLEANUP, SCRUB, INDEX_BUILD
Synopsis Legend
• Angle brackets (< >) mean not literal, a variable
• Italics mean optional
• The pipe (|) symbol means OR or AND/OR
• Ellipsis (...) means repeatable
• Orange ( and ) means not literal, indicates scope
Description
Stops an operation from continuing to run. This command is typically used to stop a compaction that has a negative impact on the performance of a node. After the compaction stops, Cassandra continues with the remaining operations in the queue. Eventually, Cassandra restarts the compaction.
stopdaemon
Stops the cassandra daemon.
Stops the cassandra daemon.
Synopsis
nodetool <options> stopdaemon options are:
• ( -h | --host ) <host name> | <ip address>
• ( -p | --port ) <port number>
• ( -pw | --password ) <password >
• ( -u | --username ) <user name>
Synopsis Legend
• Angle brackets (< >) mean not literal, a variable
• Italics mean optional
• The pipe (|) symbol means OR or AND/OR
• Ellipsis (...) means repeatable
• Orange ( and ) means not literal, indicates scope
taketoken
Deprecated. Do not use. Using this command can result in data loss.
Deprecated. Do not use. Using this command can result in data loss.
Synopsis
nodetool <options> taketoken -- ( <token>, ... )
• options are:
• ( -h | --host ) <host name> | <ip address>
• ( -p | --port ) <port number>
• ( -pw | --password ) <password >
• ( -u | --username ) <user name>
• -- Separates an option from an argument that could be mistaken for a option.
• token is a token to move.
Synopsis Legend
• Angle brackets (< >) mean not literal, a variable
• Italics mean optional
• The pipe (|) symbol means OR or AND/OR
• Ellipsis (...) means repeatable
• Orange ( and ) means not literal, indicates scope
Cassandra tools
Description
This command operates on multiple nodes in a cluster and was made available in Cassandra 2.0.6 for moving virtual nodes (vnodes). This command is being removed in the next release. Using this command can result in data loss.
tpstats
Provides usage statistics of thread pools.
Provides usage statistics of thread pools.
Synopsis
nodetool <options> tpstats options are:
• ( -h | --host ) <host name> | <ip address>
• ( -p | --port ) <port number>
• ( -pw | --password ) <password>
• ( -u | --username ) <user name>
Synopsis Legend
• Angle brackets (< >) means not literal, a variable
• Italics mean optional
• The pipe (|) symbol means OR or AND/OR
• Ellipsis (...) means repeatable
• Orange ( and ) means not literal, indicates scope
Description
Run the nodetool tpstats command on the local node. The nodetool tpstats command provides statistics about the number of active, pending, and completed tasks for each stage of Cassandra operations by thread pool. A high number of pending tasks for any pool can indicate performance problems, as described in http://wiki.apache.org/cassandra/Operations#Monitoring .
This table describes the indicators:
Table: nodetool tpstats output
Name of statistic Task Related information
ReadStage Local reads
RequestResponse Handle responses from other
nodes
MutationStage Local writes A high number of pending write
requests indicates a problem handling them. Tune hardware or Cassandra configuration.
ReadRepairStage A digest query and update of replicas of a key
ReplicateOnWriteStage Counter writes, replications after a local write
GossipStage Handle gossip rounds every
second
Name of statistic Task Related information
AntiEntropyStage Repair consistency Nodetool repair
MigrationStage Make schema changes
MemoryMeter Actual object memory
including JVM overhead MemtablePostFlusher Flush the commit log and
other operations after flushing the memtable
FlushWriter Flush the memtable to disk,
the status of the sort and write-to-disk operations
commitlog_archiver Save the commit log InternalResponseStage Respond to non-client
initiated messages, including bootstrapping and schema checking
HintedHandoff Send missed mutations to
other nodes
Example
Run the command every two seconds.
nodetool -h labcluster tpstats
Cassandra tools
FlushWriter 0 0 371 0
0
MiscStage 0 0 25 0
0
PendingRangeCalculator 0 0 16 0
0
commitlog_archiver 0 0 0 0
0
InternalResponseStage 0 0 0 0
0
HintedHandoff 0 0 10 0
0
Message type Dropped RANGE_SLICE 0
READ_REPAIR 0
BINARY 0
READ 0
MUTATION 0
_TRACE 0
REQUEST_RESPONSE 0
truncatehints
Truncates all hints on the local node, or truncates hints for the one or more endpoints.
Truncates all hints on the local node, or truncates hints for the one or more endpoints.
Synopsis
nodetool <options> truncatehints -- ( <endpoint> ... )
• options are:
• ( -h | --host ) <host name> | <ip address>
• ( -p | --port ) <port number>
• ( -pw | --password ) <password >
• ( -u | --username ) <user name>
• -- Separates an option and argument that could be mistaken for a option.
• endpoint is one or more endpoint IP addresses or host names which hints are to be deleted.
Synopsis Legend
• Angle brackets (< >) mean not literal, a variable
• Italics mean optional
• The pipe (|) symbol means OR or AND/OR
• Ellipsis (...) means repeatable
• Orange ( and ) means not literal, indicates scope
upgradesstables
Rewrites SSTables for tables that are not running the current version of Cassandra.
Rewrites SSTables for tables that are not running the current version of Cassandra.
Synopsis
nodetool <options> upgradesstables (-a | --include-all-sstables ) -- ( <keyspace> <table> ... )
• options are:
• ( -h | --host ) <host name> | <ip address>
• ( -p | --port ) <port number>
• ( -pw | --password ) <password >
• ( -u | --username ) <user name>
• -a or --include-all-sstables, followed by the snapshot name.
• -- Separates an option and argument that could be mistaken for a option.
• keyspace a keyspace name.
• table is one or more table names, separated by a space.
Synopsis Legend
• Angle brackets (< >) mean not literal, a variable
• Italics mean optional
• The pipe (|) symbol means OR or AND/OR
• Ellipsis (...) means repeatable
• Orange ( and ) means not literal, indicates scope
Description
Rebuilds SSTables on a node that are not compatible with the current version. Use this command when upgrading your server or changing compression options.
version
Provides the version number of Cassandra running on the specified node.
Provides the version number of Cassandra running on the specified node.
Synopsis
nodetool <options> version options are:
• ( -h | --host ) <host name> | <ip address>
• ( -p | --port ) <port number>
• ( -pw | --password ) <password >
• ( -u | --username ) <user name>
Synopsis Legend
• Angle brackets (< >) mean not literal, a variable
• Italics mean optional
• The pipe (|) symbol means OR or AND/OR
• Ellipsis (...) means repeatable
• Orange ( and ) means not literal, indicates scope