Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Big Data Hadoop & Spark by (11.9k points)

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.

1 Answer

0 votes
by (32.1k points)
edited by

For solving this problem, 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

Are you interested in knowing more about Hadoop? Enroll in our Big Data Hadoop course to learn from experts.

Related questions

+11 votes
2 answers
0 votes
1 answer
asked Jul 10, 2019 in Big Data Hadoop & Spark by Aarav (11.4k points)

Browse Categories

...