简体   繁体   中英

Unable to connect hive jdbc through beeline

I am new to hive and wanted to make connection, I am able to do so using Hive CLI now I want to connect hive through beeline but I am getting below error while connecting.

在此处输入图片说明

Tried to connect hive with transportMode as http but that is also not working.

jdbc:hive2://localhost:10001/default;transportMode=http

Please refer my hive-site.xml file.

  <property>
    <name>hive.server2.transport.mode</name>
    <value>binary</value>
    <description>
      Expects one of [binary, http].
      Transport mode of HiveServer2.
    </description>
  </property>

  <property>
    <name>hive.server2.authentication</name>
    <value>NONE</value>
    <description>
      Expects one of [nosasl, none, ldap, kerberos, pam, custom].
      Client authentication types.
        NONE: no authentication check
        LDAP: LDAP/AD based authentication
        KERBEROS: Kerberos/GSSAPI authentication
        CUSTOM: Custom authentication provider
                (Use with property hive.server2.custom.authentication.class)
        PAM: Pluggable authentication module
        NOSASL:  Raw transport
    </description>
  </property>

  <property>
    <name>hive.server2.thrift.http.port</name>
    <value>10001</value>
    <description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'http'.</description>
  </property>

  <property>
    <name>hive.server2.thrift.http.path</name>
    <value>cliservice</value>
    <description>Path component of URL endpoint when in HTTP mode.</description>
  </property>

Running below command does not return any value:

netstat -an | grep 10000
netstat -an | grep 10001

beeline requires HiveServer2 process to be running.

If this is a vanilla installation, you can start HiveServer2 as a background process using this command,

nohup $HIVE_HOME/bin/hiveserver2 &

In addition to this, you have to add the user hiveuser or any user used when connecting via beeline as the proxyuser to be able to access HDFS

Add these properties to core-site.xml of HDFS and restart the services.

<property>
     <name>hadoop.proxyuser.hiveuser.hosts</name> 
     <value>*</value> 
</property> 
<property>
     <name>hadoop.proxyuser.hiveuser.groups</name>
     <value>*</value>
</property>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM