hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugene Koontz <ekoo...@hiro-tan.org>
Subject Re: Brief Explanation of HBase Connection/Security ansd help with java connection to remote Hbase
Date Sun, 07 Jun 2015 20:15:12 GMT
Hi Okoza,

 From the error message, it looks like Zookeeper is configured to 
SASL-authenticate the clients. You need to set up your HBase client 
configuration so that will connect to Zookeeper using SASL. Usually 
these files are kept in /etc/hbase/conf. After editing these files, the 
Configuration object in your code will hopefully have the correct 
contents with respect to Zookeeper authentication.

Have a look at:





On 04/06/15 06:09 AM, okoza wrote:
> Hey Guys, I'm new to HBase and trying to connect to it via Java Code. Now for
> a lot of hours I've been reading and trying stuff, but I can't seem to wrap
> my head around it.
> So maybe somebody could give me a short explanation of
> -How I can connect to HBase
> -How I can authenticate to HBase (Keywords SASL and Kerberos, are there
> other methods?)
> (both in a Java context).
> I can access HBase via console with an ssh and user/pw combination, how do i
> model that in Java?
> My code at the moment is:
> Configuration conf = new Configuration();
>              System.out.println("yoooo parentnode: " +
> conf.get("zookeeper.znode.parent"));
>          conf.set("hbase.zookeeper.quorum", ZOOKEEPER_QUORUM);
>          conf.set("hbase.zookeeper.property.clientPort",
>          Configuration hc = HBaseConfiguration.create(conf);
>          HTableDescriptor ht = new HTableDescriptor("User");
>          ht.addFamily(new HColumnDescriptor("Id"));
>          ht.addFamily(new HColumnDescriptor("Name"));
>          System.out.println("connecting");
>          HBaseAdmin hba = new HBaseAdmin(hc);
>          System.out.println("Creating Table");
> //        hba.createTable(ht);
>          System.out.println("Done......");
> Which leads me to this exception: 14:32:24,033 WARN
> [org.apache.zookeeper.client.ZooKeeperSaslClient] (default
> task-27-SendThread( Could not login: the client is being
> asked for a password, but the Zookeeper client code does not currently
> support obtaining a password from the user. Make sure that the client is
> configured to use a ticket cache (using the JAAS configuration setting
> 'useTicketCache=true)' and restart the client. If you still get this message
> after that, the TGT in the ticket cache has expired and must be manually
> refreshed. To do so, first determine if you are using a password or a
> keytab. If the former, run kinit in a Unix shell in the environment of the
> user who is running this Zookeeper client using the command 'kinit <princ>'
> (where <princ> is the name of the client's Kerberos principal). If the
> latter, do 'kinit -k -t <keytab> <princ>' (where <princ> is the name
of the
> Kerberos principal, and <keytab> is the location of the keytab file). After
> manually refreshing your cache, restart this client. If you continue to see
> this message after manually refreshing your cache, ensure that your KDC
> host's clock is in sync with this host's clock.
> Am I on the right path or completely off? I know there are lots of posts
> about that on here and StackOverflow etc. but I can't seem to figure it out.
> Thanksss for any help!!!
> --
> View this message in context: http://apache-hbase.679495.n3.nabble.com/Brief-Explanation-of-HBase-Connection-Security-ansd-help-with-java-connection-to-remote-Hbase-tp4072116.html
> Sent from the HBase Developer mailing list archive at Nabble.com.

View raw message