Connect to HBase using tunnel

339 Views Asked by At

This is my scenario:
-My local PC developing local java webapp.
-I have ssh access to a server called A.
-I have ssh access to a server called B only accesible from A.
-HBase is on B.

Now, I am trying to access to HBase with this conf variables:

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("[email protected]","/etc/scardena.keytab");
HTable testTable = new HTable(myConf,"myTable");

But I am getting this error:

exception
java.io.IOException: Login failure for [email protected] 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..

.

I am also doing kinit before doing the connection, I also tried remaking the keytabs multiple times.

EDIT: I forgot to mention, I am trying to do this from outside B network, but even when I am inside B network, it doesn't work anyway.

0

There are 0 best solutions below