# Is this the exact information for \_nodes/stats response

**URL:** <https://discuss.elastic.co/t/is-this-the-exact-information-for-nodes-stats-response/270037>\
**Category:** Elasticsearch\
**Created:** [April 13, 2021, 4:11pm UTC](https://discuss.elastic.co/t/is-this-the-exact-information-for-nodes-stats-response/270037 "2021-04-13T16:11:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![knagasri](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@knagasri](https://discuss.elastic.co/u/knagasri)\
**Post date:** [April 13, 2021, 4:11pm UTC](https://discuss.elastic.co/t/is-this-the-exact-information-for-nodes-stats-response/270037/1 "2021-04-13T16:11:25Z")

</div>

I had deployed eck-1.3.0 and elasticsearch 7.9.0 in GKE with 2 data-ingest and 3 master pods. Below is the one when I do get pods:

```auto
kubectl -n <ns> get po

NAME READY STATUS RESTARTS AGE
elastic-operator-0 1/1 Running 0 36m
elasticsearch-config-es-data-ingest-0 1/1 Running 0 33m
elasticsearch-config-es-data-ingest-1 1/1 Running 0 33m
elasticsearch-config-es-master-0 1/1 Running 0 33m
elasticsearch-config-es-master-1 1/1 Running 0 33m
elasticsearch-config-es-master-2 1/1 Running 0 33m

```

Below is the response when I checked the elasticsearch nodes status

```auto

[root@elasticsearch-config-es-data-ingest-0 elasticsearch]# curl -u "es-admin:es-admin" -k -X GET "https://elasticsearch-config-es-http:9200/_nodes/stats?pretty"
{
  "_nodes" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "cluster_name" : "elasticsearch-config"

```

I forcibly down one of the elasticsearch node down, so that total nodes would be 5, active nodes should be 4 and failed nodes should be 1.

```auto
 kubectl -n <ns> get po
NAME READY STATUS RESTARTS AGE
elastic-operator-0 1/1 Running 0 58m
elasticsearch-config-es-data-ingest-0 1/1 Running 0 55m
elasticsearch-config-es-data-ingest-1 0/1 ErrImagePull 0 55m
elasticsearch-config-es-master-0 1/1 Running 0 55m
elasticsearch-config-es-master-1 1/1 Running 0 55m
elasticsearch-config-es-master-2 1/1 Running 0 55m

```

But I can see the status as below inside the pod:

```auto
curl -u "un:pwd" -k -X GET "https://elasticsearch-config-es-http:9200/_nodes/stats?pretty"
{
  "_nodes" : {
    "total" : 4,
    "successful" : 4,
    "failed" : 0
  },
  "cluster_name" : "elasticsearch-config"

```

Is this the exact behaviour?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 13, 2021, 10:41pm UTC](https://discuss.elastic.co/t/is-this-the-exact-information-for-nodes-stats-response/270037/2 "2021-04-13T22:41:45Z")

</div>

Yes, the API shows the number of active nodes. It doesn't track nodes that have left.

---

<div class="post-metadata">

**Author:** ![knagasri](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@knagasri](https://discuss.elastic.co/u/knagasri)\
**Post date:** [April 20, 2021, 4:01pm UTC](https://discuss.elastic.co/t/is-this-the-exact-information-for-nodes-stats-response/270037/3 "2021-04-20T16:01:17Z")

</div>

Thanks @warkolm . But in which case, `failed` must be updated in elasticsearch cluster.  
I mean for the below command:  
curl -u "un:pwd" -k -X GET "[https://elasticsearch-config-es-http:9200/\_nodes/stats?pretty](https://elasticsearch-config-es-http:9200/_nodes/stats?pretty)"

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 21, 2021, 12:18pm UTC](https://discuss.elastic.co/t/is-this-the-exact-information-for-nodes-stats-response/270037/4 "2021-04-21T12:18:50Z")

</div>

The `failed` field counts the number of nodes that were in the cluster but which failed to respond to this specific `_nodes/stats` request. It doesn't include any nodes that aren't in the cluster any more.

---

<div class="post-metadata">

**Author:** ![knagasri](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@knagasri](https://discuss.elastic.co/u/knagasri)\
**Post date:** [April 22, 2021, 3:48am UTC](https://discuss.elastic.co/t/is-this-the-exact-information-for-nodes-stats-response/270037/5 "2021-04-22T03:48:01Z")

</div>

Okay. Is there any way to test that `failed` field count scenario.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 22, 2021, 5:46am UTC](https://discuss.elastic.co/t/is-this-the-exact-information-for-nodes-stats-response/270037/6 "2021-04-22T05:46:39Z")

</div>

What do you mean "test"? You should be able to trust Elasticsearch to get this right.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 20, 2021, 5:46am UTC](https://discuss.elastic.co/t/is-this-the-exact-information-for-nodes-stats-response/270037/7 "2021-05-20T05:46:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
