In my cluster there are unassigned shards which are not primary shards.
I don't know why I have these secondary shards in my cluster. I didn't create them intentionally and I use the default configuration (elasticsearch.yml). How can I delete these unnassigned shards? (without deleting the primary shard)
GET _cluster/allocation/explain?pretty
{
"index": "0001.metadata",
"shard": 0,
"primary": false
}
{
"index" : "0001.metadata",
"shard" : 0,
"primary" : false,
"current_state" : "unassigned",
"unassigned_info" : {
"reason" : "CLUSTER_RECOVERED",
"at" : "2023-03-10T07:22:54.916Z",
"last_allocation_status" : "no_attempt"
},
"can_allocate" : "no",
"allocate_explanation" : "Elasticsearch isn't allowed to allocate this shard to any of the nodes in the cluster. Choose a node to which you expect this shard to be allocated, find this node in the node-by-node explanation, and address the reasons which prevent Elasticsearch from allocating this shard there.",
"node_allocation_decisions" : [
{
"node_id" : "4S9PhH2FQymVIe3tysYpww",
"node_name" : "FM11L",
"transport_address" : "127.0.0.1:9300",
"node_attributes" : {
"ml.max_jvm_size" : "17037262848",
"xpack.installed" : "true",
"ml.machine_memory" : "34069057536"
},
"node_decision" : "no",
"deciders" : [
{
"decider" : "same_shard",
"decision" : "NO",
"explanation" : "a copy of this shard is already allocated to this node [[0001.metadata][0], node[4S9PhH2FQymVIe3tysYpww], [P], s[STARTED], a[id=e6Kbv9aSQt6LaHlnf023sg]]"
}
]
}
]
}