Hive的Metastore contains multiple versions

hive 客户端报错:Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient

咋一看以为是Mysql连接不上,结果发现Mysql正常

错误日志:

 1 Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
 2     at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:444)
 3     at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:672)
 4     at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:616)
 5     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 6     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 7     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 8     at java.lang.reflect.Method.invoke(Method.java:606)
 9     at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
10     at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
11 Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
12     at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1449)
13     at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:63)
14     at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:73)
15     at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2661)
16     at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2680)
17     at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:425)
18     ... 8 more
19 Caused by: java.lang.reflect.InvocationTargetException
20     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
21     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
22     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
23     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
24     at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1447)
25     ... 13 more
26 Caused by: MetaException(message:Metastore contains multiple versions)
27     at org.apache.hadoop.hive.metastore.ObjectStore.getMSchemaVersion(ObjectStore.java:6643)
28     at org.apache.hadoop.hive.metastore.ObjectStore.getMetaStoreSchemaVersion(ObjectStore.java:6605)
29     at org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:6564)
30     at org.apache.hadoop.hive.metastore.ObjectStore.verifySchema(ObjectStore.java:6552)
31     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
32     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
33     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
34     at java.lang.reflect.Method.invoke(Method.java:606)
35     at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:98)
36     at com.sun.proxy.$Proxy5.verifySchema(Unknown Source)
37     at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:539)
38     at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:587)
39     at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:429)
40     at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:66)
41     at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:72)
42     at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:5554)
43     at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:178)
44     at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:73)
45     ... 18 more

解决方案:

 1 mysql> select * from version;
 2
 3 +--------+----------------+------------------+
 4
 5 | VER_ID | SCHEMA_VERSION | VERSION_COMMENT  |
 6
 7 +--------+----------------+------------------+
 8
 9 |      1 | 0.13.0         | Set by MetaStore |
10
11 |      6 | 0.13.0         | Set by MetaStore |
12
13 +--------+----------------+------------------+
14
15
16
17 删除了一条就好了。

原因暂且未知,不过我记得我当时是打开了Hive客户端,但是网络突然断了,不知道是否是这个原因。

时间: 2024-10-05 04:33:04

Hive的Metastore contains multiple versions的相关文章

启动hive命令报错 “Metastore contains multiple versions”

错误日志:  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(SessionSt

Spark Sql数仓报-Metastore contains multiple versions

Spark版本为2.1.0,Hadoop版本为2.7.1,元数据存储在mysql中,异常信息如下: Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient at org.apache.hadoop.hive.ql.session.

Hive的metastore

hive --service metastore 默认端口是9083 <property> <name>hive.metastore.uris</name> <value>thrift://hiveserver1:9083</value> </property> 在连接hive的客户端,如spark,可以只在hive-site.xml中配置这一个属性即可. 不需要配置mysql连接信息与用户密码信息,hiver server作为thr

Encountered multiple versions of the assembly with GUID Try pre-importing one of these assemblies 错误 解决方法

vs2008 开发的 winform程序  迁移到 vs2010后编译发生错误. “Encountered multiple versions of the assembly with GUID ******************  Try pre-importing one of these assemblies” vs2008中最高用framework3.5,升级后引用的dll.com组件可能已经是针对4.0的了. 在2012用将framework改为4.0即可.

hive0.13.1安装-mysql server作为hive的metastore

hive0.13.1在hadoop2.4.1伪分布式部署上安装过程 环境:redhat enterprice 6.5 +hadoop2.4.1+hive0.13.1+mysql单节点伪分布式部署 相关网址: hive官网安装指导:https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-InstallingHivefromaStableRelease hive之metastore的三种保存方式:h

PHPFarm - How to run multiple versions of PHP on the same computer

How to Run Multiple Versions of PHP on One Server 转载:http://www.sitepoint.com/run-multiple-versions-php-one-server/ PHPFarm - How to run multiple versions of PHP on the same computer 转载:http://thejibe.com/blog/14/02/phpfarm

Installing Multiple Versions of MySQL

Installing Multiple Versions of MySQL As with any RDBMS, there are circumstances in which you need to run multiple, differing versions on the same server. This posts reviews my preferred way of accomplishing this for MySQL on Linux. The server in que

hive --service metastore 出现的问题

Could not create ServerSocket on address 0.0.0.0/0.0.0.0:9083 执行命令jps [email protected]:/usr# jps1763 ResourceManager1875 NodeManager4854 Jps1400 DataNode1547 SecondaryNameNode2300 RunJar1292 NameNode 将Runjar kill掉,再重启hive --service metastore,就可以了

【hive】——metastore的三种模式

Hive中metastore(元数据存储)的三种方式: 内嵌Derby方式 Local方式 Remote方式 [一].内嵌Derby方式 这个是Hive默认的启动模式,一般用于单元测试,这种存储方式有一个缺点:在同一时间只能有一个进程连接使用数据库. hive-site.xml 中jdbc URL.驱动.用户名.密码等的配置信息如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30