top of page

ElasticSearch Cluster Status

What is Elasticsearch ?

Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. Elasticsearch is developed in Java.

What is Elasticsearch Cluster ?

Elasticsearch cluster is made up of one or more nodes. Each of these nodes contains indexes which are split into multiple shards. Elasticsearch makes copies of these shards called replicas. These (primary) shards and replicas are then placed on various nodes throughout the cluster.

Elasticsearch Cluster Health

Elasticsearch provide classification of cluster health in three different colours.

RED : Some or all shards are not ready, which means that your data is not fully available.

Yellow : There is a risk of data losing data, If something goes wrong with your shards.

To get it Green you should at-least have one more node for replication

Green : Your cluster is full operational. Elasticsearch is able to allocate all shards and replicas to machines within the cluster.

Check Elasticsearch Cluster Status

Login into your cluster node through SSH, and execute the curl command with the cat/health?v parameter, like this:

curl -XGET http://localhost:9200/_cluster/health?pretty=true

The output should be like this:

  "cluster_name" : "siddheshtest",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 2,
  "number_of_data_nodes" : 2,
  "active_primary_shards" : 10,
  "active_shards" : 10,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 100.0

Here I have cluster name siddheshtest, which is having running status of Green means this cluster is fully operational and Elasticsearch is able to allocate all shards.

As you can see currently I have total 2 number of nodes with total 10 number of shards active with 100%.

bottom of page