Book Image

Mastering Apache Cassandra - Second Edition

Book Image

Mastering Apache Cassandra - Second Edition

Overview of this book

Table of Contents (15 chapters)
Mastering Apache Cassandra Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 unless you've explicitly...