Cannot start NameNode in Hadoop 1.2.1

I had recently installed Hadoop 1.2.1 on Ubuntu and after configuring Hadoop as per the requirement I was unable to start the NameNode daemon. This was a fresh installation and initially the NameNode daemon was running but when i stopped it and then tried to start it again it started giving me issues.

I rebooted the Ubuntu machine but with no luck then here is what I did to fix this issue

  • (stops all the running daemons)
  • Manually delete the contents from the tmp directory (/usr/local/hadoop/tmp)
  • hadoop namenode - format (formats the NameNode)
  • (Starts all the daemons)

After following the above procedure I was able to start my Namenode daemon and I even restarted my machine to test and I was able to bring it back up. Since this was a fresh installation of Hadoop I was able to format the namenode to fix the issue but in a production environment you might have to look for other solutions!

PS: I am just starting out with Hadoop so my knowledge is at the extreme novice level...