【问题标题】:"Configuring hive with derby"“使用 derby 配置 hive”
【发布时间】:2018-11-02 10:21:10
【问题描述】:

hive-site.xml

<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:derby://localhost:1527/metastore_db;create=true</value>
  <description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>org.apache.derby.jdbc.ClientDriver</value>
  <description>Driver class name for a JDBC metastore</description>
</property>

<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>

[user1@slave3 ~]$ hive

which: no hbase in (/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/user1/hadoop-2.9.0/bin:/usr/local/jdk1.8.0_161/bin:/home/user1/hadoop-2.9.0/sbin:/home/user1/sqoop-1.4.7.bin__hadoop-2.6.0/bin:/home/user1/apache-hive-2.3.2-bin/bin:/usr/local/derby/bin:/home/user1/.local/bin:/home/user1/bin:usr/local/jdk1.8.0_161/bin:/home/user1/hadoop-2.9.0/bin:/usr/local/jdk1.8.0_161/bin:/home/user1/hadoop-2.9.0/sbin:/home/user1/sqoop-1.4.7.bin__hadoop-2.6.0/bin:/home/user1/apache-hive-2.3.2-bin/bin:/usr/local/derby/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/user1/apache-hive-2.3.2-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/user1/hadoop-2.9.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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.apache.logging.slf4j.Log4jLoggerFactory]

Logging initialized using configuration in jar:file:/home/user1/apache-hive-2.3.2-bin/lib/hive-common-2.3.2.jar!/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.

hive> 显示数据库;

FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

enter image description here

我正在尝试安装 hive,但它给出了 SemanticException。谁能帮忙?

【问题讨论】:

    标签: hive derby hadoop2


    【解决方案1】:

    我得到了同样的错误,这只是因为两个 SLF4j 正在运行,但 java 只使用一个强制依赖项,所以你只需要删除这个文件。 我从我的蜂巢中删除了它,它就起作用了。

    你所要做的就是删除这个文件

    log4j-slf4j-impl-2.6.2.jar!

    来自

    /home/user1/apache-hive-2.3.2-bin/lib/

    你可以走了。

    【讨论】:

      【解决方案2】:

      您是否启动了元存储?在 hive 上运行查询之前,您的 Metastore 必须启动并运行。

      运行以下命令创建元存储数据库

      schematool -dbType 德比 -initSchema

      然后启动元存储

      hive --service metastore &

      【讨论】:

        猜你喜欢
        • 2016-04-24
        • 2016-05-15
        • 2012-01-03
        • 1970-01-01
        • 2016-02-23
        • 2016-10-25
        • 1970-01-01
        • 1970-01-01
        • 2017-10-18
        相关资源
        最近更新 更多