Skip to Content
Cassandra: The Definitive Guide
book

Cassandra: The Definitive Guide

by Eben Hewitt
November 2010
Intermediate to advanced
328 pages
9h 38m
English
O'Reilly Media, Inc.
Content preview from Cassandra: The Definitive Guide

Chapter 10. Maintenance

In this chapter, we look at some things you can do to keep Cassandra healthy. So put your operations 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 repair 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 commands, which are covered ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cassandra: The Definitive Guide, 3rd Edition

Cassandra: The Definitive Guide, 3rd Edition

Jeff Carpenter, Eben Hewitt
Data modeling with Cassandra

Data modeling with Cassandra

Jeff Carpenter, Eben Hewitt

Publisher Resources

ISBN: 9781449399764Supplemental ContentErrata Page