I tried to check it via
curl -XGET 'http://localhost:9200/_cluster/health'
but nothing happened. Seems it's waiting for something. The console did not come back. Had to kill it with CTRL+C.
I also tried to check for existing indices via
curl -XGET 'http://localhost:9200/_cat/indices?v'
Same behavior as above.
Rather, this status indicates that at least one primary shard and its replicas aren't allocated to a node. If your cluster status shows yellow status, then the primary shards for all indices are allocated to nodes in your cluster. However, the replica shards for at least one index aren't allocated to any of the nodes.
Health Clusters collectively prepare for and respond to humanitarian and public health emergencies to improve the health outcomes of affected populations through timely, predictable, appropriate and effective coordinated health action.
To check on elasticsearch cluster health you need to use
curl localhost:9200/_cat/health
More on the cat APIs here.
I usually use elasticsearch-head plugin to visualize that.
You can find it's github project here.
It's easy to install sudo $ES_HOME/bin/plugin -i mobz/elasticsearch-head
and then you can open localhost:9200/_plugin/head/
in your web brower.
You should have something that looks like this :
You can check elasticsearch cluster health by using (CURL) and Cluster API provieded by elasticsearch:
$ curl -XGET 'localhost:9200/_cluster/health?pretty'
This will give you the status and other related data you need.
{ "cluster_name" : "xxxxxxxx", "status" : "green", "timed_out" : false, "number_of_nodes" : 2, "number_of_data_nodes" : 2, "active_primary_shards" : 15, "active_shards" : 12, "relocating_shards" : 0, "initializing_shards" : 0, "unassigned_shards" : 0, "delayed_unassigned_shards" : 0, "number_of_pending_tasks" : 0, "number_of_in_flight_fetch" : 0 }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With