when i tried to run the hdfs namenode -format command its failed to run can anyone help me with this

+1 vote

Jul 22, 2018 in Big Data Hadoop by suriyaprakash
• 130 points

3 answers to this question.

+1 vote
Hi Suriyaprakash,

I guess the path for hadoop and java is not set properly in your windows system. Follow the below steps:

1. Go to Control Panel\System and Security\System , click on environment variables and create user variable for Hadoop and system variable for Java as mentioned below, if its not set:

User Variable

Variable name: HADOOP_HOME

Variable value: E:\hadoop-2.7.1

Note: my hadoop is present in E drive

System Variable

Variable name: JAVA_HOME

Variable value: C:\Program Files\jdk1.8.0_51

2. Add bin directories of java and hadoop in 'Path' variable name present in system variable:

C:\Program Files\jdk1.8.0_51\bin


Once this is set, your hdfs or hadoop command will work.

Open a new command prompt, type hdfs and click on enter. If you get all hdfs command options, its means path got set correctly and now you can run the format command. But if you don't get hdfs command options, the path was not set correctly, check it again.

Hope this helps!!
answered Jul 23, 2018 by avi_man_utd
When ever I bin in Java path it shows error and fails to format name node
Are other Hadoop commands running fine? Are you facing problems only while formating the node?
0 votes
Hi Suriyaprakash,

You can also try by installing another JDK in a path that does not have a space, you can create a symbolic link with the Windows command mklink.
This is how you can create a link:

Open a cmd prompt as administrator.
Navigate to C:\ if the cmd prompt does not open there.
Create the symolic link. Here, I'm setting the path that Hadoop complains about (with Program Files) to a simpler path without spaces. The /D argument means you are creating a directory symbolic link.

mklink /D \java_home "C:\Program Files\Java\jdk1.8.0_171"

In your hadoop-env.cmd, set your JAVA_HOME to the symbolic link you created:

set JAVA_HOME=\java_home

Hope this will help.
answered Jul 26, 2018 by nitinrawat895
• 11,380 points
0 votes
According to my guess, your error is either due to the JAVA Path or you haven't added the Hadoop bin directory path in the environment variable.

Can you be more descriptive about the commands or instructions you have followed?
answered Aug 9, 2018 by Shubham
• 13,490 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Can anyone help me out to install the following packages R-MR, R-HDFS, and R-HBase on R-HAdoop?

I have understood your problem, I will ...READ MORE

answered May 31, 2019 in Big Data Hadoop by ravikiran
• 4,620 points
0 votes
1 answer

I want to change the string datatype to timestamp, can anyone help me??

I am not sure if you want ...READ MORE

answered Aug 22, 2019 in Big Data Hadoop by Karan
0 votes
1 answer

while executing this iam getting this error can anyone please help me with the solution please

Hi@srija, It seems you have not provided complete ...READ MORE

answered Apr 6, 2020 in Big Data Hadoop by MD
• 95,440 points
0 votes
1 answer

I need to copy data from one HDFS to another HDFS. Can you help me do so?

I understood your issue. Let me help you ...READ MORE

answered May 16, 2019 in Big Data Hadoop by ravikiran
• 4,620 points
0 votes
1 answer
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP