Hive Installation:In the previous article of Hive "Hadoop series - HIVE in Hadoop", we learned what is Hive, application, limitation, interface, data types, commands of Hive and so many basic concepts required to learn Hive. Hive is used for data summarization, query, and analysis. In this article, we will learn how to install and configure Hive.
Requirements:Hive is running on top of Hadoop, and Hadoop is implemented in Java.
Installation Steps:1. To download the Hive click here.
2. Save and extract it.
3. Copy this extracted folder to /usr/local/
(You can specify your installation directory)
4. Set the environment variable HIVE_HOME in .bashrc
Open .bashrc file and add following lines.
# vim ~/.bashrc export HIVE_HOME=/usr/local/hive export PATH=$PATH:$HIVE_HOME/bin
5. Set the HADOOP_HOME path in Hive
# cd $HIVE_HOME/conf # cp hive-env.sh.template hive-env.sh # vim hive-env.sh export HADOOP_HOME=$HADOOP_HOME
6. Create Hive directories within HDFS:
# hadoop fs -mkdir /usr/hive/warehouse
7. Setting read/write permission for table
# hadoop fs -chmod g+w /usr/hive/warehouse
8. Start HIVE:
Before starting hive make sure that hadoop is running properly on your system.
Start hadoop and check services:
# start-all.sh // Start hadoop # jps // check which hadoop services are running 5472 ResourceManager 4945 NameNode 5602 NodeManager 5077 DataNode 5291 SecondaryNameNode 5931 Jps # hive // Start hive logging initialized using configuration in jar:file:/usr/local/hive/lib/hive-common-1.2.1.jar!/hive-log4j.properties hive>
That's all for this article. In next article, we will study about how to write hql and UDF for a hive. Stay tuned with us to learn hive in detail. Hope this article will help you to install a hive.