# Cluster Health RED unassigned primary and replica shards

**URL:** <https://discuss.elastic.co/t/cluster-health-red-unassigned-primary-and-replica-shards/258891>\
**Category:** Elasticsearch\
**Created:** [December 16, 2020, 4:28pm UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-primary-and-replica-shards/258891 "2020-12-16T16:28:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RusseL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russel/32/77328_2.png) [@RusseL](https://discuss.elastic.co/u/RusseL)\
**Post date:** [December 16, 2020, 4:28pm UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-primary-and-replica-shards/258891/1 "2020-12-16T16:28:33Z")

</div>

Hello to everyone,  
Cluster health turned red when a node fell from the cluster. When I re-add the node, some directories automatically turned from red to green, but there is an index still red and I don't know what to do. It looks like it is trying to assign the primary and replica shard of the directory to the same node. There was no change when I set the replication number to 0. How do I assign a primary shard? I did some research and finally got this printout, but I have no idea what to do.

```
GET /_cat/shard?h=index,shard,prirep,state,unassigned.reason
ticket 2 p INITIALIZING NODE_LEFT
ticket 2 r UNASSIGNED REPLICA_ADDED

```

and

```
GET /_cluster/allocation/explain?pretty

 {

"index" : "ticket",

"shard" : 2,

"primary" : false,

 "current_state" : "unassigned",

  "unassigned_info" : {

"reason" : "REPLICA_ADDED",

"at" : "2020-12-16T13:18:24.160Z",

"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" : "2nEK_Bt1R5yfObiZTBha2Q",

 "node_name" : "data-9",

  "transport_address" : "192.168.3.57:9300",

  "node_attributes" : {

    "ml.machine_memory" : "270435311616",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

"node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    }

  ]

},

{

  "node_id" : "NVXXnkg9RcS1LJHbxE4JWw",

  "node_name" : "data-4",

  "transport_address" : "192.168.3.66:9300",

  "node_attributes" : {

    "ml.machine_memory" : "405356519424",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

  "node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    }

  ]

},

{

  "node_id" : "RViUJd6gQJui6Hu5clZh1g",

  "node_name" : "data-6",

  "transport_address" : "192.168.3.64:9300",

  "node_attributes" : {

    "ml.machine_memory" : "270435397632",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

  "node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    }

  ]

},

{

  "node_id" : "U8_onApfRnG7fpToARusIw",

  "node_name" : "data-7",

  "transport_address" : "192.168.3.63:9300",

  "node_attributes" : {

    "ml.machine_memory" : "270413611008",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

  "node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

   }

  ]

},

{

  "node_id" : "U_Gj7l6MToOyiHIVf8PKeQ",

  "node_name" : "data-10",

  "transport_address" : "192.168.3.72:9300",

  "node_attributes" : {

    "ml.machine_memory" : "67515105280",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

  "node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    }

  ]

},

{

  "node_id" : "_BUmAFaYTGi-6aaYnPlqvw",

  "node_name" : "data-1",

  "transport_address" : "192.168.3.68:9300",

  "node_attributes" : {

    "ml.machine_memory" : "270073581568",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

  "node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    }

  ]

},

{

  "node_id" : "jFQih3_gQ8-MdAzbTwlHFg",

  "node_name" : "data-5",

  "transport_address" : "192.168.3.65:9300",

  "node_attributes" : {

    "ml.machine_memory" : "270435397632",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

  "node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    }

  ]

},

{

  "node_id" : "nNuEnLSOQMWbx7C6u37bfQ",

  "node_name" : "data-11",

  "transport_address" : "192.168.3.71:9300",

  "node_attributes" : {

    "ml.machine_memory" : "67508068352",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

  "node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    }

  ]

},

{

  "node_id" : "pro3gLa8TuqWDxjBjVTZVw",

  "node_name" : "data-3",

  "transport_address" : "192.168.3.67:9300",

  "node_attributes" : {

    "ml.machine_memory" : "270073495552",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

  "node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    }

  ]

},

{

  "node_id" : "vKA6qG2WRr2VJnK4wNVYOA",

  "node_name" : "data-2",

  "transport_address" : "192.168.3.69:9300",

  "node_attributes" : {

    "ml.machine_memory" : "405356605440",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

  "node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    }

  ]

},

{

  "node_id" : "z7D9_J50QzW1d_5y2mqYZQ",

  "node_name" : "data-8",

  "transport_address" : "192.168.3.56:9300",

  "node_attributes" : {

    "ml.machine_memory" : "270073581568",

    "ml.max_open_jobs" : "20",

    "xpack.installed" : "true",

    "disk_type" : "ssd"

  },

  "node_decision" : "no",

  "deciders" : [

    {

      "decider" : "replica_after_primary_active",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    },

    {

      "decider" : "same_shard",

      "decision" : "NO",

      "explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[ticket][2], node[z7D9_J50QzW1d_5y2mqYZQ], [P], recovery_source[existing store recovery; bootstrap_history_uuid=false], s[INITIALIZING], a[id=IsvJcBeMQ3O1YMOyTkVO-A], unassigned_info[[reason=NODE_LEFT], at[2020-12-16T14:01:00.681Z], delayed=false, details[node_left [z7D9_J50QzW1d_5y2mqYZQ]], allocation_status[fetching_shard_data]]]"

    },

    {

      "decider" : "throttling",

      "decision" : "NO",

      "explanation" : "primary shard for this replica is not yet active"

    }

  ]

}

]

}
```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 21, 2020, 3:24am UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-primary-and-replica-shards/258891/2 "2020-12-21T03:24:12Z")

</div>

What is the output from the `_cat/recovery?v` endpoint?

---

<div class="post-metadata">

**Author:** ![RusseL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russel/32/77328_2.png) [@RusseL](https://discuss.elastic.co/u/RusseL)\
**Post date:** [December 21, 2020, 7:08am UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-primary-and-replica-shards/258891/3 "2020-12-21T07:08:54Z")

</div>

Thank you for your answer. I could not find a solution. Finally I delete the index and re-created it. There is no problem right now.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 18, 2021, 7:09am UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-primary-and-replica-shards/258891/4 "2021-01-18T07:09:02Z")

</div>

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