我在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)
答案 0 :(得分:4)
有两点需要注意,可能会导致这个问题:
<value>>/mnt/data/dfs</value>
&lt;&lt;从此值更改 <value>/mnt/data/dfs</value>
&lt;&lt;修改此值