English 中文(简体)
Hadoop - namenode is not starting up
原标题:
  • 时间:2013-05-23 11:41:41
  •  标签:
  • hadoop

I am trying to run hadoop as a root user, i executed namenode format command hadoop namenode -format when the Hadoop file system is running.

After this, when i try to start the name node server, it shows error like below

13/05/23 04:11:37 ERROR 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 org.apache.hadoop.hdfs.server.namenode.FSDirectory.loadFSImage(FSDirectory.java:100)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.initialize(FSNamesystem.java:411)

I tried to search for any solution, but cannot find any clear solution.

Can anyone suggest?

Thanks.

最佳回答

Cool, i have found the solution.

Stop all running server

1) stop-all.sh 

Edit the file /usr/local/hadoop/conf/hdfs-site.xml and add below configuration if its missing

<property>
    <name>dfs.data.dir</name>
    <value>/app/hadoop/tmp/dfs/name/data</value> 
    <final>true</final> 
    </property> 
    <property> 
    <name>dfs.name.dir</name>
    <value>/app/hadoop/tmp/dfs/name</value> 
    <final>true</final> 
</property>

Start both HDFS and MapReduce Daemons

2) start-dfs.sh
3) start-mapred.sh

Then now run the rest of the steps to run the map reduce sample given in this link

Note : You should be running the command bin/start-all.sh if the direct command is not running.

问题回答

DFS needs to be formatted. Just issue the following command after stopping all and then restart.

hadoop namenode -format

format hdfs when namenode stop.(just like the top answer).

I add some more details.

FORMAT command will check or create path/dfs/name, and initialize or reinitalize it. then running start-dfs.sh would run namenode, datanode, then namesecondary. when namenode check not exist path/dfs/name or not initialize, it occurs a fatal error, then exit. that s why namenode not start up.

more details you can check HADOOP_COMMON/logs/XXX.namenode.log

Make sure the directory you ve specified for your namenode is completely empty. Something like a "lost+found" folder in said directory will trigger this error.

hdfs-site.xml your value is wrong. You input the wrong folder that s why is not starting the name node.

First mkdir [folder], then set hdfs-site.xml then format

make sure that the directory to name(dfs.name.dir) and data (dfs.data.dir) folder is correctly listed in hdfs-site.xml

Formatting namenode worked for me

bin/hadoop namenode -format

After lot of search found the solution Open terminal and run stop-all.sh

hadoop namenode -format

start-all.sh

Found this answer in one of the community post in Model Coding youtube channel Post Link





相关问题
Hadoop - namenode is not starting up

I am trying to run hadoop as a root user, i executed namenode format command hadoop namenode -format when the Hadoop file system is running. After this, when i try to start the name node server, it ...

What default reducers are available in Elastic MapReduce?

I hope I m asking this in the right way. I m learning my way around Elastic MapReduce and I ve seen numerous references to the "Aggregate" reducer that can be used with "Streaming" job flows. In ...

Establishing Eclipse project environment for HadoopDB

I have checked-out a project from SourceForge named HadoopDB. It uses some class in another project named Hive. I have used Eclipse Java build path setting to link source to the Hive project root ...

Hadoop: intervals and JOIN

I m very new to Hadoop and I m currently trying to join two sources of data where the key is an interval (say [date-begin/date-end]). For example: input1: 20091001-20091002 A 20091011-20091104 ...

hadoop- determine if a file is being written to

Is there a way to determine if a file in hadoop is being written to? eg- I have a process that puts logs into hdfs. I have another process that monitors for the existence of new logs in hdfs, but I ...

Building Apache Hive - impossible to resolve dependencies

I am trying out the Apache Hive as per http://wiki.apache.org/hadoop/Hive/GettingStarted and am getting this error from Ivy: Downloaded file size doesn t match expected Content Length for http://...

热门标签