# Shard allocation fails when splitting index on multi-node cluster

**URL:** https://discuss.elastic.co/t/shard-allocation-fails-when-splitting-index-on-multi-node-cluster/372029
**Category:** Elasticsearch
**Created:** [December 16, 2024, 3:35pm UTC](https://discuss.elastic.co/t/shard-allocation-fails-when-splitting-index-on-multi-node-cluster/372029 "2024-12-16T15:35:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![techytushar](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@techytushar](https://discuss.elastic.co/u/techytushar)
#### Post date: [December 16, 2024, 3:35pm UTC](https://discuss.elastic.co/t/shard-allocation-fails-when-splitting-index-on-multi-node-cluster/372029/1 "2024-12-16T15:35:57Z")

</div>

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:

```auto
"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?**

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [December 16, 2024, 10:35pm UTC](https://discuss.elastic.co/t/shard-allocation-fails-when-splitting-index-on-multi-node-cluster/372029/2 "2024-12-16T22:35:05Z")

</div>

> [@techytushar](#):
>
> `"explanation": "Number of shards [3] allocated for affinity attribute [availability_set] with value [0] would exceed maximum limit [2]"`

This is not a message that Elasticsearch would emit. I think you must be using some other product. This forum is only about Elasticsearch. For help with other products, please ask for help on those products' own forums.
