Big Data 4 min read

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.

ITPUB
ITPUB
ITPUB
Step-by-Step Guide to Quickly Install and Configure Hive on Hadoop

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.gz

Set 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/bin

Configure 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.properties

Adjust 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.properties

Start Hive :

# su - hadoop
# hive

Verify 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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ConfigurationHiveETLInstallationHadoopHQL
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.