Step-by-Step Guide to Quickly Install and Configure Hive on Hadoop
This article provides a concise, practical walkthrough for installing and configuring Apache Hive on a Hadoop cluster, covering prerequisite HDFS and MapReduce setup, downloading Hive, extracting files, setting environment variables, configuring XML files, starting Hive, and verifying the installation with simple commands.
Overview
Hive is a data warehouse built on Hadoop that enables ETL, storage, query, and analysis of large datasets using a SQL‑like language (HQL) which is translated into MapReduce jobs.
Prerequisites
Before installing Hive, ensure that HDFS and MapReduce are correctly running on the cluster.
Installation Procedure
Download Hive from the Apache mirrors, e.g. http://www.apache.org/dyn/closer.cgi/hive, selecting the desired version.
Extract the package and move it to /usr/hadoop:
mv hive-1.1.0.tar.gz /usr/
cd /usr
tar -zxvf hive-1.1.0.tar.gzSet ownership for the Hive directory: chown -R hadoop:hadoop hive Configure environment variables by editing .bash_profile and adding:
export JAVA_HOME=/usr/java/jdk1.6
export JRE_HOME=/usr/java/jdk1.6/jre
export HADOOP_HOME=/usr/hadoop
export HIVE_HOME=/usr/hive
export HBASE_HOME=/usr/hbase
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$HADOOP_HOME/bin:$HIVE_HOME/bin:$HBASE_HOME/binConfigure Hive files :
Create hive-conf.sh in /usr/hive/bin with HADOOP_HOME=/usr/hadoop and set HIVE_CONF_DIR=/usr/hive/conf.
Copy template configuration files in /usr/hive/conf:
cd /usr/hive/conf
cp hive-default.xml.template hive-default.xml
cp hive-site.xml.template hive-site.xml
cp hive-exec-log4j.properties.template hive-exec-log4j.properties
cp hive-log4j.properties.template hive-log4j.propertiesAdjust ownership of the copied XML and properties files:
chown -R hadoop:hadoop hive-default.xml
chown -R hadoop:hadoop hive-site.xml
chown -R hadoop:hadoop hive-exec-log4j.properties
chown -R hadoop:hadoop hive-log4j.propertiesStart Hive :
# su - hadoop
# hiveVerify the installation by creating a test table and listing tables:
hive> create table test(key string);
hive> show tables;If the test table appears, Hive is correctly set up.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
