How to get the number of data nodes for an Elasticsearch cluster

Tremaine Eto
Towards Dev
Published in
3 min readNov 19, 2022

--

Original photo by Anastasia Taioglou on Unsplash.

Let’s say that we want to get the number of data nodes for an Elasticsearch cluster.

How can we do that with an API?

There are other ways you may be able to check this, like in code in Terraform or in an AWS console. You may be able to see it in something like Kibana that shows all the data nodes.

--

--

Senior Software Engineer @ Iterable | Previously worked at DIRECTV, AT&T, and Tinder | UCLA Computer Science alumni | Follow me for software engineering tips!