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

lnlaulya  于 2021-05-31  发布在  Hadoop
关注(0)|答案(1)|浏览(389)

我使用cdh(clouderadistributionhadoop)启动hdsf时,没有namenode

$ sbin/start-dfs.sh

日本:

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

名称节点日志是这样的

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:

core-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,然后重新启动,但也没有namenode。
如果删除

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

从core site.xml,并使用默认目录,则有namenode,没有datanode

u3r8eeie

u3r8eeie1#

试试这个:
rm-rf/主页/hadoop/应用程序/tmp/*
hadoop namenode-格式
启动hadoop服务!!!全部启动.sh
希望这有帮助!!!干杯!!!

相关问题