Start hive Command Error "Metastore contains multiple Versions"

Source: Internet
Author: User

Error log:
 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:444)        at org.apache.hadoop.hive.cli.clidriver.run (clidriver.java:672)        At org.apache.hadoop.hive.cli.clidriver.main (clidriver.java:616)       at &NBSP;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:606)        at org.apache.hadoop.util.runjar.run (runjar.java:221)       at org.apache.hadoop.util.runjar.main (runjar.java:136)  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:1449)       at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init> ( RETRYINGMETASTORECLIENT.JAVA:63)      at  Org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy (retryingmetastoreclient.java:73)       at org.apache.hadoop.hive.ql.metadata.hive.createmetastoreclient (Hive.java:2661)       at org.apache.hadoop.hive.ql.metadata.hive.getmsc (Hive.java:2680)       at org.apache.hAdoop.hive.ql.session.SessionState.start (sessionstate.java:425)      ... 8  More caused by: java.lang.reflect.invocationtargetexception     at  sun.reflect.nativeconstructoraccessorimpl.newinstance0 (Native method)       At sun.reflect.nativeconstructoraccessorimpl.newinstance (nativeconstructoraccessorimpl.java:57)       at sun.reflect.delegatingconstructoraccessorimpl.newinstance ( DELEGATINGCONSTRUCTORACCESSORIMPL.JAVA:45)      at  Java.lang.reflect.Constructor.newInstance (constructor.java:526)      at  Org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance (metastoreutils.java:1447)       ... 13 more caused by: metaexception (message:metastore contains  multiple versions)      at org.apache.hadoop.hive.Metastore. Objectstore.getmschemaversion (objectstore.java:6643)      at  Org.apache.hadoop.hive.metastore.ObjectStore.getMetaStoreSchemaVersion (objectstore.java:6605)       at org.apache.hadoop.hive.metastore.objectstore.checkschema (ObjectStore.java:6564)      at org.apache.hadoop.hive.metastore.objectstore.verifyschema ( objectstore.java:6552)      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:606)      at  Org.apache.hadoop.hive.metastore.RawStoreProxy.invoke (rawstoreproxy.java:98)      at com.sun.proxy. $Proxy 5.verifySchema (Unknown source)      at  Org.apache.hadoop.hive.metastore.hivemetastore$hmshandler.getms (hivemetastore.java:539)       at org.apache.hadoop.hive.metastore.hivemetastore$hmshandler.createdefaultdb ( hivemetastore.java:587)      at org.apache.hadoop.hive.metastore.hivemetastore$ Hmshandler.init (hivemetastore.java:429)      at  Org.apache.hadoop.hive.metastore.retryinghmshandler.<init> (retryinghmshandler.java:66)       at org.apache.hadoop.hive.metastore.retryinghmshandler.getproxy (RetryingHMSHandler.java:72)      at org.apache.hadoop.hive.metastore.hivemetastore.newretryinghmshandler ( hivemetastore.java:5554)      at  Org.apache.hadoop.hive.metastore.hivemetastoreclient.<init> (hivemetastoreclient.java:178)       at&nbSp;org.apache.hadoop.hive.ql.metadata.sessionhivemetastoreclient.<init> (SessionHiveMetaStoreClient.java : ()      ... 18  more123456789101112131415161718192021222324252627282930313233343536373839404142434445
Solution:

Because Hive metastore is stored in MySQL, log in to the DB used by Mysql,use hive and query the following version table
Mysql> select * from VERSION;

+--–+ —————-+ —————— +
| ver_id | schema_version | version_comment |
+--–+ —————-+ —————— +
| 1 | 0.14.0 | Set by Metastore |
| 2 | 0.14.0 | Set by Metastore |
| 3 | 0.14.0 | Set by Metastore |
| 4 | 0.14.0 | Set by Metastore |
| 5 | 0.14.0 | Set by Metastore |
| 6 | 0.14.0 | Set by Metastore |
+--–+ —————-+ —————— +

Keep the first record, all other records deleted

Delete from VERSION where ver_id!=1 1
Causes of this type of anomaly

Hive does not support concurrency, it is estimated that my colleague accidentally started multiple hive or it could be a network problem, it's weird anyway.


Start hive Command Error "Metastore contains multiple Versions"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.