【发布时间】:2017-01-06 04:30:20
【问题描述】:
我正在编写一个 MapReduce 应用程序来访问启用了 Kerberos 的 CDH 集群上的 Hbase 数据。我的 CDH 版本是 5.9.0,在 3 个节点上运行,Kerberos 版本是 1.10.1。现在,我面临一个问题,希望有人能提供帮助。
我的代码:
conf.set("hadoop.security.authentication", "Kerberos");
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab("jj@example.com", "jj.keytab");
HTable table = new HTable(conf, "myTable");
Put p = new Put(Bytes.toBytes("myLittleRow"));
p.add(Bytes.toBytes("myColumnFamily"), Bytes.toBytes("someQualifier"),
Bytes.toBytes("Some Value"));
table.put(p);
上面的代码帮助我以java -jar 或hadoop -jar 在本地模式下成功运行。但是当我尝试使用 Oozie Workflow via Hue 运行时,会出现以下问题:
FATAL [main] org.apache.hadoop.hbase.ipc.RpcClientImpl: SASL authentication failed. The most likely cause is missing or invalid credentials. Consider 'kinit'. javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)]
Caused by: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
所以,我尝试使用 init 凭据来获取有效的令牌来运行作业
TableMapReduceUtil.initCredentialsForCluster(job,conf);
但问题仍然存在。有人知道吗?
【问题讨论】:
标签: hadoop mapreduce hbase kerberos cloudera-cdh