Hive embedded mode installation (based on Hadoop)

Download and extract to the specified directory

(1) Configure environment variable / etc/profile

export HIVE_HOME=/usr/local/hive/

export PATH=$PATH:$HIVE_HOME/bin

(2) Modify hive configuration file

Add hadoop path, hive path, lib path of hive



# HiveConfiguration Directory can be controlled by:
 export HIVE_CONF_DIR=/usr/local/hive/conf

# Foldercontaining extra ibraries required for hive compilation/execution can becontrolled by:

(3) Modify Hive configuration file hive-site.xml

    <description>Local scratch space forHive jobs</description>

   <description>Temporary localdirectory for added resources in the remote file system.</description>

   <description>Location of Hive runtime structured log file</description>


    <description>Top level directorywhere operation logs are stored if logging functionality isenabled</description>

  <description>JDBC connect string for aJDBC metastore</description>

 <description>Driver class name for aJDBC metastore</description>

(4) Modify the hive configuration file in the directory bin

export JAVA_HOME=


export HIVE_HOME=

(5) Look at the hive-site.xml search keyword HDFS to see which directories need to be created on HDFS and create them

(6) Initialize hive (start hadoop first)

schematool -dbType derby -initSchema

The possible pit here

The reason is that there is already a Metastore dB in the root directory. Delete the folder and execute the initialization command again

If Metastore? DB is also available in the conf directory, delete it

(7) Enter hive in the terminal to run the command line of hive

Judge whether the installation is successful by running the create table and insert statement in mysql

create table student(varchar(10));
insert into student values(1);

Tags: hive Hadoop JDBC xml

Posted on Thu, 09 Jan 2020 12:33:59 -0500 by ksimpkins