I am facing issue of cluster health as yellow becasu of some unassign shared

{
    "cluster_name": "app_search",
    "status": "yellow",
    "timed_out": false,
    "number_of_nodes": 2,
    "number_of_data_nodes": 2,
    "active_primary_shards": 5,
    "active_shards": 10,
    "relocating_shards": 0,
    "initializing_shards": 0,
    "unassigned_shards": 5,
    "delayed_unassigned_shards": 0,
    "number_of_pending_tasks": 0,
    "number_of_in_flight_fetch": 0
}

i tried with below approach

1)my cluster health was red then i have deleted data folder then cluster health became green after that i have created mapping it's turned to yellow, so if i am missing anything please help me out on this.

So are you asking for assistance here, or just telling us your cluster is yellow?

My guess is that you defined the number of replicas to 2.

Thanks for your replay, Yes David , I have define index.number_of_replicas:2 is it ok or not

So everything is correct here.

You have 5 primary shards + 2 copies of each which means 15 shards to allocate.

On a 2 nodes cluster, you will end up with

  • 5 primary shards
  • 5 replica shards

If you add a new node you will allocate:

  • 5 primary shards
  • 5 replica shards
  • 5 replica shards

thanks for your response David.

if everything seems correct, does this mean cluster health yellow will not make any problem in future ?

The question is "why did you change the number of replicas?".

I won't keep a yellow cluster in production.
If a node stops, you won't be able to index new data because of the quorum.

So if you want to have only 2 data nodes, keep number of replicas to 1.
But in any case add a 3rd node to avoid split brain issue. Can be a master only node which will act as a tie breaker.

Thanks for your response David , I am New to Elastic Search, How can I change cluster health yellow to green is there any way to do that.

If you are new to elasticsearch, why did you change the replica settings?

Change that. Read: https://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-update-settings.html

Hi David, I have 3 server's i need to sync the data of this 3 server's how can i do in elasticsearch(cluster name and index name is same in all server's,in every server i have install elasticsearch separately )

Example:10.141.4.221 is Load Balancing it's have 3 server's (10.141.2.2,10.141.2.3,10.142.2.4) cluster and index name is same in all server's