0
votes

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?

3
The command for user hduser is not working..... hduser@raj-SVE15115ENB:~$ sudo gedit /home/hduser/.bashrc [sudo] password for hduser: hduser is not in the sudoers file. This incident will be reported. hduser@raj-SVE15115ENB:~$ gedit /home/hduser/.bashrc No protocol specified ** (gedit:8250): WARNING **: The connection is closed No protocol specified Cannot open display:RAP

3 Answers

1
votes

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

0
votes

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.

0
votes

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