Shard unassigned

Hi all,
My elasticsearch cluster health is red. in order to find reason following command has been ran:

`GET _cluster/allocation/explain

    {
      "index" : "mytweetindex",
      "shard" : 1,
      "primary" : true,
      "current_state" : "unassigned",
      "unassigned_info" : {
        "reason" : "CLUSTER_RECOVERED",
        "at" : "2020-06-14T13:39:13.479Z",
        "last_allocation_status" : "no_valid_shard_copy"
      },
      "can_allocate" : "no_valid_shard_copy",
      "allocate_explanation" : "cannot allocate because a previous copy of the primary shard existed but can no longer be found on the nodes in the cluster",
      "node_allocation_decisions" : [
        {
          "node_id" : "NGbarJGpQAS21fmW2aNfZw",
          "node_name" : "node-1",
          "transport_address" : "10.0.0.118:9300",
          "node_attributes" : {
            "ml.machine_memory" : "8589328384",
            "ml.max_open_jobs" : "20",
            "xpack.installed" : "true",
            "ml.enabled" : "true"
          },
          "node_decision" : "no",
          "store" : {
            "found" : false
          }
        },
        {
          "node_id" : "fzIrudooTo6RJmRgCMJU7Q",
          "node_name" : "node-2",
          "transport_address" : "10.0.0.117:9300",
          "node_attributes" : {
            "ml.machine_memory" : "8589328384",
            "ml.max_open_jobs" : "20",
            "xpack.installed" : "true",
            "ml.enabled" : "true"
          },
          "node_decision" : "no",
          "store" : {
            "found" : false
          }
        },
        {
          "node_id" : "v8T3-BfXTJmmjPPyCLqWaQ",
          "node_name" : "node-3",
          "transport_address" : "10.0.0.119:9300",
          "node_attributes" : {
            "ml.machine_memory" : "8589328384",
            "ml.max_open_jobs" : "20",
            "xpack.installed" : "true",
            "ml.enabled" : "true"
          },
          "node_decision" : "no",
          "store" : {
            "found" : false
          }
        }
      ]
    }

`

by searching following solution has been found:

POST /_cluster/reroute
{
	"commands" : [
 
    	{
      	"allocate_stale_primary" : {
            	"index" : "mytweetindex", "shard" : 1,
            	"node" : "node-1",
            	"accept_data_loss":"true"
      	}
    	}
	]
}

but when i check unassigned shards using following, still the index shard is unassigned

GET _cat/shards?h=index,shard,prirep,state,unassigned.reason| grep UNASSIGNED

mytweetindex                             1 p UNASSIGNED
mytweetindex                             1 r UNASSIGNED
mytweetindex                             3 p STARTED
mytweetindex                             3 r STARTED
mytweetindex                             2 r STARTED
mytweetindex                             2 p STARTED
mytweetindex                             4 r STARTED
mytweetindex                             4 p STARTED
mytweetindex                             0 p STARTED
mytweetindex                             0 r STARTED

Could you please advise me about this in order to handle this issue? many thanks.

try /reroute 'allocate_empty_primary'

Dear KellyK313,
Many thanks.
The issue has been solved.
Regards

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