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

版本: 6.8-8.9

简而言之,当 Elasticsearch 在为事务日志(translog)准备目标时遇到问题,就会发生此错误。这可能是由于磁盘空间不足、文件系统损坏或网络连接问题造成的。要解决此问题,你可以尝试释放磁盘空间、检查文件系统是否存在错误,或排查网络连接问题。此外,确保 Elasticsearch 版本是最新的,并与你的系统兼容。如果问题仍然存在,可以考虑重新索引数据或从备份恢复。

日志上下文 #

“prepare target for translog failed” 日志的类名是 RecoverySourceHandler.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

final ActionListenerwrappedListener = ActionListener.wrap(nullVal -> {
 stopWatch.stop();
 final TimeValue tookTime = stopWatch.totalTime();
 logger.trace("recovery [phase1]: remote engine start took [{}]"; tookTime);
 listener.onResponse(tookTime);
 }; e -> listener.onFailure(new RecoveryEngineException(shard.shardId(); 1; "prepare target for translog failed"; e)));
 // Send a request preparing the new shard's translog to receive operations. This ensures the shard engine is started and disables
 // garbage collection (not the JVM's GC!) of tombstone deletes.
 logger.trace("recovery [phase1]: prepare remote engine for translog");
 cancellableThreads.checkForCancel();
 recoveryTarget.prepareForTranslogOperations(totalTranslogOps; wrappedListener);