当前位置:   article > 正文

DataGrip 连接 Kerberos 认证的 hive 报 Hive JDBC Kerberose Authentication Error: GSS initiate failed 错误_gss initiate failed kerberos认证

gss initiate failed kerberos认证

版本:hive-3.1.2

问题描述:

使用工具连接 hive 时,报如下错误:
在这里插入图片描述
The specified database user/password combination is rejected: [ 08S01] Could not open client transport with JDBC Uri: jdbc:hive2://singlenode:10000/;principal=hive/singlenode@EXAMPLE.COM: GSS initiate failed org.apache.thrift.transport.TTransportException: GSS initiate failed

解决方法:

确保添加了如下参数:
在这里插入图片描述

-Djava.security.krb5.conf="C:\\ProgramData\\MIT\\Kerberos5\\krb5.ini"
-Djava.security.auth.login.config="C:\\ProgramData\\MIT\\Kerberos5\\yhf.conf"
-Djavax.security.auth.useSubjectCredsOnly=false
  • 1
  • 2
  • 3

其中 yhf.conf:

com.sun.security.jgss.initiate{
   com.sun.security.auth.module.Krb5LoginModule required
   useKeyTab=true
   useTicketCache=false
   keyTab="C:\\ProgramData\\MIT\\Kerberos5\\yhf.keytab"
   principal="yhf@EXAMPLE.COM";
};
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

导出 keytab 文件至 yhf.conf 中 keyTab 指定路径:

kadmin.local -q"xst -norandkey -k /home/yhf/yhf.keytab yhf"
  • 1

修改客户端的 krb5.ini 文件:
例如:C:\ProgramData\MIT\Kerberos5\krb5.ini

[libdefaults]
 dns_lookup_realm = false
 ticket_lifetime = 24h
 forwardable = true
 rdns = false
 default_realm = EXAMPLE.COM
 udp_preference_limit = 1 # 添加这一项
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

重新测试链接显示成功!在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/296007
推荐阅读
相关标签
  

闽ICP备14008679号