简体   繁体   English

使用Kerberos keytab通过Beeline连接到Hive

[英]Connecting to Hive via Beeline using Kerberos keytab

Is it possible to connect to Hive via beeline using (kerberos) keytab file similar to the approach used for JDBC at 是否可以通过直线连接到Hive使用(kerberos)keytab文件,类似于JDBC中使用的方法

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-UsingKerberoswithaPre-AuthenticatedSubject 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. PS:beeline确实支持使用用户名和密码连接kerberos安全的蜂巢服务器。 But I am looking for a way to connect it with a keytab file. 但我正在寻找一种方法来连接它与keytab文件。 http://doc.mapr.com/display/MapR40x/Configuring+Hive+on+a+Secure+Cluster#ConfiguringHiveonaSecureCluster-UsingBeelinewithKerberos http://doc.mapr.com/display/MapR40x/Configuring+Hive+on+a+Secure+Cluster#ConfiguringHiveonaSecureCluster-UsingBeelinewithKerberos

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. 我认为您无法将keytab文件连接到beeline但是您可以使用kinit获取keytab的kinit ,然后使用kinit的jdbc连接字符串传递hive服务器主体以进行连接。

kinit -k -t keytab principal

Connection string to connect with beeline 用直线连接的连接字符串

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

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. 虽然您提供了kerberos详细信息 ,但仍会询问您的用户名和密码。 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM