解決原文鏈接:
https://blog.csdn.net/u014804456/article/details/77747720
githup地址:https://github.com/apache/hive/blob/master/metastore/scripts/upgrade/mssql/upgrade-2.2.0-to-2.3.0.mssql.sql
故障描述如下:
spark和hive整合之後,spark-sql可以使用,hive直接進入會保錯,保錯信息如下
Logging initialized using configuration in jar:file:/home/hadoop/hdfs/hive/lib/hive-common-2.3.4.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> show tables;
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
進入存儲元數據的數據庫,本地庫位mysql
MariaDB [(none)]> use metastore;
更新以下內容
MariaDB [metastore]> SELECT 'Upgrading MetaStore schema from 2.2.0 to 2.3.0' AS MESSAGE;
+------------------------------------------------+
| MESSAGE |
+------------------------------------------------+
| Upgrading MetaStore schema from 2.2.0 to 2.3.0 |
+------------------------------------------------+
1 row in set (0.00 sec)
MariaDB [metastore]> UPDATE VERSION SET SCHEMA_VERSION='2.3.0', VERSION_COMMENT='Hive release version 2.3.0' where VER_ID=1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [metastore]> SELECT 'Finished upgrading MetaStore schema from 2.2.0 to 2.3.0' AS MESSAGE;
+---------------------------------------------------------+
| MESSAGE |
+---------------------------------------------------------+
| Finished upgrading MetaStore schema from 2.2.0 to 2.3.0 |
+---------------------------------------------------------+
1 row in set (0.00 sec)
MariaDB [metastore]> exit;
Bye
再次通過hive進入hive命令行界面進行測試
問題完美解決