码迷,mamicode.com
首页 > 其他好文 > 详细

Hadoop编程踩坑

时间:2019-07-01 10:54:07      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:set   lin   java   href   系统   group   程序   oop   mat   

Hadoop踩坑

在hadoop所有组件编程中,遇到在Windows下运行程序出现

 1 java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
 2     at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:356)
 3     at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:371)
 4     at org.apache.hadoop.util.Shell.<clinit>(Shell.java:364)
 5     at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:80)
 6     at org.apache.hadoop.security.SecurityUtil.getAuthenticationMethod(SecurityUtil.java:611)
 7     at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:272)
 8     at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:260)
 9     at org.apache.hadoop.security.UserGroupInformation.loginUserFromSubject(UserGroupInformation.java:790)
10     at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:760)
11     at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:633)
12     at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2214)
13     at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2214)
14     at scala.Option.getOrElse(Option.scala:121)
15     at org.apache.spark.util.Utils$.getCurrentUserName(Utils.scala:2214)
16     at org.apache.spark.SparkContext.<init>(SparkContext.scala:322)
17     at leftOutJoin.sparkTopN$.main(SparkLefOutJoin.scala:19)
18     at leftOutJoin.sparkTopN.main(SparkLefOutJoin.scala)

通常是需要放置一个系统缺失的应用“

null\bin\winutils.exe

建议在代码中插入一行

 1 System.setProperty("hadoop.home.dir", "F:\\spack\\hadoop-common-2.2.0-bin-master") 

这里我写的路径是我自己的当然,如果你没有

winutils.exe
那你可以下载我上传的:链接

Hadoop编程踩坑

标签:set   lin   java   href   系统   group   程序   oop   mat   

原文地址:https://www.cnblogs.com/lzj-/p/11112522.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!