我是KERBEROS
的新手并且收到以下错误。
Exception in thread "main" java.io.IOException: Can't get Master Kerberos principal for use as renewer
at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:116)
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.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:370)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1295)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1292)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1614)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1292)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1313)
at SampleUploader.main(SampleUploader.java:113)
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 org.apache.hadoop.util.RunJar.main(RunJar.java:212)
运行以下代码时出现此错误(在GitHub中可用:https://github.com/ddraj/hbase-trunk-mttr/blob/master/hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/SampleUploader.java)
conf.set("hadoop.security.authentication", "kerberos");
conf.set("dfs.namenode.kerberos.principal","hdfs/_HOST@REALM.COM");
UserGroupInformation.setConfiguration(conf);
System.out.println(UserGroupInformation.getLoginUser()+"***********");
我正在使用CDH5.2.6
我可以像这样获得登录用户:
System.out.println(UserGroupInformation.getLoginUser()+"***********");
答案 0 :(得分:1)
此错误通常意味着它所表示的意思(它无法找到用于某些操作的特定Kerberos主体)。但是,解决此错误的细节非常糟糕。它通常归结为这三件事:
不幸的是,#3导致我烧掉的时间至少有一半 - 浪费 - 试图让HBase继续使用Kerberos。我已经停止计算实际的小时数,因为它让我感到沮丧。希望这篇文章能帮助其他人不浪费时间。