Namenode目录位于令人惊讶的位置

时间:2013-11-01 20:48:17

标签: hadoop hdfs

我在hdfs-site.xml中设置了dfs.name.dir,如下所示:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
 <property>
    <name>dfs.name.dir</name>
    <value>>/mnt/data/nn</value>
  </property>
 <property>
    <name>dfs.data.dir</name>
    <value>>/mnt/data/dfs</value>
  </property>
  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>
</configuration>

但是namenode正在尝试访问以下目录:

/usr/local/Cellar/hadoop/1.2.1/libexec/>/mnt/data/nn

这恰好是:

的价值
$HADOOP_HOME>[value of dfs.name.dir]

以下是namenode日志:

2013-11-01 13:38:59,806 INFO org.apache.hadoop.hdfs.server.namenode.FSEditLog: dfs.namenode.edits.toleration.length = 0
2013-11-01 13:38:59,806 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: Caching file names occuring more than 10 times
2013-11-01 13:38:59,808 INFO org.apache.hadoop.hdfs.server.common.Storage: Storage directory /usr/local/Cellar/hadoop/1.2.1/libexec/>/mnt/data/nn does not exist
2013-11-01 13:38:59,809 ERROR org.apache.hadoop.hdfs.server.namenode.FSNamesystem: FSNamesystem initialization failed.
org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /usr/local/Cellar/hadoop/1.2.1/libexec/>/mnt/data/nn is in an inconsistent state: storage directory does not exist or is not accessible.
        at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:304)
        at org.apache.hadoop.hdfs.server.namenode.FSDirectory.loadFSImage(FSDirectory.java:104)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.initialize(FSNamesystem.java:427)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:395)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:299)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:569)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1479)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1488)

1 个答案:

答案 0 :(得分:4)

有两点需要注意,可能会导致这个问题:

  1. NameNode从一个名为hdfs-site.xml的文件(来自$ HADOOP_CONF目录)中读取它的配置,而不是你在问题中记下的hive-site.xml(我猜你已经从hdfs-复制了它) site.xml进入此文件)
  2. 在hdfs-site.xml中检查您的配置 - 如果您复制了配置,看起来您有一个领先的&gt;在您想要的目录之前:
    • <value>>/mnt/data/dfs</value> &lt;&lt;从此值更改
    • <value>/mnt/data/dfs</value> &lt;&lt;修改此值