...

/

The nodetool Utility

The nodetool Utility

Explore Apache Cassandra's nodetool utility for cluster management and monitoring, and get acquainted with some basic nodetool commands.

In this lesson, we will cover the nodetool utility, a command line administration tool provided by Apache Cassandra which comes installed with the database management software. It has an extensive list of commands to manage and monitor a Cassandra cluster, e.g., access cluster information, set configuration variables, etc.

To access the nodetool utility, type nodetool once the cluster is up and running. It will display the usage syntax and the nodetool commands with their descriptions. Notice the syntax below.

nodetool [options] nodetool_command [args]

Options may be specified in long or short notation, as described in the following table. JMX authentication may be configured, requiring a username and password for nodetool commands.

nodetool Command Options

Option (short)

Option (long)

Description

-u

--username   

JMX agent user name

-pw

--password

JMX agent password

-pp

--print-port

Operate in 4.0 mode with hosts disambiguated by port number

-h

--host

Node’s IP address or hostname

-p

--port

JMX Port. By default, Cassandra uses 7199

-pwf

--password-file

Full path of JMX password file

The node’s IP address and port may be provided in the nodetool command, as described in the screenshot below. We will omit these for simplicity, as our installation is on a single server.

Press + to interact
nodetool describecluster command with options host -h and port -p specified
nodetool describecluster command with options host -h and port -p specified

Basic nodetool commands

We will cover a few basic nodetool commands in this lesson.

The version command

The version command displays the version of Cassandra running on this node.

nodetool version

The screenshot below demonstrates the execution of the nodetool version command.

Press + to interact
Cassandra version 4.1.1 installation is used for this course
Cassandra version 4.1.1 installation is used for this course

The help command

The help command displays the general syntax of the nodetool commands, and lists all nodetool commands along with their descriptions.

nodetool help

If a nodetool command is listed after the ...