无法使用“hdfs namenode importcheckpoint”导入新的fsimage

8oomwypt  于 2021-05-27  发布在  Hadoop
关注(0)|答案(0)|浏览(433)

我有一个名称节点,其fsimage已损坏,并且我只有一个fsimage可用。我有一个secondarynamenode,它有可用的检查点。现在,我想把checkpoint导入一个新目录。旧目录: cd /home/rakeshbharadwaj/Desktop/hadoop-2.7.4-ex2/nn 新目录:我已将hdfs-site.xml中的 /home/rakeshbharadwaj/Desktop/hadoop-2.7.4-ex2/new 我试着跑 hdfs namenode importcheckPoint 它给了我以下错误

19/02/26 12:38:51 INFO common.Storage: Lock on /home/rakeshbharadwaj/Desktop/hadoop-2.7.4-ex2/new/in_use.lock acquired by nodename 5270@rakeshbharadwaj-VirtualBox
19/02/26 12:38:51 INFO namenode.FSImage: Storage directory /home/rakeshbharadwaj/Desktop/hadoop-2.7.4-ex2/new is not formatted.
19/02/26 12:38:51 INFO namenode.FSImage: Formatting ...
19/02/26 12:38:51 INFO common.Storage: Lock on /tmp/hadoop-rakeshbharadwaj/dfs/namesecondary/in_use.lock acquired by nodename 5270@rakeshbharadwaj-VirtualBox
19/02/26 12:38:51 WARN namenode.FSNamesystem: Encountered exception loading fsimage
java.io.IOException: NameNode is not formatted.
    at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:235)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.doImportCheckpoint(FSImage.java:580)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:311)
    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.loadNamesystem(NameNode.java:585)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:645)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:819)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:803)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1500)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1566)
19/02/26 12:38:51 INFO mortbay.log: Stopped HttpServer2$SelectChannelConnectorWithSafeStartup@0.0.0.0:50070

因此,我通过运行 hdfs namenode -format . 格式是成功的。在格式化之后有一个新的图像形成fsimage\u0000000000000
现在,我运行 hdfs namenode -importCheckpoint 它又给了我以下的错误。

19/02/26 12:30:47 WARN namenode.FSNamesystem: Encountered exception loading fsimage
java.io.IOException: Cannot import image from a checkpoint.  NameNode already contains an image in /home/rakeshbharadwaj/Desktop/hadoop-2.7.4-ex2/n
    at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverStorageDirs(FSImage.java:392)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:225)
    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.loadNamesystem(NameNode.java:585)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:645)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:819)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:803)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1500)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1566)

问题:如何解决这个问题并从新目录中的检查点获取fsimage。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题