在清空/tmp 和/home/centos/downloads/hadoop-2.7.2/logs中的数据执行start-all.sh后,主控制机只出现了SecondaryNameNode节点和ResourceManager节点,名称节点namenode缺失。web端的50070接口也无法打开!
一定要看日志信息!
cd /home/centos/downloads/hadoop-2.7.2/logs
cat hadoop-centos-namenode-s201.log (名称节点日志信息)
ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: Failed to start namenode.
org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /home/centos/downloads/hadoop-2.7.2/3 is in an inconsistent state: storage directory does not exist or is not accessible.
这就很明确了:
在/home/centos/downloads/hadoop-2.7.2这个文件夹下3这个目录不存在或者不可访问
查看/home/centos/downloads/hadoop-2.7.2这歌目录,确实没有3这个文件夹。
但是在更新的时候有这样一段
/home/centos/downloads/hadoop-2.7.2/bin/3 has formated
说明在/home/centos/downloads/hadoop-2.7.2/bin下面有一个名字为3的文件夹
将他拷贝到/home/centos/downloads/hadoop-2.7.2下再次格式化并执行start-all.sh
namenode节点启动成功!