hadoop/hdfs/name is in an inconsistent state: storage directory(hadoop/hdfs/data/) does not exist or is not accessible

此生再无相见时 提交于 2019-12-04 01:31:14
Tariq

Removed the "file:" from the hdfs-site.xml file

[WRONG HDFS-SITE.XML]

  <property>
  <name>dfs.namenode.name.dir</name>
  <value>file:/home/hduser/mydata/hdfs/namenode</value>
  </property>
  <property>
  <name>dfs.datanode.data.dir</name>
  <value>file:/home/hduser/mydata/hdfs/datanode</value>
  </property>

[CORRECT HDFS-SITE.XML]

  <property>
  <name>dfs.namenode.name.dir</name>
  <value>/home/hduser/mydata/hdfs/namenode</value>
  </property>


  <property>
  <name>dfs.datanode.data.dir</name>
  <value>/home/hduser/mydata/hdfs/datanode</value>
  </property>

Thanks to Erik for the help.

Follow the below steps,

1.Stop all services

2.Format your namenode

3.Delete your data node directory

4.start all services

run these commands on terminal

$ cd ~
$ mkdir -p mydata/hdfs/namenode
$ mkdir -p mydata/hdfs/datanode

give permission to both directory 755

then,

Add this property in conf/hdfs-site.xml

  <property>
 <name>dfs.namenode.name.dir</name>
 <value>file:/home/hduser/mydata/hdfs/namenode</value>
</property>


<property>
 <name>dfs.datanode.data.dir</name>
 <value>file:/home/hduser/mydata/hdfs/datanode</value>
</property>

if not work ,then

stop-all.sh
start-all.sh

1) name node directory you should be owner and give chmod 750 appropriately
2)stop all services
3)use hadoop namenode -format to format namenode
4)add this to hdfs-site.xml

<property>
    <name>dfs.data.dir</name>
    <value>path/to/hadooptmpfolder/dfs/name/data</value> 
    <final>true</final> 
    </property> 
    <property> 
    <name>dfs.name.dir</name>
    <value>path/to/hadooptmpfolder/dfs/name</value> 
    <final>true</final> 
</property> 

5) to run hadoop namenode -format add export PATH=$PATH:/usr/local/hadoop/bin/ in ~/.bashrc wherever hadoop is unzip add that in path

tmndungu

Had similar problem, I formatted the namenode then started it

Hadoop namenode -format
hadoop-daemon.sh start namenode
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!