windowshadoopinstallationhdfssystem-variable

'hdfs' is not recognized as an internal or external command, operable program or batch file


I am following this instruction to install hadoop 3.3.1 on Windows 10 machine, I followed all the steps as it says but when I reached to step 6, after replacing the bin folder, it asks to run the following command:

`– Format the NameNode

– Open cmd and type command “hdfs namenode –format”`

And I did, but I received the following error message:

'hdfs' is not recognized as an internal or external command, operable program or batch file.

I checked my system environment variables and they all seem to be OK as following:

`echo %JAVA_HOME% C:\ProgramData\OpenJDK

echo %HADOOP_HOME% C:\ProgramData\hadoop`

Also added C:\ProgramData\OpenJDK\bin and C:\ProgramData\hadoop to system path. But I don't know what is the problem and why it doesn't work?


Solution

  • I found the problem is that all the installation instructions say that you should replace downloaded bin folder with the existing hadoop/bin folder, but you shouldn't do that!

    In fact you MUST add up the files there are inside the downloaded bin folder to the files already exist within the hadoop/bin folder. You HAVEN'T delete the previous hadoop/bin folder or the files inside.