2

我在 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]

以下是名称节点日志:

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)
4

1 回答 1

4

需要注意的两件事可能会导致您出现此问题:

  1. NameNode 从名为 hdfs-site.xml 的文件(来自 $HADOOP_CONF 目录)读取它的配置,而不是您在问题中提到的 hive-site.xml(我猜您是从 hdfs-site.xml 复制的进入这个文件)
  2. 检查 hdfs-site.xml 中的配置 - 如果您已复制配置,看起来您在所需目录之前有一个前导 >:
    • <value>>/mnt/data/dfs</value> <<从此值更改
    • <value>/mnt/data/dfs</value> << 修改这个值
于 2013-11-01T21:29:23.880 回答