版本: 7.16-8.9
简而言之,当 Elasticsearch 无法为指定索引找到活动的分片副本时,会发生此错误。这可能是由于多种原因造成的,例如索引被删除、节点故障或网络分区。要解决此问题,您可以尝试从快照恢复索引,确保集群健康状态为绿色,或检查节点之间的网络连接。如果不再需要该索引,您也可以考虑删除它以避免此错误。
日志上下文 #
日志 “index [” + index + “] has no active shard copy” 的类名是 RequestDispatcher.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人使用;
for (String index : indices) {
final GroupShardsIteratorshardIts = clusterService.operationRouting()
.searchShards(clusterState; new String[] { index }; null; null; null; null);
final IndexSelector indexResult = new IndexSelector(shardIts);
if (indexResult.nodeToShards.isEmpty()) {
onIndexFailure.accept(index; new NoShardAvailableActionException(null; "index [" + index + "] has no active shard copy"));
} else {
this.indexSelectors.put(index; indexResult);
}
}
}





