hed udf在安全群集上使用hbase连接

时间:2017-10-02 23:30:40

标签: hadoop hive hbase hadoop2 hive-udf

我正在尝试编写一个连接到hbase表的hive udf。但是,由于安全性异常而导致程序无法访问:

  

javax.security.auth.login.LoginException:无法获取密码   来自

的用户

以下是我正在尝试的代码......

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);

有人可以分享您的想法并帮助我解决问题....

0 个答案:

没有答案
相关问题