hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: Kerberos auth using java exception
Date Fri, 18 Mar 2016 12:50:01 GMT
>From the code, looks like you were trying to authenticate as user test.
But from the attached log:

bq. getLoginUser :: root (auth:SIMPLE)

FYI

On Thu, Mar 17, 2016 at 8:33 PM, Saurabh Malviya (samalviy) <
samalviy@cisco.com> wrote:

>
>
> Hi,
>
>
>
> I am trying to write java code snippet to authenticate hbase using
> Kerberos, But I am getting attached exception. I tried all kind of config
> through code but no luck.
>
>
>
> -Saurabh
>
> ---Java Code
>
>
>
>                 HbaseGetPropertyValues properties = new
> HbaseGetPropertyValues();
>
>                                              properties.getPropValues();
>
>
>
>                                    Configuration hBaseConfig =
> HBaseConfiguration.create();
>
>
>
>                                    hBaseConfig.setInt("timeout",
> Integer.parseInt(properties.TIMEOUT));
>
>
> hBaseConfig.set("hbase.zookeeper.quorum",
> properties.HBASE_ZOOKEEPER_QUORUM);
>
>                                    //hBaseConfig.set("hbase.master",
> "hdfs-hbase-m1.insight-test-1:60000");
>
>
> hBaseConfig.set("hbase.zookeeper.property.clientport",
> properties.HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT);
>
>
> hBaseConfig.set("zookeeper.znode.parent",
> properties.ZOOKEEPER_ZNODE_PARENT);
>
>
>
>
>     //hBaseConfig.set("hadoop.security.authentication", "kerberos");
>
>
> hBaseConfig.set("hbase.security.authentication", "kerberos");
>
>
>
>
>      hBaseConfig.set("hbase.master.kerberos.principal",
> "test/INSIGHT@INSIGHT");
>
>
> hBaseConfig.set("hbase.regionserver.kerberos.principal",
> "test/INSIGHT@INSIGHT");
>
>
> hBaseConfig.set("hbase.master.keytab.file", "/root/test.keytab");
>
>
> hBaseConfig.set("hbase.regionserver.keytab.file", "/root/test.keytab");
>
>
>
>                                    //runLoginAndRenewalThread(hBaseConfig,
> "/root/test.keytab", "test/INSIGHT@INSIGHT");
>
>
>
>
> UserGroupInformation.setConfiguration(hBaseConfig);
>
>
> User.login(hBaseConfig,"hbase.master.keytab.file",
> "hbase.regionserver.kerberos.principal", null);
>
>
> //UserGroupInformation.loginUserFromKeytab("test/INSIGHT@INSIGHT
> ","/root/test.keytab");
>
>                                    UserGroupInformation ugi =
> UserGroupInformation.loginUserFromKeytabAndReturnUGI("test/INSIGHT@INSIGHT
> ","/root/samalviy.keytab");
>
>                                    UserGroupInformation.setLoginUser(ugi);
>
>
>
>                                    System.out.println("getLoginUser ::
> "+ugi.getLoginUser());
>
>                                    System.out.println(hBaseConfig);
>
>
>
>
> HBaseAdmin.checkHBaseAvailable(hBaseConfig);
>
>                                    Connection connection =
> ConnectionFactory.createConnection(hBaseConfig);
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message