我在Hadoop中遇到此错误,找不到可执行文件null \\\\\\\\\\\\\\\\\\\\\\ [英] I get this error in Hadoop, Could not locate executable null\bin\winutils.exe
问题描述
我是Hadoop系统的新手,尝试获取Hadoop(HDFS)文件系统时出现以下错误:安装程序是在Ubuntu Server 15.05上运行的Hadoop。以及在Windows上运行的使用Java连接和添加文件到Hadoop系统的Java程序。
错误是:
15/07/14 11:23:30 WARN util.NativeCodeLoader:无法为您的平台加载native-hadoop库......在适用的情况下使用builtin-java类
15/07/14 11:23:30错误util.Shell:无法找到hadoop二进制路径中的winutils二进制文件
java.io.IOException:找不到可执行文件null\bin\winutils.exe在Hadoop二进制文件中。
使用以下行参考:
FileSystem hdfs = FileSystem.get(new URI(hdfs://10.0.0.1:54310),configuration);
更新:花费3个小时后回答我自己的问题问题,如果有其他人遇到问题,我发现回答这里
我下载了winutils.exe并将它放在C:/ Bin / Winutils中。然后在函数的开头添加下面一行到我的项目中:
$ b $ p $ <$ p
code> System.setProperty(hadoop.home.dir,C:\\winutil\\);
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);
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\\");
这篇关于我在Hadoop中遇到此错误,找不到可执行文件null \\\\\\\\\\\\\\\\\\\\\\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!