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

Cannot connect to beeline

Expert Contributor

I am trying to connect beeline from client system but I am not able to...

 

Beeline version 0.10.0-cdh4.5.0 by Apache Hive
beeline> !connect jdbc:hive2://hostname.com:10000 org.apache.hadoop.hive.jdbc.HiveDriver
scan complete in 6ms
Connecting to jdbc:hive2://hostname.com:10000
Enter password for jdbc:hive2://hostname.com:10000: ********
Error: Invalid URL: jdbc:hive2://hostname.com:10000 (state=08S01,code=0)

 

Am I missing anything here...Please advice..

 

Em Jay
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Cannot connect to beeline

Expert Contributor
This solved my problem....I was using the wrong syntax. Below is the right one...
!connect jdbc:hive2://hostname:10000/default;principal=hive/hostname@PRINCIPAL.COM
username and password blank....

Thanks for helping me out zhang...
Em Jay
36 REPLIES 36

Re: Cannot connect to beeline

Cloudera Employee

It seems you're using the wrong JDBC driver. For HiveServer2, the JDBC driver class is org.apache.hive.jdbc.HiveDriver.

Highlighted

Re: Cannot connect to beeline

Expert Contributor
I also tried using org.apache.hive.jdbc.HiveDriver but no luck

!connect jdbc:hive2://hostname:10000 org.apache.hive.jdbc.HiveDriver
scan complete in 6ms
Connecting to jdbc:hive2://hostname:10000
Enter password for jdbc:hive2://hostname:10000: ********
Error: Invalid URL: jdbc:hive2://hostname:10000 (state=08S01,code=0)
Em Jay

Re: Cannot connect to beeline

Expert Contributor
We are using thrift service to connect to our hive metastore...
For thrift, need to use a different URL ?
Em Jay

Re: Cannot connect to beeline

Cloudera Employee
I must be misunderstanding the issue. If you need to connect HiveServer2
via JDBC, then the URL given for beeline should be one that has
HiveServer2's hostname/port.

If you need to connect to MetaStore via thrift, then you need to give
MetaStore server's hostname and port number to your thrift client.

HiveServer2 server and MetaStore server are two different servers running
on different host/port.

Re: Cannot connect to beeline

Expert Contributor
Sorry for confusing you...
I need to connect to the hiveserver2 using beeline and create a database.
the URL would be jdbc:hive2://hiveserver2_hostname:10000 org.apache.hive.jdbc.HiveDriver ?
I tried this too, got the same error.
Em Jay

Re: Cannot connect to beeline

Expert Contributor
What would be the username and password that I need to supply while executing this command ?
Em Jay

Re: Cannot connect to beeline

Cloudera Employee
Those would be what you're given by the HiverServer2 admin. If your
HiverServer2 instance is running with the default, then just leave them
blank.

Re: Cannot connect to beeline

Expert Contributor
When I leave it blank it is asking me for the password. I am not sure which password to supply...
Em Jay

Re: Cannot connect to beeline

Cloudera Employee
Also leave it blank.