Col
Col

Reputation: 371

hive JDBC through beeline connection issue

Using the mapr sandbox if i try to connect to hive through beeline using this:

    !connect jdbc:hive2://

it connects without issue

Connected to: Apache Hive (version 1.2.0-mapr-1508) Driver: Hive JDBC (version 1.2.0-mapr-1508) Transaction isolation: TRANSACTION_REPEATABLE_READ

If i try connect with the actual address:

    !connect jdbc:hive2://192.168.48.138:10000

Error: Could not open client transport with JDBC Uri: jdbc:hive2://192.168.48.138:10000: null (state=08S01,code=0) 0: jdbc:hive2://192.168.48.138:10000 (closed)>

i can see through the cli that hiveserver2 is running:

    hs2              0      /opt/mapr/hive/hive-1.2/logs/mapr   HiveServer2

I can telnet to port 10000 from my mac and get a connection.

I can also see port 10000 is listening

    tcp        0      0 0.0.0.0:10000               0.0.0.0:*                   LISTEN      9270/java

Any ideas?

Upvotes: 0

Views: 2169

Answers (1)

Mahendran V M
Mahendran V M

Reputation: 3496

Hive Connecting to beeline from client having various Modes.

1.Embedded Mode: Both Server and Client runs in same machine. No TCP Connection required.

    If value of "hive.server2.authentication" property in hive-site.xml is  "NONE" is known as an Hive server Connection in embedded mode.

   If its value is NONE then you can use below url to connect with hive- beeline   
Connection URL:
               !connect jdbc:hive2://

2. Remote Mode: It supports multiple clients to execute queries with help of following Authentication schemes.

Authentication Schemes:

i.)SASL Authentication:

   If value of "hive.server2.authentication" property in HIVE_HOME/conf/hive-site.xml to be set as "SASL" then connect hive beeline with below url

   Beeline URL:
             !connect jdbc:hive2://<host>:<port>/<db>

ii.)NOSASL Authentication:
   If "hive.server2.authentication" is nosasl then connect the beeline like below.
   Beeline URL:

             !connect jdbc:hive2://<host>:<port>/<db>;auth=noSasl

Hope this really helps you

References: https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_dataintegration/content/beeline-vs-hive-cli.html

Upvotes: 0

Related Questions