Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Cannot connect to beeline

Solved Go to solution
Highlighted

Re: Cannot connect to beeline

Cloudera Employee
It looks like that your hive-site.xml specified kerberos authentication.
You need to specify principal in your url, such as

beeline -u jdbc:hive2://host:port;pricipal=principal_name

principal_name is specified in hive-site.xml.

Also, before you connect, you need to do kerberos kinit to get
authentication token.

I suggest you turn off authentication first and make sure you can connect
to your server. Then, turn on authentication back.

Re: Cannot connect to beeline

Expert Contributor

No luck...

 

$ beeline -u jdbc:hive2://hostname:10000;principal=PRINCIPAL.COMPANY.COM
scan complete in 10ms
Connecting to jdbc:hive2://hostname:10000
Error: Invalid URL: jdbc:hive2://hostname:10000 (state=08S01,code=0)
Beeline version 0.10.0-cdh4.5.0 by Apache Hive

Em Jay

Re: Cannot connect to beeline

Cloudera Employee

Re: Cannot connect to beeline

Expert Contributor

I don't see the below properties in my hive-site.xml

 

<property> <name>hive.server2.authentication</name> <value>KERBEROS</value> </property> 

 

<property> <name>hive.server2.authentication.kerberos.keytab</name><value>/etc/hive/conf/hive.keytab</value> </property>

 

You want me to try adding these properties to the conf....will it help ?

Em Jay

Re: Cannot connect to beeline

Cloudera Employee

I saw previously: Unable to login to kerberos with given principal/keytab, which made me assume you had kerberos turned on.

 

It's better to test beeline connection without kerberos on. Could you check your hiverserver2 log?

 

 

Re: Cannot connect to beeline

Expert Contributor

I see belo error in logs

 

Error occurred during processing of message.
java.lang.RuntimeException: org.apache.thrift.transport.TTransportException
    at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:219)
    at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge20S$Server$TUGIAssumingTransportFactory$1.run(HadoopThriftAuthBridge20S.java:648)
    at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge20S$Server$TUGIAssumingTransportFactory$1.run(HadoopThriftAuthBridge20S.java:646)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:356)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1388)
    at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge20S$Server$TUGIAssumingTransportFactory.getTransport(HadoopThriftAuthBridge20S.java:646)
    at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:227)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.thrift.transport.TTransportException
    at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)
    at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
    at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:178)
    at org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage(TSaslServerTransport.java:125)
    at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:253)
    at org.apache.thrift.transport.TSaslServerTransport.open(TSaslServerTransport.java:1)
    at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:216)
    ... 10 more

Em Jay

Re: Cannot connect to beeline

Cloudera Employee
This is not helpful. Last thing, in the log, do you see incoming
connections?

Re: Cannot connect to beeline

Expert Contributor
All I see is the above log repeating again and again....I don't see any other error log...
Em Jay

Re: Cannot connect to beeline

Cloudera Employee
$ beeline -u jdbc:hive2://hostname:10000
scan complete in 10ms
Connecting to jdbc:hive2://hostname:10000
Error: Invalid URL: jdbc:hive2://hostname:10000 (state=08S01,code=0)
Beeline version 0.10.0-cdh4.5.0 by Apache Hive
0: jdbc:hive2://hostname.c>

You might have already connected.

try command show databases;

Re: Cannot connect to beeline

Expert Contributor
No luck.
0: jdbc:hive2://hostname.c> show databases;
No current connection
0: jdbc:hive2://hostname.c>
Em Jay