Getting nodes information via API
The previous recipes allow the return of information to the cluster level; ElasticSearch provides calls to gather information to the node level.
Getting ready
You need a working ElasticSearch cluster.
How to do it…
For getting nodes information, we will perform the steps given as follows:
- To retrieve the node information, the HTTP method is
GET
and the curl command is as follows:curl -XGET 'http://localhost:9200/_nodes?all=true' curl -XGET 'http://localhost:9200/_nodes/<nodeId1>,<nodeId2>?all=true'
- The result will be as follows:
{ "cluster_name": "elasticsearch", "nodes": { "pyGyXwh1ScqmnDw5etNS0w": { "hostname": "andrea", "http": { "bound_address": "inet[/0:0:0:0:0:0:0:0%0:9200]", "max_content_length": "100mb", "max_content_length_in_bytes...