Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

can not connect to beeline from user

avatar

I am not able to connect beeline from user tom but I am able to connect from hive .

Hive :

!connect jdbc:hive2://noescape.c.test:10000/default;principal=hive/noescape.c.test@EXAMPLE.COM

here i am connected from hive

but when I go form tom it is not getting connected .

!connect jdbc:hive2://noescape.c.test:10000/default;principal=tom@EXAMPLE.COM

Kerberos principal should have 3 parts: tom@EXAMPLE.COM

I tried different way also but no luck :

from root I did kinit tom

then beeline and !connect jdbc:hive2://noescape.c.test:10000/default it prompted for username and password , username tom and provided same password which i did while executing kinit tom . but this way below error :

Could not open client transport with JDBC Uri: jdbc:hive2://<host>:10000/default;: Peer indicated failure: Unsupported mechanism type PLAIN (state=08S01,code=0)

1 ACCEPTED SOLUTION

avatar
Super Collaborator

@Anurag Mishra While logging in a Kerberized environment, you need to pass service principal name, in this case, hiveserver2 service principal name as part of JDBC connect string

eg:- principal=hive/_HOST@REALM

You can do a knit and then login using beeline with connect string as below

!connect jdbc:hive2://noescape.c.test:10000/default;principal=hive/_HOST@EXAMPLE.COM

Note: _HOST will be replaced as Hiveserver2 hostname

and the ticket will be picked from your local ticket cache. You may be prompted for username and password which can be ignored, press enter key twice.

Also you can try using below url if you do not wish to be prompted for username and password

beeline -u "jdbc:hive2://noescape.c.test:10000/default;principal=hive/_HOST@EXAMPLE.COM"

For more info on JDBC Sample connect string, please refer below HCC article and Apache documents:

Ref: https://community.hortonworks.com/articles/4103/hiveserver2-jdbc-connection-url-examples.html

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Beeline%E2%8...

View solution in original post

2 REPLIES 2

avatar
Super Collaborator

@Anurag Mishra While logging in a Kerberized environment, you need to pass service principal name, in this case, hiveserver2 service principal name as part of JDBC connect string

eg:- principal=hive/_HOST@REALM

You can do a knit and then login using beeline with connect string as below

!connect jdbc:hive2://noescape.c.test:10000/default;principal=hive/_HOST@EXAMPLE.COM

Note: _HOST will be replaced as Hiveserver2 hostname

and the ticket will be picked from your local ticket cache. You may be prompted for username and password which can be ignored, press enter key twice.

Also you can try using below url if you do not wish to be prompted for username and password

beeline -u "jdbc:hive2://noescape.c.test:10000/default;principal=hive/_HOST@EXAMPLE.COM"

For more info on JDBC Sample connect string, please refer below HCC article and Apache documents:

Ref: https://community.hortonworks.com/articles/4103/hiveserver2-jdbc-connection-url-examples.html

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Beeline%E2%8...

avatar
Contributor