项目场景:

集群断电之后重启集群,namenode启动失败,去hadoop安装目录差看日志
/hadoop/logs 发现There appears to be a gap in the edit log. We expected txid 867311, but got txid 867402.


问题描述:

down standby NN.
java.io.IOException: There appears to be a gap in the edit log.  We expected txid 867311, but got txid 867402.
        at org.apache.hadoop.hdfs.server.namenode.MetaRecoveryContext.editLogLoaderPrompt(MetaRecoveryContext.java:94)
        at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadEditRecords(FSEditLogLoader.java:218)
        at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadFSEdits(FSEditLogLoader.java:146)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.loadEdits(FSImage.java:891)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.loadEdits(FSImage.java:872)
        at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer.doTailEdits(EditLogTailer.java:262)
        at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer$EditLogTailerThread.doWork(EditLogTailer.java:395)
        at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer$EditLogTailerThread.access$300(EditLogTailer.java:348)
        at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer$EditLogTailerThread$1.run(EditLogTailer.java:365)
        at org.apache.hadoop.security.SecurityUtil.doAsLoginUserOrFatal(SecurityUtil.java:481)
        at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer$EditLogTailerThread.run(EditLogTailer.java:361)
2020-12-07 16:45:36,940 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1: java.io.IOException: There appears to be a gap in the edit
 log.  We expected txid 867311, but got txid 867402.

解决方案:

1.进入安装hadoop目录bin下
执行:修复元数据
hadoop namenode –recover
选择Y
选择c
启动:
start-all.sh

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐