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

后端 未结 12 1357
无人共我
无人共我 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 15:06

    I did below modifications and I am able to start the Hive Shell without any errors:

    1. ~/.bashrc

    Inside bashrc file add the below environment variables at End Of File : sudo gedit ~/.bashrc

    #Java Home directory configuration
    export JAVA_HOME="/usr/lib/jvm/java-9-oracle"
    export PATH="$PATH:$JAVA_HOME/bin"
    
    # Hadoop home directory configuration
    export HADOOP_HOME=/usr/local/hadoop
    export PATH=$PATH:$HADOOP_HOME/bin
    export PATH=$PATH:$HADOOP_HOME/sbin
    
    export HIVE_HOME=/usr/lib/hive
    export PATH=$PATH:$HIVE_HOME/bin
    

    2. hive-site.xml

    You have to create this file(hive-site.xml) in conf directory of Hive and add the below details

    
    
    
    
    
      javax.jdo.option.ConnectionURL
      jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=true
    
    
    
    
      javax.jdo.option.ConnectionDriverName
      com.mysql.jdbc.Driver
    
    
    
      javax.jdo.option.ConnectionUserName
      root
    
    
    
      javax.jdo.option.ConnectionPassword
      root
    
    
    
      datanucleus.autoCreateSchema
      true
    
    
    
      datanucleus.fixedDatastore
      true
    
    
    
     datanucleus.autoCreateTables
     True
     
    
    
    

    3. You also need to put the jar file(mysql-connector-java-5.1.28.jar) in the lib directory of Hive

    4. Below installations required on your Ubuntu to Start the Hive Shell:

    1. MySql
    2. Hadoop
    3. Hive
    4. Java

    5. Execution Part:

    1. Start all services of Hadoop: start-all.sh

    2. Enter the jps command to check whether all Hadoop services are up and running: jps

    3. Enter the hive command to enter into hive shell: hive

提交回复
热议问题