由于fsimage损坏,无法启动名称节点

时间:2019-02-27 02:37:23

标签: hadoop hdfs namenode

我有一个名称节点,其fsimage损坏了,并且目录中只有一个fsimage可用。我想从命令“ hdfs namenode -recover”中恢复它。但是,出现以下错误。

> 19/02/26 13:11:06 INFO util.GSet: 0.029999999329447746% max memory 889
> MB = 273.1 KB 19/02/26 13:11:06 INFO util.GSet: capacity      = 2^15 =
> 32768 entries 19/02/26 13:11:06 INFO hdfs.StateChange: STATE* Safe
> mode is ON.  It was turned on manually. Use "hdfs dfsadmin -safemode
> leave" to turn safe mode off. 19/02/26 13:11:06 INFO common.Storage:
> Lock on /home/rakeshbharadwaj/Desktop/hadoop-2.7.4-ex2/nn/in_use.lock
> acquired by nodename 5642@rakeshbharadwaj-VirtualBox 19/02/26 13:11:06
> INFO namenode.FileJournalManager: Recovering unfinalized segments in
> /home/rakeshbharadwaj/Desktop/hadoop-2.7.4-ex2/nn/current 19/02/26
> 13:11:06 INFO namenode.FSImage: Planning to load image:
> FSImageFile(file=/home/rakeshbharadwaj/Desktop/hadoop-2.7.4-ex2/nn/current/fsimage_0000000000000000009,
> cpktTxId=0000000000000000009) 19/02/26 13:11:06 ERROR
> namenode.FSImage: Failed to load image from
> FSImageFile(file=/home/rakeshbharadwaj/Desktop/hadoop-2.7.4-ex2/nn/current/fsimage_0000000000000000009,
> cpktTxId=0000000000000000009) java.io.IOException: Negative seek
> offset    at java.io.RandomAccessFile.seek(RandomAccessFile.java:555)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImageUtil.loadSummary(FSImageUtil.java:63)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImageFormatProtobuf$Loader.loadInternal(FSImageFormatProtobuf.java:196)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImageFormatProtobuf$Loader.load(FSImageFormatProtobuf.java:182)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImageFormat$LoaderDelegator.load(FSImageFormat.java:226)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:1010)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:994)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImageFile(FSImage.java:793)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:724)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:321)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:978)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:685)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.doRecovery(NameNode.java:1390)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1484)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1566)
> 19/02/26 13:11:06 WARN 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:739)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:321)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:978)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:685)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.doRecovery(NameNode.java:1390)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1484)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1566)
> 19/02/26 13:11:06 INFO namenode.MetaRecoveryContext: RECOVERY FAILED:
> caught exception 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:739)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:321)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:978)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:685)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.doRecovery(NameNode.java:1390)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1484)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1566)
> 19/02/26 13:11:06 ERROR namenode.NameNode: Failed to start namenode.
> 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:739)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:321)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:978)
>   at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:685)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.doRecovery(NameNode.java:1390)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1484)
>   at
> org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1566)
> 19/02/26 13:11:06 INFO util.ExitUtil: Exiting with status 1

我试图使节点退出安全模式,但它不起作用,并出现以下错误

./ hdfs dfsadmin -safemode离开 安全模式:由于发生连接异常而从rakeshbharadwaj-VirtualBox / 127.0.1.1到localhost:9001的调用失败:java.net.ConnectException:连接被拒绝;有关更多详细信息,请参见:http://wiki.apache.org/hadoop/ConnectionRefused

询问:我需要恢复fsimage并启动namenode的帮助。

0 个答案:

没有答案