最近在集群中执行调度任务,或者是 在集群中执行 hadoop distcp 命令都会报这样的问题。
java.io.IOException: Can‘t get Master Kerberos principal for use as renewer
- at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:133)
at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:100)
at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodes(TokenCache.java:80)
at org.apache.hadoop.tools.SimpleCopyListing.validatePaths(SimpleCopyListing.java:191)
at org.apache.hadoop.tools.CopyListing.buildListing(CopyListing.java:85)
at org.apache.hadoop.tools.GlobbedCopyListing.doBuildListing(GlobbedCopyListing.java:90)
at org.apache.hadoop.tools.CopyListing.buildListing(CopyListing.java:86)
at org.apache.hadoop.tools.DistCp.createInputFileListing(DistCp.java:429)
at org.apache.hadoop.tools.DistCp.prepareFileListing(DistCp.java:91)
at org.apache.hadoop.tools.DistCp.execute(DistCp.java:181)
at org.apache.hadoop.tools.DistCp.run(DistCp.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.tools.DistCp.main(DistCp.java:493)
经过源码分析:
代码中会去读取yarn的配置文件,如果读不到yarn的配置文件,就会报这样的错误。
解决方法:
与机器的HADOOP_CLASSPATH 环境变量有关,我们是有同事添加了错误的HADOOP_CLASSPATH 环境变量,最终在机器上移掉该环境变量,就可以工作了
java.io.IOException: Can't get Master Kerberos principal for use as renewer 错误解决
原文地址:https://www.cnblogs.com/zuoql/p/12195548.html