Cluster state is yellow due to unassigned shrads

Since there are 207 unassigned shrads, my cluster status became yellow. I ran the API "_cluster/allocation/explain" and got below results.
{
"index": "en_y_29",
"shard": 1,
"primary": false,
"current_state": "unassigned",
"unassigned_info": {
"reason": "CLUSTER_RECOVERED",
"at": "2020-03-31T12:10:04.627Z",
"last_allocation_status": "no_attempt"
},
"can_allocate": "no",
"allocate_explanation": "cannot allocate because allocation is not permitted to any of the nodes",
"node_allocation_decisions": [
{
"node_id": "BD6tAWxMQwGUf6rab6DBIg",
"node_name": "elk-denmod-1",
"transport_address": "168.124.183.229:9300",
"node_decision": "no",
"deciders": [
{
"decider": "same_shard",
"decision": "NO",
"explanation": "the shard cannot be allocated to the same node on which a copy of the shard already exists [[en_y_29][1], node[BD6tAWxMQwGUf6rab6DBIg], [P], s[STARTED], a[id=YdGSMhPKROS0x1hiZEhJ5w]]"
}
]
}
]
}

is it because that we didn't select any value for setting "cluster.routing.allication.enable"? what should i do now to allocate all the unassined shrads now?

How many data nodes do you have in the cluster?

i have only one data node.

Replicas can never be allocated to the same node as the primary so what you are seeing is expected and not a problem. You can get them green by setting the number of replicas to 0 for all indices.

If the other nodes are master nodes, can we allocate the replica shrads in that master node?

No, only data nodes can hold data although nodes can be both master and data nodes at the same time.

We have two master nodes in our cluster. if we change the one of the master nodes as both master and data node, will it allocate the replica shrads in that node automatically?

You should always have at least 3master eligible nodes in any cluster. 2 is not a good number.

We have only three nodes in our cluster. can we make all three as master and two node as data node?

If they are the same spec I would make them all master/data.

you mean hardware specification? if i change all the nodes as master/data, will the replica shrads allocate automatically or do i need to allocate it manually?

If will allocate automatically.

Do you mean hardware specification in the above reply should be same for all the three nodes? Once i changed all the nodes as both master\data, do i need to restart the Elasticsearch service? or should i stop the service before making changes?

Please provide an update on this.

Yes.

Could you please confirm whether you are referring hardware specification here?

Please provide an update on this.

Yes, I was referring to hardware specification. Elasticsearch assumes all nodes are equal.

What is the procedure to make all the three nodes as master\data nodes? what are all the things need to keep in mind while changing the roles?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.