启动hadoop时,发现没有NameNode进程。看了日志:
2016-10-11 20:00:17,341 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: NameNode metrics system stopped.
2016-10-11 20:00:17,341 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: NameNode metrics system shutdown complete.
2016-10-11 20:00:17,348 FATAL org.apache.hadoop.hdfs.server.namenode.NameNode: Exception in namenode join
<strong><span style="color:#ff0000;">java.io.IOException: NameNode is not formatted.</span></strong>
at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:210)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:787)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:568)
at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:443)
at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:491)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:684)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:669)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1254)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1320)
2016-10-11 20:00:17,427 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1
2016-10-11 20:00:17,444 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at master/10.4.26.77
************************************************************/
发现NameNode初始化失败。
晚上找了一些方法:直接删除namenode的配置文件目录,在重新format。
目录位置在你的hdfs-site.xml配置文件中可以找到:
<configuration>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>master:9001</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<strong><span style="color:#ff0000;background-color: rgb(255, 255, 255);"><value>file:/home/wxzhou/dfs/name</value></span></strong>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/home/wxzhou/dfs/data</value>
</property>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
</configuration>
删除后重新格式化一下,但是还是启动不了namenode。
哎。。。。搞了好久,都没有搞好。后来无意间发现,我用的格式化语句不对。
语句:
hdfs namenode –format
改成:
hadoop namenode format