Kerberos java to hive keytab authentication, login failure UserGroupInformation.loginUserFromKeytab

∥☆過路亽.° 提交于 2019-12-07 18:14:39

问题


I am trying to get kerberos keytab authentication work from java to Hive and not finding solution to fix the issue.

    org.apache.hadoop.conf.Configuration conf = new   
       org.apache.hadoop.conf.Configuration();
    conf.set("hadoop.security.authentication", "kerberos");
    conf.set(HiveClientFactory.HIVE_METASTORE_URIS,"thrift://{URL}");
    UserGroupInformation.setConfiguration(conf);
    UserGroupInformation.loginUserFromKeytab(krbPrincipal, keyTabPath);

java.io.IOException: Login failure for {krbPrincipal} from keytab {keyTabPath} at org.apache.hadoop.security.UserGroupInformation.loginUserFromKeytab(UserGroupInformation.java:855)

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

at com.sun.security.auth.module.Krb5LoginModule.promptForPass(Krb5LoginModule.java:789) at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:654)

I would really appreciate some insight to help resolve this.

来源:https://stackoverflow.com/questions/32578871/kerberos-java-to-hive-keytab-authentication-login-failure-usergroupinformation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!