# A copy of this shard is already allocated to this node

**URL:** <https://discuss.elastic.co/t/a-copy-of-this-shard-is-already-allocated-to-this-node/362138>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [June 27, 2024, 7:49am UTC](https://discuss.elastic.co/t/a-copy-of-this-shard-is-already-allocated-to-this-node/362138 "2024-06-27T07:49:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Rybkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_rybkin/32/121805_2.png) [@Sam\_Rybkin](https://discuss.elastic.co/u/Sam_Rybkin)\
**Post date:** [June 27, 2024, 7:49am UTC](https://discuss.elastic.co/t/a-copy-of-this-shard-is-already-allocated-to-this-node/362138/1 "2024-06-27T07:49:28Z")

</div>

Hi we have next kibana settings:

```auto
GET /.kibana/_settings
{
  ".kibana_2" : {
    "settings" : {
      "index" : {
        "number_of_shards" : "1",
        "auto_expand_replicas" : "false",
        "provided_name" : ".kibana_2",
        "max_result_window" : "10000",
        "creation_date" : "1601638664184",
        "number_of_replicas" : "0",
        "uuid" : "WKdIpzLFSP-ydObLWd30SV",
        "version" : {
          "created" : "7090299"
        }
      }
    }
  }
}

```

Where:

```auto
"number_of_replicas" : "0",
"auto_expand_replicas" : "false",

```

We use only one node.  
But when we run we see that we have unassigned\_shards 44:

```auto
 GET /_cluster/health?pretty 
  "unassigned_shards" : 44,

```

And number of the unassigned shards continues to grow.

When we are trying to get information of the reason unassigned shards we recieve next answer.

```auto
GET _cluster/allocation/explain?filter_path=index,node_allocation_decisions.node_name,node_allocation_decisions.deciders.*
{
  "index": "test-2024.06.18",
  "shard": 0,
  "primary": false
} 

```

We receive the next answer:

```auto
{
  "index" : "test-2024.06.18",
  "node_allocation_decisions" : [
    {
      "node_name" : "es01",
      "deciders" : [
        {
          "decider" : "same_shard",
          "decision" : "NO",
          "explanation" : "a copy of this shard is already allocated to this node [[test-2024.06.18][0], node[JaLP5vTvS9qtLpLKSnzrjQ], [P], s[STARTED], a[id=rtJ9KfzqSRCFAyO4HD34Pg]]"
        }
      ]
    }
  ]
}

```

How we can stop the growth of the unassigned\_shards?  
And what we can do with unassigned\_shards that we have already? (unassigned\_shards : 44). with explanation : a copy of this shard is already allocated to this node ?

---

<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:** [June 27, 2024, 8:14am UTC](https://discuss.elastic.co/t/a-copy-of-this-shard-is-already-allocated-to-this-node/362138/2 "2024-06-27T08:14:02Z")

</div>

> [@Sam\_Rybkin](#):
>
> How we can stop the growth of the unassigned\_shards?

Make sure that every index you create has `number_of_replicas: 0`.

> [@Sam\_Rybkin](#):
>
> And what we can do with unassigned\_shards that we have already?

Set `number_of_replicas: 0` on the existing indices, such as `test-2024.06.18`.

---

<div class="post-metadata">

**Author:** ![Sam\_Rybkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_rybkin/32/121805_2.png) [@Sam\_Rybkin](https://discuss.elastic.co/u/Sam_Rybkin)\
**Post date:** [June 28, 2024, 5:15am UTC](https://discuss.elastic.co/t/a-copy-of-this-shard-is-already-allocated-to-this-node/362138/3 "2024-06-28T05:15:52Z")

</div>

> [@Sam\_Rybkin](#):
>
> `"number_of_replicas" : "0",`

But we alreadey have in the settings kibana:

```auto
 "number_of_replicas" : "0",

```

Or we need to do it for each

Hi @DavidTurner. Thanks a lot for your answer.

Yesterday I set for all unassigned\_shards:

```auto
 "number_of_replicas" : "0",

```

But today we recieve a new unassigned\_shard:

```auto
GET _cluster/allocation/explain?filter_path=index,node_allocation_decisions.node_name,node_allocation_decisions.deciders.*
{
  "index": "axapta-2024.06.28",
  "shard": 0,
  "primary": false
}

3 {
  "index" : "axapta-2024.06.28",
  "node_allocation_decisions" : [
    {
      "node_name" : "es01",
      "deciders" : [
        {
          "decider" : "same_shard",
          "decision" : "NO",
          "explanation" : "a copy of this shard is already allocated to this node [[axapta-2024.06.28][0], node[JaLP5vTvS9qtLpLKSnzrjQ], [P], s[STARTED], a[id=JcLi-13ASLKTT_CbmkPnjQ]]"
        }
      ]
    }
  ]
}

```

How we can set globally number\_of\_replicas: 0, for our one node?  
So we will stop to recieve new unassigned\_shard with explanation : a copy of this shard is already allocated to this node?

---

<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:** [June 28, 2024, 8:02am UTC](https://discuss.elastic.co/t/a-copy-of-this-shard-is-already-allocated-to-this-node/362138/4 "2024-06-28T08:02:28Z")

</div>

> [@Sam\_Rybkin](#):
>
> How we can set globally number\_of\_replicas: 0, for our one node?

There is no global setting, you need to specify this when creating an index - either explicitly in the create-index request, or include it in every [index template](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html) you're using.

---

<div class="post-metadata">

**Author:** ![Sam\_Rybkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_rybkin/32/121805_2.png) [@Sam\_Rybkin](https://discuss.elastic.co/u/Sam_Rybkin)\
**Post date:** [July 26, 2024, 7:28am UTC](https://discuss.elastic.co/t/a-copy-of-this-shard-is-already-allocated-to-this-node/362138/5 "2024-07-26T07:28:23Z")

</div>

Hi @DavidTurner !!  
Thanks a lot for your answer.

I have a question for example we have index axata-2024.07.26 and it UNASSIGNED how I can this when creating an index?  
We have problem only this with index all others are normal.

---

<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:** [July 26, 2024, 8:33am UTC](https://discuss.elastic.co/t/a-copy-of-this-shard-is-already-allocated-to-this-node/362138/6 "2024-07-26T08:33:47Z")

</div>

See [Red or yellow cluster health status | Elasticsearch Guide [8.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/red-yellow-cluster-status.html)
