这是我的情景:
- 我的本地PC开发本地java webapp。
- 我有一个名为A.的服务器的ssh访问权限
- 我有一个名为B的服务器的ssh访问权限,只能从A中访问
-HBase在B.上
现在,我正在尝试使用此conf变量访问HBase:
Configuration myConf = HBaseConfiguration.create();
myConf.addResource("/home/simon/workspace/myProject/src/hbase-site.xml");
myConf.set("hbase.zookeeper.quorum", ZookeeperAddressVariable);
myConf.set("hadoop.security.authentication", "Kerberos");
myConf.set("hbase.rpc.protection", "privacy");
UserGroupInformation.setConfiguration(myConf);
UserGroupInformation.loginUserFromKeytab("scardena@MYREALM.CH","/etc/scardena.keytab");
HTable testTable = new HTable(myConf,"myTable");
但是我收到了这个错误:
exception
java.io.IOException: Login failure for scardena@MYREALM.CH from keytab /etc/scardena.keytab
org.apache.hadoop.security.UserGroupInformation.loginUserFromKeytab(UserGroupInformation.java:841)
..
javax.security.auth.login.LoginException: Pre-authentication information was invalid (24)
com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.ja
..
KrbException: Pre-authentication information was invalid (24)
sun.security.krb5.KrbAsRep.<init>(KrbAsRep.java:76)
sun.security.krb5.KrbAsReqBuilder.send(KrbAsReqBui..
在做连接之前我也在做kinit,我也尝试过多次重新设置keytabs。
编辑:我忘了提及,我试图从外部B网络做到这一点,但即使我在B网络内部,它也无法工作。