版本: 7.12-8.9
简而言之,当 Elasticsearch 无法找到特定分片时会发生此错误。这可能是由于节点故障、网络问题或磁盘损坏导致的。要解决此问题,您可以尝试重启 Elasticsearch 节点,检查节点之间的网络连接,或从快照恢复分片。如果分片永久丢失且没有可用的快照,您可能需要重新索引数据。
日志上下文 #
日志 “missing shard” 的类名是 TransportDownsampleIndexerAction.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人参考:
long numIndexed = 0;
int successfulShards = 0;
for (int i = 0; i < shardsResponses.length(); i++) {
Object shardResponse = shardsResponses.get(i);
if (shardResponse == null) {
throw new ElasticsearchException("missing shard");
} else if (shardResponse instanceof DownsampleIndexerAction.ShardDownsampleResponse r) {
successfulShards++;
numIndexed += r.getNumIndexed();
} else if (shardResponse instanceof Exception e) {
throw new ElasticsearchException(e);





