windows下运行hadoop的mr任务,控制台报一下错误:

缺少winutils.exe

ERROR Shell: Failed to locate the winutils binary in the hadoop binary path
java.io.IOException: Could not locate executable nullinwinutils.exe in the Hadoop binaries.
at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:379)
at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:394)
at org.apache.hadoop.util.Shell.(Shell.java:387)
at org.apache.hadoop.util.StringUtils.(StringUtils.java:80)

缺少hadoop.dll
WARN NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable

本人使用hadoop3.1.3版本

使用的是3.0的winutils.exe、hadoop.dll,就没有报错了且成功运行。

下载地址:

https://github.com/4ttty/winutils/tree/master/hadoop-3.0.0/bin

百度云盘下载地址:

链接:https://pan.baidu.com/s/1t2yhgv2WZBT5zmd3OzHoDg 
提取码:tsun 

放置hadoopin目录下

其次环境变量path需要配置

%HADOOP_HOME%in;%HADOOP_HOME%sbin