4

我正在运行单个节点。NameNode在启动集群时总是开始失败。我得到以下错误。

    2013-06-29 10:37:29,968 FATAL org.apache.hadoop.hdfs.server.namenode.NameNode: Exception in namenode join
org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /tmp/hadoop/dfs/name is in an inconsistent state: storage directory does not exist or is not accessible.
    at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverStorageDirs(FSImage.java:292)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:200)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:627)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:469)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:403)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:437)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:609)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:594)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1169)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1235)
2013-06-29 10:37:29,971 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1
2013-06-29 10:37:29,973 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at traw-pc/127.0.0.1
************************************************************/

我知道有同样的问题,我们可以通过格式化来解决NameNode。但我的问题是,为什么每次都会出现这个错误?这不是什么大问题,因为我正在跑步Single Node cluster。但在实际生产环境中,这可能会导致数据松动。我的猜测是因为我使用的是/tmp目录。

4

1 回答 1

0

This can be resolved by specifying your namenode dir to a different location is "hdfs-site.xml" in your Hadoop Configuration . Generally it takes default file://${hadoop.tmp.dir}/dfs/name .. So , after every reboot the /tmp directory is cleared and NameNode data is gone

于 2015-04-17T19:28:21.677 回答