Hive之FAILED: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient异常

时间:2021-10-15 20:08:40

一.场景

  Hive启动不报错,当使用show functions;或create table...时报:FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient异常。

二.解决方案

  方法1.Hive元数据库未初始化

    进入Hive目录Hive/bin,执行命令:schematool -dbType -initSchema mysql

    执行结果:

      Hive之FAILED:  Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient异常

      启动Hive

      Hive之FAILED:  Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient异常

    表示异常已解决!

  方法2.metastore服务未启动

    执行命令:hive --service metastore & ,接着按Ctrl+C

    结果: 

      Hive之FAILED:  Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient异常

     启动Hive    

      Hive之FAILED:  Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient异常

    表示异常已解决!