--- title: "等待分片移交超时 - 如何解决此Elasticsearch异常" date: 2026-03-23 lastmod: 2026-03-23 description: "当Elasticsearch无法在设定的超时时间内完成分片迁移时会出现此错误。可能是由于繁重的索引或搜索负载、网络问题或资源不足导致的。" tags: ["分片迁移", "超时错误", "集群性能", "故障排查"] summary: "版本: 6.8-8.9 简而言之,当Elasticsearch无法在设定的超时时间内完成分片迁移时,就会发生此错误。这可能是由于繁重的索引或搜索负载、网络问题或资源不足造成的。要解决此问题,您可以增加超时时间、减少集群负载,或者为集群添加更多资源。此外,还要检查可能导致迁移过程缓慢的网络问题。 日志上下文 # 日志"timed out waiting for relocation hand-off to complete"的类名是 IndexShard.java。 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考: // This is really bad as ongoing replication operations are preventing this shard from completing relocation // hand-off. // Fail primary relocation source and target shards. failShard("timed out waiting for relocation hand-off to complete"; null); listener.onFailure( new IndexShardClosedException(shardId(); "timed out waiting for relocation hand-off to complete") ); } else { listener." --- > **版本:** 6.8-8.9 简而言之,当Elasticsearch无法在设定的超时时间内完成分片迁移时,就会发生此错误。这可能是由于繁重的索引或搜索负载、网络问题或资源不足造成的。要解决此问题,您可以增加超时时间、减少集群负载,或者为集群添加更多资源。此外,还要检查可能导致迁移过程缓慢的网络问题。 日志上下文 ----------- 日志"timed out waiting for relocation hand-off to complete"的类名是[IndexShard.java。](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/) 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考: ```java // This is really bad as ongoing replication operations are preventing this shard from completing relocation // hand-off. // Fail primary relocation source and target shards. failShard("timed out waiting for relocation hand-off to complete"; null); listener.onFailure( new IndexShardClosedException(shardId(); "timed out waiting for relocation hand-off to complete") ); } else { listener.onFailure(e); } } ```