如何修复opensearch集群上的红色状态



我们有一个opensearch集群,并注意到该集群已关闭。有AWS支持帮助我恢复集群,但尽管集群现在处于活动状态,但我仍然看到集群处于红色状态,因为其中一个碎片未分配。

在集群中断期间,碎片似乎未分配。我不知道如何恢复到绿色状态。

关于如何解决这个问题有什么建议吗?

我应该删除这个碎片吗?这样能解决问题吗?我尝试过重新分配,但由于碎片副本丢失,看起来不起作用。当集群关闭时,我们的备份也受到了影响。

是否获取集群/健康(_C(?漂亮的

{
"cluster_name" : "xxxx-xxx-xxx",
"status" : "red",
"timed_out" : false,
"number_of_nodes" : 3,
"number_of_data_nodes" : 3,
"discovered_master" : true,
"active_primary_shards" : 150,
"active_shards" : 300,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 4,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 98.68421052631578
}

是否获取集群/分配/解释(_C(?漂亮的

{
"index" : ".opendistro-alerting-alerts",
"shard" : 4,
"primary" : true,
"current_state" : "unassigned",
"unassigned_info" : {
"reason" : "CLUSTER_RECOVERED",
"at" : "2022-01-11T13:14:16.096Z",
"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" : "xxxxx",
"node_name" : "sssssssssssssssssssss",
"node_decision" : "no",
"store" : {
"found" : false
}
}

如果你不确定这是唯一的原因(碎片未分配(,你可以查看这个链接来找出问题。由于不同的原因,它可能是红色的
您可以尝试删除碎片并进行检查,但我想您需要删除索引。您可以使用GET /_cat/indices?v搜索red索引。您将丢失一些数据,但您的集群将返回到green
更新:无法删除未分配的碎片(因为它根本不存在(

相关内容

最新更新