Installing Hive

Hi Guys Today we will learn how to install Hive. It is very easy and needs only few steps.
before you start installing hive, you should have already installed hadoop. If not please check out hadoop installation post.

Steps to install Hive.

1. Download Hive from Hive 0.11.0. If you want to install other version of Hive, check its comparability with hadoop version that you have already installed. In my case i am using hadoop 1.0.3

2. Go to downloads folder, right click and extract hive-0.11.0.tar.gz.

3. Copy the extracted jar into /home/hduser/hive.

4. Edit /etc/bash.bashrc and export HADOOP_HOME if not set.

       on Lubuntu
              sudo leafpad /etc/bash.bashrc
       on ubuntu
              sudo gedit /etc/bash.bashrc

        for people new to linux, leafpad and gedit are two editors to edit text files similar to notepad in windows.
5. Insert following statement in file.
        
     export HADOOP_HOME=/home/hduser/hadoop
     export HIVE_HOME= /home/hduser/hive
     export PATH=$PATH:$HADOOP_HOME/bin
     export PATH=$PATH:$HIVE_HOME/bin

6. Save the file and close it. Now close the terminal and reopen it.

7. Type hive and then enter. if your installation is right , you will log into hive shell. 

Now you can run hive queries on this shell. This installation considers embedded meta-store of hive(on derby database). In coming posts we will learn how to install hive in distributed mode. Stay tuned for videos on this and share your feedback. :)

Comments

  1. Hey! Harjeet,

    The hive-0.10.0.tar.gz. Link which is mentioned is broken, Can we use the Higher or Later version of HIVE?

    ReplyDelete
    Replies
    1. Thanks Vinay for correction... I thinks old link is removed. I have changed link.
      Yes you can use newer version. just check for compatibility with hadoop version that you are using

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hello Harjeet,
    Please add below command to switch off safemode for Ubuntu users if they are getting problem while executing queries in hive prompt.

    bin/hadoop dfsadmin -safemode leave

    regards,
    Shekhar Redd

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Harjeet,
    Thanks for sharing the steps.

    In the export HIVE_HOME path, space between equal to sign (=) and actual hive path causes error. Please change to

    export HIVE_HOME=/home/hduser/hive

    ReplyDelete

Post a Comment

Popular posts from this blog

Hive UDF Example

Custom UDF in Apache Spark

Hadoop series : Pseudo Distributed Mode Hadoop Instalation