Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:449) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:634) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.hadoop.util.RunJar.main(RunJar.java:212)Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1481) at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:64) at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:74) at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2674) at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2693) at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:430) ... 7 more
解决方法:
网上汇总方案:
1.hive的版本过高导致的问题,所以其他伙伴有类似错误请考虑版本
2.需要hive元数据库初始化,执行 schematool -dbType mysql -initSchema
3.HIVE_HOME/lib 下的derby-10.11.1.1.jar问题,,把derby-10.11.1.1.jar 换成derby-10.10.2.0.jar问题成功解决
4.可能是hive死掉了,重新启动一下hive和mysql
hive --service metastore & ;hive --service hiveserver2 &