Database Reference
In-Depth Information
Cassandra's nodetool utility
The
nodetool
utility is a command-line utility that comes out of the box with Cassandra.
You can access it from
$CASSANDRA_HOME/bin/nodetool
. It communicates with
JMX to perform operational and monitoring tasks exposed by MBeans. It is much easier to
use than JConsole. We have already seen a bit of
nodetool
in the previous chapter. The
nodetool
utility is a great tool for administration and monitoring. The following section
will discuss some of its useful functionalities. Most of the nodetool commands are obvious
and can be easily learned by reading the help text. Unfortunately, there is no help option,
but it prints help messages anyway.
The following screenshot shows how to invoke methods via JConsole:
The standard way to execute any command on a Cassandra node using
nodetool
is as
follows:
nodetool -h CASSANDRA_HOST [-p JMX_PORT -u JMX_USERNAME -pw
JMX_PASSWORD] COMMAND
In general, you need not provide
JMX_PORT
,
JMX_USERNAME
, and
JMX_PASSWORD
un-
less you've explicitly configured them. The following sections discuss the
COMMAND
keyword in the previous command.