Operations 12 min read

Master Elasticsearch Node Commands: Inspect, Monitor, and Troubleshoot Your Cluster

This article walks through essential Elasticsearch node‑level APIs—covering how to retrieve basic node info, detailed statistics, thread‑pool usage, and hot‑thread diagnostics—complete with request examples, response samples, and practical tips for diagnosing common cluster issues.

Efficient Ops
Efficient Ops
Efficient Ops
Master Elasticsearch Node Commands: Inspect, Monitor, and Troubleshoot Your Cluster

Node‑related Commands

1. View basic node information

The GET /_nodes/<node_id> API returns all details of a node, including process, JVM, plugins, roles, attributes, and settings. GET /_nodes/<node_id> To fetch only specific sections, append the sub‑path, e.g., GET /_nodes/<node_id>/process: GET /_nodes/<node_id>/process Sample response:

{
  "_nodes" : {"total" : 1,"successful" : 1,"failed" : 0},
  "cluster_name" : "es-xxxx",
  "nodes" : {
    "fdaOV16OQPq6-AUVihmq4A" : {
      "name" : "162680s31430001456s32",
      "transport_address" : "xx.0.96.22:9300",
      "host" : "xx.0.96.22",
      "ip" : "xx.0.96.22",
      "version" : "7.10.1",
      "roles" : ["master","ml","remote_cluster_client"],
      "attributes" : {
        "ml.machine_memory" : "16478932992",
        "rack" : "cvm_4_200003",
        "xpack.installed" : "true",
        "set" : "200003",
        "transform.node" : "false",
        "ip" : "xx.20.58.221",
        "temperature" : "hot",
        "ml.max_open_jobs" : "20",
        "region" : "4"
      },
      "process" : {"refresh_interval_in_millis" : 1000,"id" : 24918,"mlockall" : false}
    }
  }
}

2. View node statistics

The GET /_nodes/stats API provides comprehensive metrics such as JVM, CPU, memory, disk usage, index counts, request counts, cache statistics, segment and translog data.

GET /_nodes/stats
GET /_nodes/<node_id>/stats
GET /_nodes/stats/<metric>

Example: retrieve only JVM metrics for a specific node. GET /_nodes/1626803143000145632/stats/jvm Sample response (truncated):

{
  "_nodes" : {"total" : 1,"successful" : 1,"failed" : 0},
  "cluster_name" : "es-xxx",
  "nodes" : {
    "fdaOV16OQPq6-AUVihmq4A" : {
      "timestamp" : 1639878427713,
      "jvm" : {
        "uptime_in_millis" : 13037976328,
        "mem" : {
          "heap_used_in_bytes" : 214161760,
          "heap_used_percent" : 2,
          "heap_committed_in_bytes" : 8555069440,
          "heap_max_in_bytes" : 8555069440
        },
        "threads" : {"count" : 41,"peak_count" : 43},
        "gc" : {"collectors" : {"young" : {"collection_count" : 4718,"collection_time_in_millis" : 162825},"old" : {"collection_count" : 3,"collection_time_in_millis" : 359}}}
      }
    }
  }
}

Other useful stats include merge information, segment & translog details, and store size:

GET /_nodes/1626803143000145632/stats/indices/merge
GET /_nodes/1626803143000145632/stats/indices/segments,translog
GET /_nodes/stats/indices/store

For a quick overview of node memory usage, the cat API is handy:

GET _cat/nodes
GET _cat/nodes?h=name,segments.memory,segments.index_writer_memory,heap.percent,fielddata.memory_size,query_cache.memory_size,request_cache.memory_size\&v

3. View thread‑pool usage

Use the cat thread‑pool API to see active, queued, and rejected tasks. High values in queue or rejected indicate that the node’s read/write capacity is saturated, often caused by high CPU usage.

GET /_cat/thread_pool
GET /_cat/thread_pool/search,write?v

Sample response:

node_name           name   active queue rejected
1626803143000145832 search      0     0        0
1626803143000145832 write       0     0        0
...

Typical symptoms such as query rejections are illustrated below:

Query rejection
Query rejection

When the thread‑pool queue is full, the logs look similar to the following screenshot:

Thread queue full
Thread queue full

4. View hot threads

The hot‑thread API helps pinpoint CPU‑intensive tasks on a node.

GET /_nodes/hot_threads
GET /_nodes/<node_id>/hot_threads

Sample output (truncated):

::: {1626803143000145832}{...}
   Hot threads at 2021-12-19T02:21:12.334Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:
   ...

Analyzing hot threads together with CPU metrics helps identify root causes such as frequent merges, heavy text analysis, or snapshot operations.

Command Summary Table

Elasticsearch node command summary
Elasticsearch node command summary
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Elasticsearchperformance tuningAPIcluster operationsnode monitoring
Efficient Ops
Written by

Efficient Ops

This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.