hive udf with hbase connection on a secure cluster

180 Views Asked by At

I am trying to write a hive udf which connects to hbase table. But, the program is failing to access due to security exception and throwing below:

javax.security.auth.login.LoginException: Unable to obtain password from user at

Below is the code i am trying ...

config = HBaseConfiguration.create();

        config.set("hadoop.security.authentication", "Kerberos");
        config.set("hbase.security.authentication", "kerberos");

        config.addResource("src/main/resources/hbase-site.xml");

        // Point to the krb5.conf file.
        System.setProperty("java.security.krb5.conf", "src/main/resources/krb5.conf");
        System.setProperty("sun.security.krb5.debug", "true");


        UserGroupInformation.setConfiguration(config);
        UserGroupInformation.loginUserFromKeytab("pricipal", "keytab");

        connection = ConnectionFactory.createConnection(config);

can someone please share ur thoughts and help me fix the issue ....

0

There are 0 best solutions below