启动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(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 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.$Proxy5.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 org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:73)
     ... 18 more123456789101112131415161718192021222324252627282930313233343536373839404142434445

解决方案:

因为hive metastore存储在mysql中,所以登录mysql,use hive所使用的DB,然后 查询下VERSION表 
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 | 
+——–+—————-+——————+

保留第一条记录,其他记录全部删除

 delete from VERSION where VER_ID !=1 1

出现这类异常问题原因

hive 是不支持并发的,估计我同事 不小心启动多个hive,也可能是网络问题,反正很诡异

时间: 2024-10-10 18:19:15

启动hive命令报错 “Metastore contains multiple versions”的相关文章

安装atlas后执行hive命令报错

在集群中安装atlas,在安装atlas的节点上执行hive -e "show databases;" 正常,但是在集群中其他节点上执行hive -e "show databases;" 命令报如下错误 一.分析 在安装atlas节点上和没有安装atlas的节点上分别再次执行hive --hiveconf hive.root.logger=DEBUG,console -e "show databases;" 命令,获取执行日志,比较日志看看是否什

Hbase启动hbase shell运行命令报Class path contains multiple SLF4J bindings.错误

1:Hbase启动hbase shell运行命令报Class path contains multiple SLF4J bindings.错误,是因为jar包冲突了,所以对于和hadoop的jar包冲突的,可以将其他jar包删除,如果你不确定是否删除正确,可以将其他的jar包复制备份或者修改名称,确保操作以后失败了,还可以找回. SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:fil

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 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" jav

记hbase list 命令报错zookeeper连接失败

hbase list 命令报错:zookeeper exists failed after 4 attempts $telnet h0082161 2181 Connected to 172.16.82.161.Escape character is '^]'. telnet connect by close foreign. 此时发现telnet h0082161 其他端口均正常,其他机器telnet h0082161 2181正常, 此时进入一个误区,一直在围绕telnet 服务查看,查看/

启动Tomcat服务器报错

启动Tomcat服务器报错: Several ports (8005, 8080, 8009) required by Tomcat v5.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to sto

Android 启动Tomcat服务报错,端口占用解决方案

启动Tomcat服务器报错:Several ports (8005, 8080, 8009) required by Tomcat v5.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop

hadoop命令报错:权限问题

root用户执行hadoop命令报错: [[email protected] conf]# hadoop fs -ls /user/ [INFO] 17:50:42 main [RetryInvocationHandler]Exception while invoking getFileInfo of class ClientNamenodeProtocolTranslatorPB over vmocdp127.test.com/172.16.145.127:8020. Trying to fa

配置PHP启动Apache服务报错

在新的服务器(centos 6.3)编译安装完php-5.4.8,再配置好php.ini和httpd.conf后,启动apache-2.4.3的时候,命令执行/usr/local/apache2/bin/apachectl start时,提示: httpd: Syntax error on line 146 of /etc/httpd/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /u