[英]Running HIVE command throwing error: Exception in thread “main” java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException
I have done the HIVE setup on my Ubuntu machine as per this link . 我已经按照此链接在Ubuntu计算机上完成了HIVE设置。 When I run HIVE command (the last step), I get this exception:
当我运行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)
Can anyone help? 有人可以帮忙吗?
Possible duplicate of :- java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient : -java.lang.RuntimeException的可能重复:无法实例化org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
It seems that you are using derby database for the metastore. 似乎您将derby数据库用于元存储。 I had also faced similar problems on vm.
我在虚拟机上也遇到过类似的问题。
If you can, please install mysql and use that for metastore. 如果可以,请安装mysql并将其用于metastore。
For more info :- 有关更多信息:-
https://dzone.com/articles/how-configure-mysql-metastore https://dzone.com/articles/how-configure-mysql-metastore
From the property, it will create only the database but not the schema. 通过该属性,它将仅创建数据库,而不创建架构。 Try creating the schema required for Hive metastore in MySQL
尝试在MySQL中创建Hive Metastore所需的架构
cd $HIVE_HOME/scripts/metastore/upgrade/mysql/ < login to mysql using command (mysql -u root -p) where root is the username and password will be asked> cd $ HIVE_HOME / scripts / metastore / upgrade / mysql / <使用命令(mysql -u root -p)登录到mysql,将询问root是用户名和密码>
mysql> use metastore;
mysql> source hive-schema-<your_version>.mysql.sql;
eg source hive-schema-2.1.0.mysql.sql; 例如源hive-schema-2.1.0.mysql.sql; Then restart hive metastore process using.
然后使用重新启动配置单元metastore进程。 hive --service metastore.
蜂巢-服务元存储。 Hopefully, this will solve the problem!
希望这可以解决问题!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.