解决HDFS无法启动namenode,报错Premature EOF from inputStream;Failed to load FSImage file, see error(s) above
2022/1/4 1:37:16
本文主要是介绍解决HDFS无法启动namenode,报错Premature EOF from inputStream;Failed to load FSImage file, see error(s) above,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
一.情况描述
启动hadoop后发现无法打开hdfs web界面,50070打不开,于是jps发现少了一个namenode:
查看日志信息,发现如下报错:
2022-01-03 23:54:10,993 INFO org.apache.hadoop.hdfs.server.namenode.FSImage: Planning to load image: FSImageFile(file=/export/servers/hadoop-3.1.4/hadoopDatas/namenodeDatas/current/fsimage_0000000000000052563, cpktTxId=0000000000000052563) 2022-01-03 23:54:10,999 ERROR org.apache.hadoop.hdfs.server.namenode.FSImage: Failed to load image from FSImageFile(file=/export/servers/hadoop-3.1.4/hadoopDatas/namenodeDatas/current/fsimage_0000000000000052563, cpktTxId=0000000000000052563) java.io.IOException: Premature EOF from inputStream at org.apache.hadoop.io.IOUtils.readFully(IOUtils.java:212) at org.apache.hadoop.hdfs.server.namenode.FSImageFormat$LoaderDelegator.load(FSImageFormat.java:222) at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:962) at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:946) at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImageFile(FSImage.java:807) at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:738) at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:336) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:1132) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:747) at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:652) at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:723) at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:966) at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:939) at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1705) at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1772) 2022-01-03 23:54:11,015 INFO org.apache.hadoop.hdfs.server.namenode.FSImage: Planning to load image: FSImageFile(file=/export/servers/hadoop-3.1.4/hadoopDatas/namenodeDatas2/current/fsimage_0000000000000052563, cpktTxId=0000000000000052563) 2022-01-03 23:54:11,015 ERROR org.apache.hadoop.hdfs.server.namenode.FSImage: Failed to load image from FSImageFile(file=/export/servers/hadoop-3.1.4/hadoopDatas/namenodeDatas2/current/fsimage_0000000000000052563, cpktTxId=0000000000000052563) java.io.IOException: Premature EOF from inputStream at org.apache.hadoop.io.IOUtils.readFully(IOUtils.java:212) at org.apache.hadoop.hdfs.server.namenode.FSImageFormat$LoaderDelegator.load(FSImageFormat.java:222) at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:962) at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:946) at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImageFile(FSImage.java:807) at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:738) at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:336) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:1132) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:747) at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:652) at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:723) at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:966) at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:939) at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1705) at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1772) 2022-01-03 23:54:11,021 WARN org.apache.hadoop.hdfs.server.namenode.FSNamesystem: Encountered exception loading fsimage java.io.IOException: Failed to load FSImage file, see error(s) above for more info. at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:752) at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:336) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:1132) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:747) at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:652) at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:723) at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:966) at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:939) at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1705) at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1772)
二.解决方案
根据报错信息,发现是读取文件错误,后面即是文件路径名称,我这里是读取两个文件出错,然后删除日志中读取错误的文件(可以提前备份)
我这里已经删除了(.md5可以不删),之后重启hdfs,可以发现namenode已启动
重新进入hdfs页面
这篇关于解决HDFS无法启动namenode,报错Premature EOF from inputStream;Failed to load FSImage file, see error(s) above的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-22程序员出海做 AI 工具:如何用 similarweb 找到最佳流量渠道?
- 2024-12-20自建AI入门:生成模型介绍——GAN和VAE浅析
- 2024-12-20游戏引擎的进化史——从手工编码到超真实画面和人工智能
- 2024-12-20利用大型语言模型构建文本中的知识图谱:从文本到结构化数据的转换指南
- 2024-12-20揭秘百年人工智能:从深度学习到可解释AI
- 2024-12-20复杂RAG(检索增强生成)的入门介绍
- 2024-12-20基于大型语言模型的积木堆叠任务研究
- 2024-12-20从原型到生产:提升大型语言模型准确性的实战经验
- 2024-12-20啥是大模型1
- 2024-12-20英特尔的 Lunar Lake 计划:一场未竟的承诺