📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-8.9

简而言之,当 Elasticsearch 尝试打开一个既无法打开也不抛出 ShardLockObtainFailedException 的存储时,会发生此错误。这可能是由于索引损坏或磁盘 I/O 错误导致的。要解决此问题,您可以尝试从快照恢复索引,或者如果数据可以恢复,则删除并重新创建索引。如果是磁盘 I/O 错误,请检查磁盘健康状况并在必要时更换它。此外,确保 Elasticsearch 具有访问数据目录的必要权限。

日志上下文 #

日志"仅允许可以打开的存储或在打开时抛出 ShardLockObtainFailedException 的存储,但得到了一个"的类名是 PrimaryShardAllocator.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

}
 }  if (allocationId != null) {
 assert nodeShardState.storeException() == null || nodeShardState.storeException() instanceof ShardLockObtainFailedException
 : "only allow store that can be opened or that throws a ShardLockObtainFailedException while being opened but got a "
 + "store throwing "
 + nodeShardState.storeException();
 numberOfAllocationsFound++;
 if (matchAnyShard || inSyncAllocationIds.contains(nodeShardState.allocationId())) {
 nodeShardStates.add(nodeShardState);