Database Reference
In-Depth Information
Chapter10.Maintenance
In this chapter, we look at some things you can do to keep Cassandra healthy. So put your oper-
ations hat on, and let's get started.
The Nodetool ships with Cassandra and can be found in <cassandra-home>/bin. This is a
command-line program that offers a rich array of ways to look at your cluster, understand its
activity, and modify it. Nodetool lets you get limited statistics about the cluster, see the ranges
each node maintains, move data from one node to another, decommission a node, and even re-
pair a node that's having trouble.
NOTE
Many of the tasks in Nodetool overlap with functions available in the JMX interface. This is because,
behind the scenes, Nodetool is invoking JMX using a helper class called NodeProbe . So JMX is doing
the real work, the NodeProbe class is used to connect to the JMX agent and sort out the data, and the
NodeCmd class is used to present it in an interactive command-line interface.
To use Nodetool, you need to have the same environment as Cassandra itself; that is, it requires
the same classpath and logging files.
NOTE
The command-line Nodetool is a wrapper around org.apache.cassandra.tools.NodeCmd . Take a
look at the source for that class if you need to know more about exactly what it's doing.
Starting Nodetool is a breeze. Just open a terminal, navigate to <cassandra-home>, and enter the
following command:
$bin/nodetool
Running it this way will error out, but you also cause the program to print a list of available com-
mands, which are covered next.
Getting Ring Information
There is a variety of information you can get about the ring and its nodes, which we look at in
this section. You can get basic information on an individual node or on all the nodes participat-
ing in a ring.
Search WWH ::




Custom Search