Hadoop issue: Start Hadoop times NameNode uninitialized: Java.io.IOException:NameNode is not formatted.
1. Start Hadoop
[Email protected]:~/hadoop-1.0.4/bin$./start-all.sh starting Namenode, logging to/home/ubuntu/hadoop-1.0.4/libexec/ .. /logs/hadoop-ubuntu-namenode-ubuntu.outlocalhost:starting Datanode, logging to/home/ubuntu/hadoop-1.0.4/libexec/. /logs/hadoop-ubuntu-datanode-ubuntu.outlocalhost:starting Secondarynamenode, logging to/home/ubuntu/hadoop-1.0.4/ libexec/. /logs/hadoop-ubuntu-secondarynamenode-ubuntu.outstarting Jobtracker, logging to/home/ubuntu/hadoop-1.0.4/libexec/ .. /logs/hadoop-ubuntu-jobtracker-ubuntu.outlocalhost:starting Tasktracker, logging to/home/ubuntu/hadoop-1.0.4/ libexec/. /logs/hadoop-ubuntu-tasktracker-ubuntu.out
2. Access localhost:50070 failed, indicating Namenode failed to start
3. View Namenode boot Log
[email protected]:~/hadoop-1.0.4/bin$ cd /logs[email protected]:~/hadoop-1.0.4/logs$ view hadoop-ubuntu-namenode-ubuntu.log/************ startup_msg: starting namenodestartup_msg: host = ubuntu/127.0.1.1startup_msg: args = []startup_msg: version = 1.0.4startup_msg: build = https:// svn.apache.org/repos/asf/hadoop/common/branches/branch-1.0 -r 1393290; compiled by ' Hortonfo ' on wed oct 3 05:13:58 utc 2012***************************** /2013-01-24 07:05:46,936 info org.apache.hadoop.metrics2.impl.metricsconfig: loaded properties from hadoop-metrics2.properties2013-01-24 07:05:46,945 info Org.apache.hadoop.metrics2.impl.metricssourceadapter: mbean for source metricssystem,sub=stats registered.2013-01-24 07:05:46,945 info Org.apache.hadoop.metrics2.impl.metricssystemimpl: scheduled snapshot period at 10 second (s). 2013-01-24 07:05:46,945 info org.apache.hadoop.metrics2.impl.metricssystemimpl: NameNode metrics system started2013-01-24 07:05:47,053 INFO org.apache.hadoop.metrics2.impl.metricssourceadapter: mbean for source ugi Registered.2013-01-24 07:05:47,058 warn org.apache.hadoop.metrics2.impl.metricssystemimpl: Source name ugi already exists!2013-01-24 07:05:47,064 INFO org.apache.hadoop.metrics2.impl.metricssourceadapter: mbean for source jvm Registered.2013-01-24 07:05:47,064 info org.apache.hadoop.metrics2.impl.metricssourceadapter: mbean for source namenode registered.2013-01-24 07:05:47,092 info org.apache.hadoop.hdfs.util.gset: vm type = 32-bit2013-01-24 07:05:47,092 INFO org.apache.hadoop.hdfs.util.gset: 2% max memory = 19.33375 mb2013-01-24 07:05:47,092 info org.apache.hadoop.hdfs.util.gset: capacity = 2^22 = 4194304 entries2013-01-24 07:05:47,092 INFO org.apache.hadoop.hdfs.util.gset: recommended=4194304, actual=41943042013-01-24 07:05:47,140 INFO org.apache.hadoop.hdfs.server.namenode.FSNamesystem: fsOwner=ubuntu2013-01-24 07:05:47,140 info org.apache.hadoop.hdfs.server.namenode.fsnamesystem: supergroup= Supergroup2013-01-24 07:05:47,140 info org.apache.hadoop.hdfs.server.namenode.fsnamesystem: ispermissionenabled=true2013-01-24 07:05:47,143 info org.apache.hadoop.hdfs.server.namenode.fsnamesystem: dfs.block.invalidate.limit=1002013-01-24 07:05:47,143 info org.apache.hadoop.hdfs.server.namenode.fsnamesystem: isaccesstokenenabled=false Accesskeyupdateinterval=0 min (s), accesstokenlifetime=0 min (s) 2013-01-24 07:05:47,154 INFO org.apache.hadoop.hdfs.server.namenode.FSNamesystem: Registered fsnamesystemstatembean and namenodemxbean2013-01-24 07:05:47,169 info Org.apache.hadoop.hdfs.server.namenode.namenode: caching file names occuring more than 10 times 2013-01-24 07:05:47,174 ERROR org.apache.hadoop.hdfs.server.namenode.fsnamesystem: fsnamesystem initialization failed.java.io.ioexception: namenode is not formatted. at Org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead (fsimage.java:330) at&Nbsp;org.apache.hadoop.hdfs.server.namenode.fsdirectory.loadfsimage (fsdirectory.java:100) at org.apache.hadoop.hdfs.server.namenode.fsnamesystem.initialize (FSNamesystem.java:388) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init> (Fsnamesystem.java : 362) at org.apache.hadoop.hdfs.server.namenode.namenode.initialize (NameNode.java : 276) at org.apache.hadoop.hdfs.server.namenode.NameNode.<init> ( namenode.java:496) at Org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode (namenode.java:1279) at org.apache.hadoop.hdfs.server.namenode.namenode.main (namenode.java:1288) 2013-01-24 07:05:47,175 error org.apache.hadoop.hdfs.server.namenode.namenode: java.io.ioexception: namenode is not formatted. at org.apache.hadoop.hdfs.server.namenode.Fsimage.recovertransitionread (fsimage.java:330) at Org.apache.hadoop.hdfs.server.namenode.FSDirectory.loadFSImage (fsdirectory.java:100) at org.apache.hadoop.hdfs.server.namenode.fsnamesystem.initialize (fsnamesystem.java:388) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init> (fsnamesystem.java:362) at org.apache.hadoop.hdfs.server.namenode.namenode.initialize (NameNode.java:276) at org.apache.hadoop.hdfs.server.namenode.NameNode.<init> (namenode.java:496) at org.apache.hadoop.hdfs.server.namenode.namenode.createnamenode (NameNode.java : 1279) at org.apache.hadoop.hdfs.server.namenode.namenode.main (NameNode.java:1288)
Where "2013-01-24 07:05:47,174 ERROR Org.apache.hadoop.hdfs.server.namenode.FSNamesystem:FSNamesystem Initialization failed.
java.io.ioexception:namenode is not formatted. " One line shows that the Namenode is not initialized.
4, initializes the Namenode, but prompts whether to reinitialize Namenode, and then enter Y.
[email protected]:~/hadoop-1.0.4$ bin/hadoop namenode -format13/01/24 07:05:08 Info namenode. Namenode: startup_msg: /************************************************************startup_msg: Starting NameNodeSTARTUP_MSG: host = ubuntu/127.0.1.1STARTUP_MSG: args = [-format]startup_msg: version = 1.0.4startup_msg: build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.0 -r 1393290; compiled by ' Hortonfo ' on wed oct 3 05:13:58 utc 2012************************************************************/re-format filesystem in /home/ubuntu/hadoop-1.0.4/tmp/dfs/name ? (y or n) yformat aborted in /home/ubuntu/hadoop-1.0.4/tmp/dfs/name13/01/24 07:05:12 info namenode. Namenode: shutdown_Msg: /************************************************************shutdown_msg: shutting down namenode at ubuntu/127.0.1.1************************************************************/
5. After initialization, restart hadoop,localhost:50070 still access failed. View Namenode boot log, still reported Namenode not initialized error.
6. Delete all files under the TMP directory configured in the Core-site.xml configuration file;
Stop all Hadoop services;
Start Hadoop again and access localhost:50070 successfully.
[email protected]:~/hadoop-1.0.4/tmp$ rm -rf *[email protected]:~/hadoop-1.0.4/tmp$ &NBSP;CD&NBSP, .... /bin[email protected]:~/hadoop-1.0.4/bin$ ./stop-all.sh stopping jobtrackerlocalhost: stopping tasktrackerno namenode to stoplocalhost: stopping Datanodelocalhost: stopping secondarynamenode[email protected]:~/hadoop-1.0.4/bin$ hadoop namenode -format13/01/24 07:10:45 info namenode. Namenode: startup_msg: /************************************************************startup_msg: Starting NameNodeSTARTUP_MSG: host = ubuntu/127.0.1.1STARTUP_MSG: args = [-format]startup_msg: version = 1.0.4startup_msg: build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.0 -r 1393290; compiled by ' Hortonfo ' &NBSP;ON&NBSp wed oct 3 05:13:58 utc 2012**************************************************** /13/01/24 07:10:46 info util. Gset: vm type = 32-bit13/01/24 07:10:46 info util. Gset: 2% max memory = 19.33375 mb13/01/24 07:10:46 info util. Gset: capacity = 2^22 = 4194304 entries13/01/24 07:10:46 info util. Gset: recommended=4194304, actual=419430413/01/24 07:10:46 info namenode. Fsnamesystem: fsowner=ubuntu13/01/24 07:10:46 info namenode. Fsnamesystem: supergroup=supergroup13/01/24 07:10:46 info namenode. Fsnamesystem: ispermissionenabled=true13/01/24 07:10:46 info namenode. Fsnamesystem: dfs.block.invalidate.limit=10013/01/24 07:10:46 info namenode. Fsnamesystem:&nBsp;isaccesstokenenabled=false accesskeyupdateinterval=0 min (s), accesstokenlifetime=0 Min (s) 13/01/24 07:10:46 info namenode. Namenode: caching file names occuring more than 10 times 13/01/24 07:10:46 info common. storage: image file of size 112 saved in 0 seconds.13/01/24 07:10:46 info common. storage: storage directory /home/ubuntu/hadoop-1.0.4/tmp/dfs/name has been Successfully formatted.13/01/24 07:10:46 info namenode. Namenode: shutdown_msg: /************************************************************shutdown_msg: shutting down namenode at ubuntu/127.0.1.1****************************************** /[email protected]:~/hadoop-1.0.4/bin$ ./start-all.sh starting namenode, logging to /home/ubuntu/hadoop-1.0.4/libexec/. /logs/hadoop-ubuntu-namenode-ubuntu.outlocalhost: starting datanode, logging to /home /ubuntu/hadoop-1.0.4/libexec/. /logs/hadoop-ubuntu-datanode-ubuntu.outlocalhost: starting secondarynamenode, logging to /home/ubuntu/hadoop-1.0.4/libexec/. /logs/hadoop-ubuntu-secondarynamenode-ubuntu.outstarting jobtracker, logging to /home/ ubuntu/hadoop-1.0.4/libexec/. /logs/hadoop-ubuntu-jobtracker-ubuntu.outlocalhost: starting tasktracker, logging to /home/ubuntu/hadoop-1.0.4/libexec/. /logs/hadoop-ubuntu-tasktracker-ubuntu.out
7, originally modified the TMP directory in the configuration file did not initialize HDFs, resulting in the start of the Hadoop times Namenode no initialization error.
Hadoop starts without namenode process