运行HIVE命令抛出错误:线程“main”中的异常java.lang.RuntimeException:org.apache.hadoop.hive.ql.metadata.HiveException
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了运行HIVE命令抛出错误:线程“main”中的异常java.lang.RuntimeException:org.apache.hadoop.hive.ql.metadata.HiveException相关的知识,希望对你有一定的参考价值。
我按照这个link在我的Ubuntu机器上完成了HIVE设置。当我运行HIVE命令(最后一步)时,我得到以下异常:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/administrator/apache-hive-2.1.1-bin/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/administrator/hadoop-2.7.1/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/administrator/apache-hive-2.1.1-bin/lib/hive-common-2.1.1.jar!/hive-log4j2.properties Async: true
Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:591)
at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:531)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:705)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:641)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:226)
at org.apache.hadoop.hive.ql.metadata.Hive.<init>(Hive.java:366)
at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:310)
at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:290)
at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:266)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:558)
有人可以帮忙吗?
您似乎正在使用derby数据库进行Metastore。我在vm上也遇到过类似的问题。
如果可以,请安装mysql并将其用于Metastore。
欲了解更多信息: -
https://dzone.com/articles/how-configure-mysql-metastore
从属性中,它将仅创建数据库,但不创建模式。尝试在MySQL中创建Hive Metastore所需的模式
cd $ HIVE_HOME / scripts / metastore / upgrade / mysql / <使用命令登录mysql(mysql -u root -p)其中root是用户名和密码将被询问>
mysql> use metastore;
mysql> source hive-schema-<your_version>.mysql.sql;
例如source hive-schema-2.1.0.mysql.sql;然后使用重启hive Metastore进程。蜂巢 - 服务Metastore。希望这能解决问题!
以上是关于运行HIVE命令抛出错误:线程“main”中的异常java.lang.RuntimeException:org.apache.hadoop.hive.ql.metadata.HiveException的主要内容,如果未能解决你的问题,请参考以下文章
如何修复运行时错误-线程“main”java.util.NoSuchElementException中的异常
Android Studio 在运行 Flutter App 时抛出异常
线程“main”java.sql.SQLException 中的异常:运行 spark-submit 时没有合适的驱动程序