无法启动namenode。目录处于不一致状态:存储目录不存在或无法访问

时间:2018-04-22 15:32:14

标签: hadoop cloudera-cdh

我使用CDH(Cloudera Distribution Hadoop) 当我启动hdsf时,没有namenode

  $ sbin/start-dfs.sh

JPS:

 hadoop@hekuang:~/app/hadoop-2.6.0-cdh5.7.0/sbin$ jps
10489 DataNode
10685 SecondaryNameNode
11469 Jps

和namenode这样的日志

2018-04-22 15:18:48,062 ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: Failed to start namenode.
org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /home/hadoop/app/tmp/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:314)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:202)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:1063)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:767)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:609)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:670)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:838)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:817)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1538)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1606)
2018-04-22 15:18:48,066 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1
2018-04-22 15:18:48,068 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG: 

芯-site.xml中

<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://hekuang:8020</value>
    </property>
<property>
        <name>hadoop.tmp.dir</name>
        <value>/home/hadoop/app/tmp</value>
    </property>
</configuration>

hdfs-site.xml

<configuration>

<property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
</configuration>

我尝试删除/ home / hadoop / app / tmp,然后重启,tbut也没有namenode。

如果删除

<property>
    <name>hadoop.tmp.dir</name>
    <value>/home/hadoop/app/tmp</value>
</property>

来自core-site.xml,并使用默认目录  然后有namenode而没有DataNode

1 个答案:

答案 0 :(得分:1)

试试这个:

  1. rm -rf / home / hadoop / app / tmp / *

  2. hadoop namenode -format

  3. 启动Hadoop服务!!! start-all.sh

  4. 希望这会有所帮助!!!干杯!!!