web-dev-qa-db-fra.com

Hive 2.1.1 MetaException (message: informations de version non trouvées dans le métastore.)

J'utilise Hadoop 2.7.3, MySQL 5.7.17 et Hive 2.1.1 sur Ubuntu 16.04.

Lorsque je lance ./Hive, l'avertissement et l'exception suivants continuent de se produire:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/server/Hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/server/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.Apache.logging.slf4j.Log4jLoggerFactory]

Logging initialized using configuration in jar:file:/home/server/Hive/lib/Hive-common-2.1.1.jar!/Hive-log4j2.properties Async: true
Mon Feb 13 12:01:41 EST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Feb 13 12:01:41 EST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Feb 13 12:01:41 EST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Feb 13 12:01:41 EST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Feb 13 12:01:42 EST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Feb 13 12:01:42 EST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Feb 13 12:01:42 EST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Feb 13 12:01:42 EST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
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
    at org.Apache.hadoop.Hive.ql.session.SessionState.start(SessionState.Java:591)
    at org.Apache.hadoop.Hive.ql.session.SessionState.beginStart(SessionState.Java:531)
    at org.Apache.hadoop.Hive.cli.CliDriver.run(CliDriver.Java:705)
    at org.Apache.hadoop.Hive.cli.CliDriver.main(CliDriver.Java:641)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:498)
    at org.Apache.hadoop.util.RunJar.run(RunJar.Java:221)
    at org.Apache.hadoop.util.RunJar.main(RunJar.Java:136)
Caused by: org.Apache.hadoop.Hive.ql.metadata.HiveException: Java.lang.RuntimeException: Unable to instantiate org.Apache.hadoop.Hive.ql.metadata.SessionHiveMetaStoreClient
    at org.Apache.hadoop.Hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.Java:226)
    at org.Apache.hadoop.Hive.ql.metadata.Hive.<init>(Hive.Java:366)
    at org.Apache.hadoop.Hive.ql.metadata.Hive.create(Hive.Java:310)
    at org.Apache.hadoop.Hive.ql.metadata.Hive.getInternal(Hive.Java:290)
    at org.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 instantiate org.Apache.hadoop.Hive.ql.metadata.SessionHiveMetaStoreClient
    at org.Apache.hadoop.Hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.Java:1654)
    at org.Apache.hadoop.Hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.Java:80)
    at org.Apache.hadoop.Hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.Java:130)
    at org.Apache.hadoop.Hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.Java:101)
    at org.Apache.hadoop.Hive.ql.metadata.Hive.createMetaStoreClient(Hive.Java:3367)
    at org.Apache.hadoop.Hive.ql.metadata.Hive.getMSC(Hive.Java:3406)
    at org.Apache.hadoop.Hive.ql.metadata.Hive.getMSC(Hive.Java:3386)
    at org.Apache.hadoop.Hive.ql.metadata.Hive.getAllFunctions(Hive.Java:3640)
    at org.Apache.hadoop.Hive.ql.metadata.Hive.reloadFunctions(Hive.Java:236)
    at org.Apache.hadoop.Hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.Java:221)
    ... 14 more
Caused by: Java.lang.reflect.InvocationTargetException
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.Java:62)
    at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.Java:45)
    at Java.lang.reflect.Constructor.newInstance(Constructor.Java:423)
    at org.Apache.hadoop.Hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.Java:1652)
    ... 23 more
Caused by: MetaException(message:Version information not found in metastore. )
    at org.Apache.hadoop.Hive.metastore.ObjectStore.checkSchema(ObjectStore.Java:7753)
    at org.Apache.hadoop.Hive.metastore.ObjectStore.verifySchema(ObjectStore.Java:7731)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:498)
    at org.Apache.hadoop.Hive.metastore.RawStoreProxy.invoke(RawStoreProxy.Java:101)
    at com.Sun.proxy.$Proxy21.verifySchema(Unknown Source)
    at org.Apache.hadoop.Hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.Java:565)
    at org.Apache.hadoop.Hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.Java:626)
    at org.Apache.hadoop.Hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.Java:416)
    at org.Apache.hadoop.Hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.Java:78)
    at org.Apache.hadoop.Hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.Java:84)
    at org.Apache.hadoop.Hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.Java:6490)
    at org.Apache.hadoop.Hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.Java:238)
    at org.Apache.hadoop.Hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.Java:70)
    ... 28 more

Voici mon site Hive.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
 <configuration>

     <property>
         <name>javax.jdo.option.ConnectionURL</name>
         <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
     </property>


     <property>
         <name>javax.jdo.option.ConnectionDriverName</name>
         <value>com.mysql.jdbc.Driver</value>
     </property>

     <property>
         <name>javax.jdo.option.ConnectionUserName</name>
         <value>Hive</value>
     </property>

     <property>
         <name>javax.jdo.option.ConnectionPassword</name>
         <value>password</value>
     </property>

 </configuration>

Afin de corriger l'erreur, j'ai essayé Hive Impossible d'instancier org.Apache.hadoop.Hive.ql.metadata.SessionHiveMetaStoreClient et Impossible d'instancier org.Apache.hadoop.Hive.ql.metadata. SessionHiveMetaStoreClient . Mais je reçois toujours les mêmes exceptions.

Je suis novice chez Hadoop et Hive, comment puis-je réparer l'exception? Merci!

9
Top.Deck

Les tables nécessaires pour le métastore sont manquantes dans MySQL. Créez manuellement les tables et redémarrez le métastore Hive. 

Les fichiers de schéma pour MySQL seront disponibles sous le chemin $Hive_HOME/scripts/metastore/upgrade/mysql/.

cd $Hive_HOME/scripts/metastore/upgrade/mysql/

< Login into MySQL >

mysql> drop database IF EXISTS Hive;
mysql> create database Hive;
mysql> use Hive;
mysql> source Hive-schema-2.1.1.mysql.sql;

Redémarrez le métastore Hive.

14
franklinsijo

J'ai fait face au même problème. Le problème peut être résolu en initialisant le schéma Metastore à l'aide de la commande ci-dessous pour Mysql. 

schematool --dbType mysql --initSchema 

cette commande peut être utilisée pour n'importe quel Metastore => remplacez dbType "mysql" par le "Metastrore utilisé pour Hive"

pour plus d'informations -> https://cwiki.Apache.org/confluence/display/Hive/Hive+Schema+Tool

4
ram

hive fournit un outil pour mettre à niveau la base de données Hive:

./bin/schematool -dbType derby -upgradeSchemaFrom 2.1.0

meilleurs

0
A.GARMES

J'ai rencontré un problème similaire lorsque je configurais Hive 2.3.1 pour la première fois… .. J'utilise la base de données Postgres en tant que métastore.

Ensuite, je devais définir la propriété ci-dessous sur false.

  <property>
    <name>Hive.metastore.schema.verification</name>
    <value>false</value>
    <description>
      Enforce metastore schema version consistency.
      True: Verify that version information stored in is compatible with one from Hive jars.  Also disable automatic
            schema migration attempt. Users are required to manually migrate schema after Hive upgrade which ensures
            proper metastore schema migration. (Default)
      False: Warn if the version information stored in metastore doesn't match with one from in Hive jars.
    </description>
  </property>
0
dassum