How to Install Apache Hive with Hadoop on CentOS 6.7

 
 
Share on Google+Share on FacebookShare on LinkedInPin on PinterestTweet about this on TwitterEmail this to someone

Step 1: Install JAVA and Hadoop

Apache Hive required java 6 or later version. We also need to install Hadoop first before installing apache hive on our system.

Step 2: Download Hive Archive

After configuring Hadoop successfully on your Linux system. lets start hive setup. First download latest hive source code and extract archive using following commands.

# cd /home/hadoop

# wget http://archive.apache.org/dist/hive/hive-0.12.0/hive-0.12.0-bin.tar.gz

# tar xzf hive-0.12.0-bin.tar.gz

# mv hive-0.12.0-bin hive

# chown -R hadoop hive

hive1

hive2

Step 3: Setup Environment Variables

After extracting hive archive file, switch to Hadoop user and setup following environment variables.

$ su – hadoop

$ export HADOOP_HOME=/home/hadoop/hadoop

$ export HADOOP_PREFIX=/home/hadoop/hadoop

$ export HIVE_HOME=/home/hadoop/hive

$ export PATH=$HIVE_HOME/bin:$PATH

 

Step 4: Start Hive

Before running hive we need to create /tmp and /user/hive/warehouse and set them chmod g+w in HDFS before create a table in Hive. Use the following commands.

$ cd /home/hadoop/hive

$ hadoop fs -mkdir /tmp

$ hadoop fs -mkdir /user/hive/warehouse

$ hadoop fs -chmod g+w /tmp

$ hadoop fs -chmod g+w /user/hive/warehouse

hive3

hive5

hive6

hive7

hive8

hive9

hive10
hive12
hive13

Leave a Reply

Your email address will not be published. Required fields are marked *

− 3 = 6