无法通过蜂链连接配置单元jdbc

问题描述 投票:0回答:1

我是hive的新手,想建立连接,现在我可以使用Hive CLI进行连接,我想通过beeline连接hive,但是连接时出现错误。

enter image description here

试图将配置单元与transportMode作为http连接,但这也不起作用。

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

请参阅我的hive-site.xml文件。

  <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>

在下面运行命令不返回任何值:

netstat -an | grep 10000
netstat -an | grep 10001
hadoop hive hdfs hadoop2 beeline
1个回答
1
投票

beeline要求HiveServer2进程正在运行。

如果这是原始安装,则可以使用此命令将HiveServer2作为后台进程启动,

nohup $HIVE_HOME/bin/hiveserver2 &

此外,您还必须添加用户hiveuser或通过beeline连接时使用的任何用户作为代理用户才能访问HDFS,>

将这些属性添加到HDFS的core-site.xml并重新启动服务。

<property>
     <name>hadoop.proxyuser.hiveuser.hosts</name> 
     <value>*</value> 
</property> 
<property>
     <name>hadoop.proxyuser.hiveuser.groups</name>
     <value>*</value>
</property>
© www.soinside.com 2019 - 2024. All rights reserved.