Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to Hive Database with DBeaver

I have a Hortonworks Hadoop cluster where the data nodes are on a separate network off of the master/head node. The only way to access the data nodes is through the master node or an edge node. From the edge node, I execute the hive command to connect into my hive database.

I cannot connect to the hive database from my desktop with DBeaver (4.3.0, 64-bit Windows) or the hive command line interface. Through DBeaver, I tried creating an SSH tunnel to my edge node and continually receive "Could not open client transport with JDBC Uri. jdbc:hive2://127.0.0.1:[port#]/[database].

Configuration for Hive/Apache Hive driver:

 General Tab:
     Host: dataNodeName
     Port: 10000
     Database/Schema: databaseName
     User name: myUID

 SSH Tunnel Tab (Network page):
     Checked Use SSH Tunnel
     Host/IP:   edgeNodeServerName
     Port:      22
     User Name: myUID
     Authentication Method:  Password
     Password:  myPWD

     Advanced
       Local port: 0
       Keep-Alive interval (ms): 0

When I select "Test Connection" with local port set to "0", I receive the above error message with random port numbers. If I set the local port to "10000", I receive the above error with port number "10000".

It looks like DBeaver is ignoring the generic JDBC connection settings--the host name in the created JDBC string is 127.0.0.1 instead of the data node name.

What am I missing? How do I setup DBeaver to access a Hive database located on a "hidden" network?

like image 342
Richard T. Avatar asked Oct 28 '22 21:10

Richard T.


1 Answers

Is your hostname configured with the IP address mentioned in the jdbc connect syntax (127.0.0.1)? Are you able to connect to beeline from your Unix shell? Syntax to connect to beeline(hiveserver2): beeline -u jdbc:hive2://<hostname>:<hive listener port>/<database> -n username> -p <password>

If you're able to connect to beeline, you should be able to connect to hive using same port number and host from DBeaver. Hive listener port by default is configured on 10000, but there's a possibility that your admin can change the port number. Check the port number in hive-site.xml, or get it from admin.

Could you please uncheck the SSH tunnel and try?

This link has all the setup from scratch, please check if you have missed any step.

https://www.linkedin.com/pulse/query-hive-hiveserver2-from-windows-using-universal-database-nimmala

like image 137
4 revs Avatar answered Nov 15 '22 10:11

4 revs