In this article, we are going to discuss checking the cluster health by using nodetool in Cassandra. Nodetool is one of the monitoring tools which helps in monitoring a cluster and performing routine maintenance tasks.
We will discuss three nodetool commands which will often use for checking the cluster's health.
The nodetool status command provides valuable information pertaining to the nodes such as the following.
3. nodetool tpstats :
In Cassandra, The nodetool tpstats command shows the usage statistics of thread pools. This command is very helpful in Cassandra. Cassandra breaks tasks into stages, with each stage using a separate queue and a thread pool. A messaging service connects the various stages.
This command will give you the overview statistics of thread pools. This command provides information about each stage of an operation by the thread pool. It shows the following things:
The output of the nodetool tpstats command shows statistics pertaining to specific thread pools associated with tasks in the database. All this detailed information is quite useful to you when you’re troubleshooting issues or tuning the database.
- nodetool status
- nodetool info
- nodetool tpstats
nodetool status 127.0.0.1Output:
The nodetool status command provides valuable information pertaining to the nodes such as the following.
- Status : It will let you know the status of a node such that node is up or down.
- State : It will let you know the state of a node such that node is in Normal/leaving/Joining/Moving etc. For example, the 'UN' represents the node is UP and in Normal state.
- Address : It will let you know the address of a node. for example - If you are connected to localhost 127.0.0.1 then your address will be 127.0..0.1.
- Load : It will let you know the data load in a node.
- Tokens : It will let you know the token number.
- Host id : It will let you know the host id.
nodetool infoOutput:
3. nodetool tpstats :
In Cassandra, The nodetool tpstats command shows the usage statistics of thread pools. This command is very helpful in Cassandra. Cassandra breaks tasks into stages, with each stage using a separate queue and a thread pool. A messaging service connects the various stages.
This command will give you the overview statistics of thread pools. This command provides information about each stage of an operation by the thread pool. It shows the following things:
- Number of active threads.
- Number of requests waiting to be executed by a thread pool.
- Number of tasks a thread pool has completed.
- Number of blocked requests due to the thread pool in the next step being full.
- Number of total blocked requests in this thread pool up until this point in time.
The output of the nodetool tpstats command shows statistics pertaining to specific thread pools associated with tasks in the database. All this detailed information is quite useful to you when you’re troubleshooting issues or tuning the database.