RAP
RAP

Reputation: 21

Formatting namenode for Hadoop Installation

How to format Namenode of HDFS? I have tried folliwing commands raj@raj-SVE15115ENB:~$ /home/raj/hadoop/bin/hadoop namenode -format Warning: $HADOOP_HOME is deprecated.

/home/raj/hadoop/bin/hadoop: line 320: /usr/lib/jvm/java-7-sun/bin/java: No such file or directory /home/raj/hadoop/bin/hadoop: line 390: /usr/lib/jvm/java-7-sun/bin/java: No such file or directory Why this is happening?

Upvotes: 0

Views: 211

Answers (3)

Ravi H
Ravi H

Reputation: 596

if your working with yarn or recent version, then use this command for namenode formating

bin/hdfs namenode -format

and set $java_home with full path in .bashrc and hadoop-env.sh files

after this format the namenode

Upvotes: 0

bigdatauser
bigdatauser

Reputation: 136

Command to format name node is

hadoop namenode -format

But by checking the logs you provided, it seems that java home is not correct.

Open .bashrc file

Check the value 'JAVA_HOME' is same as where you have Java package, else change it to corresponding path

also add java bin location to 'PATH' variable

Upvotes: 1

Lauri Peltonen
Lauri Peltonen

Reputation: 1542

Depends on your Hadoop version. With the recent versions, the command is bin/hdfs namenode -format. But according to my experience, at least these basic commands work just fine with the hadoop runner, even if it complains about deprecation.

Your problem is in the Java path. The system does not find your Java. First find out where your Java JRE is installed on the system and set the JAVA_HOME variable to point to it.

Upvotes: 0

Related Questions