• ERROR Shell: Failed to locate the winutils binary in the hadoop binary path


    在学习spark时。spark运行会报一些无用的错误:ERROR Shell: Failed to locate the winutils binary in the hadoop binary path

    文章发自:http://www.cnblogs.com/hark0623/p/4170172.html  转发请注明
    
    
    14/12/17 19:18:53 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:318)
        at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:333)
        at org.apache.hadoop.util.Shell.<clinit>(Shell.java:326)
        at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:76)
        at org.apache.hadoop.security.Groups.parseStaticMapping(Groups.java:93)
        at org.apache.hadoop.security.Groups.<init>(Groups.java:77)
        at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:240)
        at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:255)
        at org.apache.hadoop.security.UserGroupInformation.setConfiguration(UserGroupInformation.java:283)
        at org.apache.spark.deploy.SparkHadoopUtil.<init>(SparkHadoopUtil.scala:36)
        at org.apache.spark.deploy.SparkHadoopUtil$.<init>(SparkHadoopUtil.scala:109)
        at org.apache.spark.deploy.SparkHadoopUtil$.<clinit>(SparkHadoopUtil.scala)
        at org.apache.spark.SparkContext.<init>(SparkContext.scala:228)
        at org.apache.spark.streaming.StreamingContext$.createNewSparkContext(StreamingContext.scala:555)
        at org.apache.spark.streaming.StreamingContext.<init>(StreamingContext.scala:75)
        at com.hark.Test$.main(Test.scala:28)
        at com.hark.Test.main(Test.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
    14/12/17 19:18:54 INFO AkkaUtils: Connecting to HeartbeatReceiver: akka.tcp://sparkDriver@WIN7-20140319ZQ:60477/user/HeartbeatReceiver

    windows的idea运行时报这个异常

    只要在代码前面添加

    //引入: import java.io.File
    
    val path = new File(".").getCanonicalPath()
    //File workaround = new File(".");
    System.getProperties().put("hadoop.home.dir", path);
    new File("./bin").mkdirs();
    new File("./bin/winutils.exe").createNewFile();

    ---这个是转发别人的: http://www.cnblogs.com/hark0623/p/4170172.html

     

  • 相关阅读:
    How to publish ASP.NET application
    Enable(Disable) JavaScript on Browsers(Opera,IE,Firefox,Googlechrome,Safari)
    批处理学习笔记
    [转] Springboot 解决跨域的四种姿势
    HTML+CSS编写规范
    利用CSS3的transform做的动态时钟
    JS特效文字逐个显示
    Asp.Net平台下的图片在线裁剪功能的实现
    CSS3实践之路(一):CSS3之我观
    推荐个通用的多图片上传插件 multiimage。
  • 原文地址:https://www.cnblogs.com/kaiwen1/p/8477445.html
Copyright © 2020-2023  润新知