A copy of this shard is already allocated to this node

Hi we have next kibana settings:

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:

"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:

 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.

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:

{
  "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 ?

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

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

But we alreadey have in the settings kibana:

 "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:

 "number_of_replicas" : "0",

But today we recieve a new unassigned_shard:

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?

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 you're using.

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.

See Red or yellow cluster health status | Elasticsearch Guide [8.14] | Elastic