运行map reduce任务报错:
(null) entry in command string: null chmod 0700
解决办法:
在https://download.csdn.net/download/xiaoliu123586/10551225
中下载winutils.exe,libwinutils.lib 拷贝到%HADOOP_HOME%in目录 。
再次执行程序,报错:
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
at org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Native Method)
at org.apache.hadoop.io.nativeio.NativeIO$Windows.access(NativeIO.java:609)
at org.apache.hadoop.fs.FileUtil.canRead(FileUtil.java:977)
at org.apache.hadoop.util.DiskChecker.checkAccessByFileMethods(DiskChecker.java:187)
at org.apache.hadoop.util.DiskChecker.checkDirAccess(DiskChecker.java:174)
at org.apache.hadoop.util.DiskChecker.checkDir(DiskChecker.java:108)
at org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.confChanged(LocalDirAllocator.java:285)
at org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.getLocalPathForWrite(LocalDirAllocator.java:344)
at org.apache.hadoop.fs.LocalDirAllocator.getLocalPathForWrite(LocalDirAllocator.java:150)
在https://download.csdn.net/download/xiaoliu123586/10551225 中下载hadoop.dll,并拷贝到c:windowssystem32目录中。
执行map reduce程序, 正常。
注意:程序中的路径都要写windows文件系统中的路径了,不再是hdfs中的路径。