ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

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

2021-11-13 11:31:33  阅读:210  来源: 互联网

标签:HiveException lang java jar SLF4J hive hadoop slf4j org


记录下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的存储的元数据又存在,故而在输入查询命令的时候会出现报错

解决办法:

  • 1.关闭hive和mysql数据库,在这只是退出来,在hive-site.xml文件末尾添加
<property>
    <name>datanucleus.schema.autoCreateAll</name>
    <value>true</value>
  </property>
  • 2.在mysql数据库中删除数据库hivemetadata 数据库,这是存储hive数据库中的所有元数据的,切记生产误用
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,进去

标签:HiveException,lang,java,jar,SLF4J,hive,hadoop,slf4j,org
来源: https://blog.csdn.net/Mark_CHYL/article/details/121301361

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有