The previous recipe returns information only about the health of the cluster. If you need more details on your cluster, you need to query its state.
For controlling the cluster state, we need to perform the following steps:
To view the cluster state, the HTTP method is GET and the curl command is:
curl -XGET 'http://localhost:9200/_cluster/state'
The result will be:
{ "cluster_name" : "elasticsearch", "master_node" : "pyGyXwh1ScqmnDw5etNS0w", "blocks" : { }, "nodes" : { "pyGyXwh1ScqmnDw5etNS0w" : { "name" : "Wonder Man", "transport_address" : "inet[/192.168.1.5:9300]", "attributes" : { } }, "wOIonUlFTwec0DCgf3aOjA" : { "name" : "Enigma", "transport_address" : "inet[/192.168.1.14:9300]", "attributes" : { } } }, "metadata" : { "templates" : { }, "indices" : { "test" : { "state" : "open", "settings" : {...