I have a 3 node Elasticsearch cluster and an index of size 40GB on it which only has a single shard. The single shard of the index reside on one of the nodes. I am trying to split that index into 6 shards.
The problem is out of the 6 shards that are created, only 2 of the shards gets allocated to the node and rest 4 shards remain unassigned, because of which the index remains in red
state. The 2 shards that are allocated are allocated on the same node on which the shard of the source node resides.
The _cluster/allocation/explain
API gives the following output:
"node_allocation_decisions": [
{
"node_id": "",
"node_name": "2-0",
"transport_address": "",
"node_attributes": {
"availability_set": "2",
"shard_indexing_pressure_enabled": "true"
},
"node_decision": "no",
"weight_ranking": 1,
"deciders": [
{
"decider": "resize",
"decision": "NO",
"explanation": "source primary is allocated on another node"
}
]
},
{
"node_id": "",
"node_name": "1-0",
"transport_address": "",
"node_attributes": {
"availability_set": "1",
"shard_indexing_pressure_enabled": "true"
},
"node_decision": "no",
"weight_ranking": 2,
"deciders": [
{
"decider": "resize",
"decision": "NO",
"explanation": "source primary is allocated on another node"
}
]
},
{
"node_id": "",
"node_name": "0-0",
"transport_address": "",
"node_attributes": {
"availability_set": "0",
"shard_indexing_pressure_enabled": "true"
},
"node_decision": "no",
"weight_ranking": 3,
"deciders": [
{
"decider": "affinity",
"decision": "NO",
"explanation": "Number of shards [3] allocated for affinity attribute [availability_set] with value [0] would exceed maximum limit [2]"
}
]
}
]
How to split an index when I have a multi-node cluster and ensure that all shards are equally distributed across all the nodes?