Connecting to Hive via Beeline using Kerberos keytab

柔情痞子 提交于 2019-12-07 02:17:28

问题


Is it possible to connect to Hive via beeline using (kerberos) keytab file similar to the approach used for JDBC at

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-UsingKerberoswithaPre-AuthenticatedSubject

PS : beeline does support connecting on a kerberos secured hive server with username and password. But I am looking for a way to connect it with a keytab file. http://doc.mapr.com/display/MapR40x/Configuring+Hive+on+a+Secure+Cluster#ConfiguringHiveonaSecureCluster-UsingBeelinewithKerberos


回答1:


I think you cannot connect with keytab file into beeline but you can get ticket with keytab using kinit and then pass the hive server principal with the jdbc connection string of beeline to connect.

kinit -k -t keytab principal

Connection string to connect with beeline

!connect jdbc:hive2://hostname:10000/default;principal=hive/_HOST@REALM



回答2:


It is a bug, but it is not a critical one.

Though you provided kerberos details, still it will ask you the username and password. You can just enter -> enter, it allows us to connect.

Example:

!connect jdbc:hive2://:10000/default;principal=hive/_HOST@REALM.COM

Connecting to jdbc:hive2://:10000/default;principal=hive/_HOST@REALM.COM

Enter username for jdbc:hive2://:10000/default;principal=hive/_HOST@REALM.COM: press enter

Enter password for jdbc:hive2://:10000/default;principal=hive/_HOST@REALM.COM: press enter

Connected to: Apache Hive (version 0.13.1-cdh5.3.7-SNAPSHOT)
Driver: Hive JDBC (version 0.13.1-cdh5.3.7-SNAPSHOT)
Transaction isolation: TRANSACTION_REPEATABLE_READ


来源:https://stackoverflow.com/questions/31196026/connecting-to-hive-via-beeline-using-kerberos-keytab

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