微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeExcepti

记录下hive数据库启动之后,show databases;报错如下:

hive (default)> show functions;
Failed: SemanticException org.apache.hadoop.hive.ql.Metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.Metadata.SessionHivemetastoreClient

hadoop集群和hive数据库之前我已经配置好的,启动啥的也是好的

原因:

我在hdfs的web管理网页上讲hive的文件数据清理一空,导致集群中的hive数据库中的数据丢失,然而MysqL的存储的元数据又存在,故而在输入查询命令的时候会出现报错

解决办法:

<property>
    <name>datanucleus.schema.autocreateAll</name>
    <value>true</value>
  </property>
drop database hiveMetadata;
  • 3.在集群中所有装有hive的虚拟机中的hive根目录下bin目录下执行如下代码
hive --service metastore &

静静看日志,待出现

[root@linux123 bin]# hive --service metastore &
[1] 8523
[root@linux123 bin]# 2021-11-13 10:42:12: Starting Hive metastore Server
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/lagou/servers/hive-2.3.7/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/lagou/servers/hadoop-2.9.2/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]
^C
[root@linux123 bin]# hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/lagou/servers/hive-2.3.7/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/lagou/servers/hadoop-2.9.2/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:/opt/lagou/servers/hive-2.3.7/lib/hive-common-2.3.7.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 (default)> show functions;
OK
tab_name
!
!=

说明metastore服务已开启,然后Ctrl+C,再hive,进去

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐