【已解决】org.apache.hadoop.hive.metastore.hivemetaexception: failed to get schema version.

在stackoverflow上查阅大量相关的问题后我发现,这个问题并不是各个中文博客上所说的版本太新的问题,归根结底是hive没有连上数据库。与ERROR:"Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient"这个错误解决方法一致。
解决办法:
首先要确保你hive,mysql配置文件已经正确配置。正确的配置文件请看我的另一篇文章。安装与配置过程参考我的这篇文章https://blog.csdn.net/handoking/article/details/81227210

在mysql命令行运行:

1.source /usr/local/hive/scripts/metastore/upgrade/mysql/hive-schema-3.0.0.mysql.sql//使这个版本的配置文件有用!注意更换文件路径
2.schematool -dbType mysql -initSchema进行初始化.运行显示成功就可以正常通信了。

如果情况这么简单那是万福了,往往情况是你运行上面第二句时产生错误:

Error: Duplicate entry 'org.apache.hadoop.hive.metastore.model.MNotificationLog' for key 'PRIMARY'(state=23000,code=1062)org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!

或者这样的错误:

underlying cause: java.io.ioexception : schema script failed

这个的解决方法请参考我的博文https://blog.csdn.net/handoking/article/details/81387944。

  • 3
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值