【已解决】ERROR:"Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient"

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Handoking/article/details/81387721

状况:将hive的元数据库换为Mysql时发生的错误
配置:ubuntu16.04+hive3.0.0+mysql8.0.0
原因:换数据库时没有和hive成功通信。

解决办法:
首先要确保你hive,mysql配置文件已经正确配置。正确的配置文件请看我的另一篇文章。安装与配置过程参考我的这篇文章https://blog.csdn.net/handoking/article/details/81227210

在命令行运行:
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

猜你喜欢

转载自blog.csdn.net/Handoking/article/details/81387721