Reputation: 87
I am new to the Hadoop system and I am running into the following error when attempting to get the file system of Hadoop (HDFS) The setup is Hadoop Running on Ubuntu Server 15.05. and a Java Program running on Windows using Java to connect and add files to the Hadoop system.
The error is:
15/07/14 11:23:30 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
15/07/14 11:23:30 ERROR util.Shell: Failed to locate the winutils binary in the hadoop binary path
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
With the following line reference:
FileSystem hdfs = FileSystem.get(new URI("hdfs://10.0.0.1:54310"), configuration);
Upvotes: 0
Views: 7381
Reputation: 1245
If you directly take the binary distribution of Apache Hadoop 2.6.0 release and try to run it on Microsoft Windows, then we'll encounter
ERROR util.Shell: Failed to locate the winutils binary in the hadoop binary path
These are required (not optional) to run Hadoop on Windows. For this you have to add the files separately
Just download and copy all the files of hadoop-common-2.6.0/bin
folder and paste them to /bin folder
Upvotes: 0
Reputation: 87
Update: Answered my own question after spending 3 hours googling the problem, If anyone else experiences the problem I found the Answer Here
I downloaded the winutils.exe and placed it in C:/Bin/Winutils.exe
I then added the following line to my project at the start of the function
System.setProperty("hadoop.home.dir", "C:\\winutil\\");
Upvotes: 2