Reply
Expert Contributor
Posts: 126
Registered: ‎11-01-2013
Accepted Solution

Cannot connect to beeline

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
Cloudera Employee
Posts: 14
Registered: ‎08-06-2013

Re: Cannot connect to beeline

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

Expert Contributor
Posts: 126
Registered: ‎11-01-2013

Re: Cannot connect to beeline

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
Expert Contributor
Posts: 126
Registered: ‎11-01-2013

Re: Cannot connect to beeline

We are using thrift service to connect to our hive metastore...
For thrift, need to use a different URL ?
Em Jay
Cloudera Employee
Posts: 14
Registered: ‎08-06-2013

Re: Cannot connect to beeline

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.

Expert Contributor
Posts: 126
Registered: ‎11-01-2013

Re: Cannot connect to beeline

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
Expert Contributor
Posts: 126
Registered: ‎11-01-2013

Re: Cannot connect to beeline

What would be the username and password that I need to supply while executing this command ?
Em Jay
Cloudera Employee
Posts: 14
Registered: ‎08-06-2013

Re: Cannot connect to beeline

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.

Expert Contributor
Posts: 126
Registered: ‎11-01-2013

Re: Cannot connect to beeline

When I leave it blank it is asking me for the password. I am not sure which password to supply...
Em Jay
Expert Contributor
Posts: 126
Registered: ‎11-01-2013

Re: Cannot connect to beeline

I tried with all the hiveserver2 running hosts...still the same problem.
when I do !list i see below output
scan complete in 1211ms
9 driver classes found
Compliant Version Driver Class
yes 1.0 org.apache.commons.dbcp.PoolingDriver
yes 10.4 org.apache.derby.jdbc.AutoloadedDriver
yes 10.4 org.apache.derby.jdbc.EmbeddedDriver
no 0.10 org.apache.hadoop.hive.jdbc.HiveDriver
no 0.10 org.apache.hive.jdbc.HiveDriver
yes 1.0 org.datanucleus.store.rdbms.datasource.dbcp.PoolingDriver
no 1.8 org.hsqldb.jdbcDriver
no 9.0 org.postgresql.Driver
yes 2.1 sun.jdbc.odbc.JdbcOdbcDriver

For the driver you recommended me to use says Compliant "no". Do I need to worry about this ?
Em Jay
Announcements