Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

bmvamsi.sql_192302 avatar image
bmvamsi.sql_192302 asked ·

How can I run "nodetool status" without having to SSH to nodes?

We've cassandra cluster(5 nodes in dc1 , 3 nodes in dc2). I need to check the nodetool status. My requirement is to navigate to each and every node in the cluster and run the nodetool status . Though nodetool gives the status of all nodes status information, I need to navigate to the each and every node to know the status because sometimes even the nodetool status says UP and Normal in one node , when i connect to another node nodetool status says that particular node is DOWN.

can you please let me know the nodetool status of all nodes without doing ssh to the nodes .

cassandranodetool
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered ·

The nodetool command connects to the nodes via JMX to run commands. You can also run commands against remote nodes by specifying the IP with the -h or --host flag.

Example

To illustrate, here is an example nodetool status output:

Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address        Load      Tokens  Owns  Host ID                               Rack 
UN  10.101.33.62   5.57 GiB  16      ?     28932618-36f0-4d6c-8e2d-c05dca3672f5  rack1
UN  10.101.32.215  5.78 GiB  16      ?     1f9008b0-b2ed-41b3-8345-c8b982dec742  rack1
UN  10.101.33.158  6.63 GiB  16      ?     b8ec9c55-76b5-4f0f-b776-799dab6940b8  rack1

From node 10.101.33.158, I can connect to another node with the -h flag to get its host ID:

10.101.33.158 ~ $ nodetool -h 10.101.32.215 info | grep ID
ID                     : 1f9008b0-b2ed-41b3-8345-c8b982dec742

Prerequisites

For remote JMX connections to work, you must set the LOCAL_JMX variable in cassandra-env.sh to no:

if [ "$LOCAL_JMX" = "yes" ]; then

and enable JMX authentication for security reasons. For the step-by-step procedure, see Enabling JMX authentication and authorization.

For more info, see About the nodetool utility. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

bettina.swynnerton avatar image
bettina.swynnerton answered ·

Hi,

You can check on nodetool status for any node in your cluster by using the host option in nodetool.

The command syntax: nodetool -h xxx status , where xxx is node hostname or ip address.

To use nodetool, cassandra does not need to be running, but the utility requires the same environment as cassandra itself, namely the same classpath, and you need network connectivity to check on remote nodes.

Would that work for you?

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.