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