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
681 views

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

E:\hadoop-2.7.1\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
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
• 10,690 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,300 points

Related Questions In Big Data Hadoop

0 votes
1 answer
0 votes
1 answer
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 in Big Data Hadoop by ravikiran
• 4,560 points
52 views
0 votes
1 answer
0 votes
1 answer

How can I use my host machine’s web browser to check my HDFS services running in the VM?

The sole purpose of the virtual machine ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by Shubham
• 13,300 points
142 views
0 votes
1 answer

failed to start the Namenode format in hadoop generation 2

Hi, You can check this out: 1. Delete all ...READ MORE

answered Jul 2 in Big Data Hadoop by Ria

edited Jul 2 by Gitika 119 views