`
knight_black_bob
  • 浏览: 825395 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

hdfs 本地 winutils.exe (Could not locate executable null\bin\winutils.exe in t)

 
阅读更多

 

下载 hadoop-common-bin 中含有 winutils.exe 

http://download.csdn.net/download/knight_black_bob/9722051 

 

 

 

hdfs  本地 (win) 报没有找到 winutils.exe 



 

 

严重: 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.
	at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:278)
	at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:300)
	at org.apache.hadoop.util.Shell.<clinit>(Shell.java:293)
	at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:76)
	at org.apache.hadoop.conf.Configuration.getTrimmedStrings(Configuration.java:1546)
	at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:519)
	at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:453)
	at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:136)
	at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2433)
	at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:88)
	at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2467)
	at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2449)
	at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:367)
	at com.curiousby.baoyou.cn.hadoop.HDFSUtils.init(HDFSUtils.java:65)
	at com.curiousby.baoyou.cn.hadoop.HDFSUtils.main(HDFSUtils.java:330)

 

 

 

 

hadoop 源码中 ,本地 hadoop 中没有 给出改 winutils.exe  

 

public static final String getQualifiedBinPath(String executable) 
  throws IOException {
    // construct hadoop bin path to the specified executable
    String fullExeName = HADOOP_HOME_DIR + File.separator + "bin"
      + File.separator + executable;
 
    File exeFile = new File(fullExeName);
    if (!exeFile.exists()) {
      throw new IOException("Could not locate executable " + fullExeName
        + " in the Hadoop binaries.");
    }
 
    return exeFile.getCanonicalPath();
  }
 
private static String HADOOP_HOME_DIR = checkHadoopHome();
private static String checkHadoopHome() {
 
    // first check the Dflag hadoop.home.dir with JVM scope
    String home = System.getProperty("hadoop.home.dir");
 
    // fall back to the system/user-global env variable
    if (home == null) {
      home = System.getenv("HADOOP_HOME");
    }
     ...
}

 

 

 

解决方法:

 

1.首先,下载一个 hadoop.tar.gz 解压后  ,设置 环境变量 :HADOOP_HOME   I:\software\hadoop-2.6.0\

 



 

2.下载 hadoop-common-2.2.0-bin ,因为 hadoop中也没有,该winutils.exe 文件,下载后,解压,将该文件复制到hadoop/bin下  

下载地址: http://download.csdn.net/download/knight_black_bob/9722051 

 

3.代码部分 文件前添加 System.setProperty("hadoop.home.dir", "I:\\software\\hadoop-2.6.0");

 

4.测试 ok



 

 

 

 

 

 

 

 

捐助开发者

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。



 
 谢谢您的赞助,我会做的更好!

 

 

 

 

 

  • 大小: 49.7 KB
  • 大小: 49.7 KB
  • 大小: 55.6 KB
  • 大小: 34.4 KB
0
1
分享到:
评论

相关推荐

    解决Could not locate executable null\bin\winutils.exe

    在windows环境下的eclipse或者idea中编写spark应用时,有时为了验证程序功能需要以本地模式运行...java.io.Exception: Could not locate executable null\bin\winutils.exe in the Hadoop binarie 本文件可以解决此异常

    hadoop-2.8.3-winUtils.rar

    如果本机操作系统是 Windows,在程序中使用了 Hadoop 相关的东西,比如写入文件到HDFS,则会遇到如下异常:could not locate executable null\bin\winutils.exe ,使用这个包,设置一个 HADOOP_HOME 环境变量,即可...

    在Windows下的idea中访问HDFS报错 Could not locate executable null\bin\winutils.exe-附件资源

    在Windows下的idea中访问HDFS报错 Could not locate executable null\bin\winutils.exe-附件资源

    hadoop2.6.0 winUtils.exe windows依赖

    如果本机操作系统是 Windows,在程序中使用了 Hadoop 相关的东西,比如写入文件到HDFS,则会遇到如下异常:could not locate executable null\bin\winutils.exe ,使用这个包,设置一个 HADOOP_HOME 环境变量,即可...

    hadoop-2.7.1-winUtils.rar

    如果本机操作系统是 Windows,在程序中使用了 Hadoop 相关的东西,比如写入文件到HDFS,则会遇到如下异常:could not locate executable null\bin\winutils.exe ,使用这个包,设置一个 HADOOP_HOME 环境变量,即可...

    hadoop-3.1.0-winUtils.rar

    如果本机操作系统是 Windows,在程序中使用了 Hadoop 相关的东西,比如写入文件到HDFS,则会遇到如下异常:could not locate executable null\bin\winutils.exe ,使用这个包,设置一个 HADOOP_HOME 环境变量,即可...

    hadoop-3.0.0-winUtils.zip

    如果本机操作系统是 Windows,在程序中使用了 Hadoop 相关的东西,比如写入文件到HDFS,则会遇到如下异常:could not locate executable null\bin\winutils.exe ,使用这个包,设置一个 HADOOP_HOME 环境变量,即可...

    hadoop-3.0.0-winUtils.rar

    如果本机操作系统是 Windows,在程序中使用了 Hadoop 相关的东西,比如写入文件到HDFS,则会遇到如下异常:could not locate executable null\bin\winutils.exe ,使用这个包,设置一个 HADOOP_HOME 环境变量,即可...

    hadoop-2.8.1-winUtils.rar

    如果本机操作系统是 Windows,在程序中使用了 Hadoop 相关的东西,比如写入文件到HDFS,则会遇到如下异常:could not locate executable null\bin\winutils.exe ,使用这个包,设置一个 HADOOP_HOME 环境变量,即可...

    hadoop-2.8.0-RC3-winUtils.rar

    如果本机操作系统是 Windows,在程序中使用了 Hadoop 相关的东西,比如写入文件到HDFS,则会遇到如下异常:could not locate executable null\bin\winutils.exe ,使用这个包,设置一个 HADOOP_HOME 环境变量,即可...

    hadoop binAAA

    在Java中操作hdfs时提示,Could not locate executable null\bin\winutils.exe in the Hadoop binaries.可使用本资源。解压即可。然后在java中添加代码即可。...

    hadoop-2.6.4.rar

    如果本机操作系统是 Windows,在程序中使用了 Hadoop 相关的东西,比如写入文件到HDFS,则会遇到如下异常:could not locate executable null\bin\winutils.exe ,使用这个包,设置一个 HADOOP_HOME 环境变量,即可...

    hadoop-2.6.3.rar

    如果本机操作系统是 Windows,在程序中使用了 Hadoop 相关的东西,比如写入文件到HDFS,则会遇到如下异常:could not locate executable null\bin\winutils.exe ,使用这个包,设置一个 HADOOP_HOME 环境变量,即可...

Global site tag (gtag.js) - Google Analytics