org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

Logging initializedusing configuration in file:/usr/local/apache-hive-2.1.1-bin/conf/hive-log4j2.propertiesAsync: true

Exception in thread"main" java.lang.RuntimeException:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException:Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

    atorg.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:591)

    atorg.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:531)

    atorg.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:705)

    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:641)

    atsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    atjava.lang.reflect.Method.invoke(Method.java:497)

    atorg.apache.hadoop.util.RunJar.run(RunJar.java:221)

    atorg.apache.hadoop.util.RunJar.main(RunJar.java:136)

Caused by:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException:Unable to instantiateorg.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

    atorg.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:226)

    atorg.apache.hadoop.hive.ql.metadata.Hive.<init>(Hive.java:366)

    atorg.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:310)

    atorg.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:290)

    atorg.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:266)

    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:558)

    ... 9 more

Caused by:java.lang.RuntimeException: Unable to instantiateorg.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

    at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1654)

    atorg.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:80)

    atorg.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:130)

    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:101)

    atorg.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3367)

    atorg.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3406)

    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3386)

    atorg.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3640)

    atorg.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:236)

    atorg.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:221)

    ... 14 more

Caused by:java.lang.reflect.InvocationTargetException

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)

    atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

    atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

    atjava.lang.reflect.Constructor.newInstance(Constructor.java:422)

    atorg.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1652)

    ... 23 more

Caused by:MetaException(message:Version information not found in metastore. )

    atorg.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:7753)

    atorg.apache.hadoop.hive.metastore.ObjectStore.verifySchema(ObjectStore.java:7731)

    atsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    atjava.lang.reflect.Method.invoke(Method.java:497)

    atorg.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:101)

    atcom.sun.proxy.$Proxy21.verifySchema(Unknown Source)

    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:565)

    atorg.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:626)

    atorg.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:416)

    atorg.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:78)

    atorg.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:84)

    atorg.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6490)

    atorg.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:238)

    atorg.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:70)

    ... 28 more

原因分析: 是由于没有初始化数据库导致,执行名称初始化数据库即可。schematool -dbType mysql -initSchema

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区

领取腾讯云代金券