Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 877
malughanshyam Avatar asked Jul 02 '15 23:07

malughanshyam


People also ask

How do I access hive using beeline?

Start Beeline to Connect to Hive To start Beeline, run beeline shell which is located at $HIVE_HOME/bin directory. This prompts you to an interactive Hive Beeline CLI Shell where you can run HiveQL commands. You can enter ! help on CLI to get all commands that are supported.

What is Kerberos authentication in hive?

Kerberos Authentication is the security mechanism that is commonly used for controlling access to the HDFS and HIVE. This knowledge base post is intended to provide the details on configuration steps needed for creating a connection in ETL Validator to Hive using Kerberos as the authentication mechanism.

What is the difference between Beeline and hive?

The primary difference between the two involves how the clients connect to Hive. The Hive CLI, which connects directly to HDFS and the Hive Metastore, and can be used only on a host with access to those services. Beeline, which connects to HiveServer2 and requires access to only one .


1 Answers

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
like image 198
Kumar Avatar answered Oct 08 '22 05:10

Kumar