Hive常见问题 2015-05-29 20:00

使用beeline无法正常连接HiveServer2

  • 问题描述

连接后,卡住了,无法正常连接:

[root@ctrl conf]# beeline
Beeline version 1.0.0 by Apache Hive
beeline> !connect jdbc:hive2://ctrl:10000
scan complete in 21ms
Connecting to jdbc:hive2://ctrl:10000
Enter username for jdbc:hive2://ctrl:10000: root
Enter password for jdbc:hive2://ctrl:10000:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hive/lib/hive-jdbc-1.0.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
  • 解决办法

把HiveServer2的配置文件,将:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<property>
    <name>hive.server2.authentication</name>
    <value>NOSASL</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>

改为:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<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>
  • 参考文档

hive-user mailing list archives:JDBC/beeline client hangs with HiverServer2 (0.13.1)

MetaStore连接MySql错误

  • 错误信息
Specified key was too long; max key length is 767 bytes
  • 解决办法

将MySQL中hive数据库的编码改为latin1;

alter database hive character set latin1;
Tags: #Hive #MySQL    Post on Hadoop