java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

后端 未结 12 1243
无人共我
无人共我 2020-11-27 14:38

I have Hadoop 2.7.1 and apache-hive-1.2.1 versions installed on ubuntu 14.0.

  1. Why this error is occurring ?
  2. Is any metastore installation required?
相关标签:
12条回答
  • 2020-11-27 14:40

    I have also faced this problem but i had restart Hadoop and use command hadoop dfsadmin -safemode leave

    now start hive it will work i think

    0 讨论(0)
  • 2020-11-27 14:41

    mybe your hive metastore are inconsistent! I'm in this scene.

    first. I run

     $ schematool -dbType mysql -initSchema  
    

    then I found this

    > Error: Duplicate key name 'PCS_STATS_IDX' (state=42000,code=1061) org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!

    then I run

     $ schematool -dbType mysql -info
    

    found this error

    Hive distribution version: 2.3.0 Metastore schema version: 1.2.0 org.apache.hadoop.hive.metastore.HiveMetaException: Metastore schema version is not compatible. Hive Version: 2.3.0, Database Schema Version: 1.2.0


    so i format my hive metastore, then it's done! * drop mysql database, the database named hive_db * run schematool -dbType mysql -initSchema for initialize metadata

    0 讨论(0)
  • 2020-11-27 14:49

    In my case when i tried

    $ hive --service metastore 
    

    I got

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

    The necessary tables required for the metastore are missing in MySQL. Manually create the tables and restart hive metastore.

    cd $HIVE_HOME/scripts/metastore/upgrade/mysql/ 
    
    < Login into MySQL > 
    
    mysql> drop database IF EXISTS <metastore db name>; 
    mysql> create database <metastore db name>; 
    mysql> use <metastore db name>; 
    mysql> source hive-schema-2.x.x.mysql.sql; 
    

    metastore db name should match the database name mentioned in hive-site.xml files connection property tag.

    hive-schema-2.x.x.mysql.sql file depends on the version available in the current directory. Try to go for the latest because it holds many old schema files also.

    Now try to execute hive --service metastore If everything goes cool, then simply start the hive from terminal.

    >hive
    

    I hope the above answer serves your need.

    0 讨论(0)
  • 2020-11-27 14:50

    just open the hive terminal from the hive folder,after editing (bashrc) and (hive-site.xml) files. Steps-- open hive folder where it is installed. now open terminal from folder.

    0 讨论(0)
  • 2020-11-27 14:53

    If you're just playing around in local mode, you can drop metastore DB and reinstate it:

    rm -rf metastore_db/
    $HIVE_HOME/bin/schematool -initSchema -dbType derby
    
    0 讨论(0)
  • 2020-11-27 14:53

    I have used MySQL DB for Hive MetaStore. Please follow the below steps:

    • in hive-site.xml the metastore should be proper
    <property>
     <name>javax.jdo.option.ConnectionURL</name> 
     <value>jdbc:mysql://localhost/metastorecreateDatabaseIfNotExist=true&amp;useSSL=false</value>
    </property>
    
    • go to the mysql: mysql -u hduser -p
    • then run drop database metastore
    • then come out from MySQL and execute schematool -initSchema dbType mysql

    Now error will go.

    0 讨论(0)
提交回复
热议问题