gpt4 book ai didi

maven - 当我尝试安装 Hive 2.0 时,我得到了多个 SLF4J 绑定(bind),并且 Hive Metastore 数据库未初始化

转载 作者:可可西里 更新时间:2023-11-01 16:47:06 26 4
gpt4 key购买 nike

英语不是我的母语;请原谅打字错误。我尝试按照此 tutorial 在 linux 环境中使用 hadoop 安装 hive . Hadoop 安装正确,但是当我尝试安装 hive 时,我的 shell 中得到以下输出:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/phd2014/hive/lib/hive-jdbc-2.0.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/phd2014/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/phd2014/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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/phd2014/hive/lib/hive-common-2.0.0.jar!/hive-log4j2.properties
Java HotSpot(TM) Client VM warning: You have loaded library /home/phd2014/hadoop/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.RuntimeException: Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql)

在我的 ~/.bashrc 文件中放置以下内容:

export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export HADOOP_PREFIX=/home/phd2014/hadoop
export HADOOP_HOME=/home/phd2014/hadoop
export HADOOP_MAPRED_HOME=/home/phd2014/hadoop
export HADOOP_COMMON_HOME=/home/phd2014/hadoop
export HADOOP_HDFS_HOME=/home/phd2014/hadoop
export YARN_HOME=/home/phd2014/hadoop
export HADOOP_CONF_DIR=/home/phd2014/hadoop/etc/hadoop
export HIVE_HOME=/home/phd2014/hive
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin:$HIVE_HOME/bin

我还在 .profile 文件中导出变量 HADOOP_HOME 和 HIVE_HOME

这个问题here对我不起作用,我还运行了创建架构的命令,但它失败了:schematool -dbType derby -initSchema

我还有一件事我认为它可以帮助修改 pom.xml 文件以避免多个 SLF4J 绑定(bind),但我找不到它。尝试 this但我没找到。

提前致谢

最佳答案

SLF4J 是一个日志 API。它将动态绑定(bind)到一个实现,但它期望只有一个存在。在您的情况下,您似乎有三个提供 SLF4J 实现的 jar ; hive-jdbc-2.0.0-standalone.jar、log4j-slf4j-impl-2.4.1.jar 和 slf4j-log4j12-1.7.10.jar。

hive-jdbc-2.0.0-standalone.jar 似乎是一个“阴影”jar - 它包括来自多个第三方 jar 的类,包括 log4j-slf4j-impl 的内容。我猜这是 SLF4J 实际选择的,因为它是第一个找到的。

问题是您以某种方式包含了独立 jar 已经合并的 jar。通常,对于独立的 jar,您需要的所有东西都应该已经在那个 jar 中。

关于maven - 当我尝试安装 Hive 2.0 时,我得到了多个 SLF4J 绑定(bind),并且 Hive Metastore 数据库未初始化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36119033/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com