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.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+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
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
• 9,310 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
• 12,710 points

Related Questions In Big Data Hadoop

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
• 2,040 points
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
• 12,710 points
0 votes
1 answer

How can I get the respective Bitcoin value for an input in USD when using c#

Simply make call to server and parse ...READ MORE

answered Mar 25, 2018 in Big Data Hadoop by charlie_brown
• 7,710 points
0 votes
5 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.