Hive Installation

User Rating: 0 / 5

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

 Prerequisites:

  • Lab 01 : Hadoop Installation

Download & Extract Hive

 

[root@NNMaster01 ~]#cd  /opt/
[root@NNMaster01 opt]#mkdir hive
[root@NNMaster01 opt]#cd ~/Downloads
[root@NNMaster01 opt]#wget  https://www-eu.apache.org/dist/hive/hive-2.1.1/apache-hive-2.1.1-bin.tar.gz 
[root@NNMaster01 opt]#ls 
[root@NNMaster01 opt]#tar zxvf apache-hive-2.1.1-bin.tar.gz
[root@NNMaster01 opt]#ls 
[root@NNMaster01 opt]#cp -a apache-hive-2.1.1-bin/. /opt/hive

 

 

 

Setting up environment for Hive


Add to .bash_profile

[root@NNMaster01 opt]#cd ~ 
[root@NNMaster01 ~]#vi .bash_profile
#Append the following lines at the end of the file:
### HIVE env variables
export HIVE_HOME=/opt/hive export PATH=$PATH:$HIVE_HOME/bin export CLASSPATH=$CLASSPATH:/opt/Hadoop/lib/*:. export CLASSPATH=$CLASSPATH:/opt/hive/lib/*:.
[root@NNMaster01 ~]# source .bash_profile 
[root@NNMaster01 ~]# echo $HIVE_HOME 
[root@NNMaster01 ~]# cd $HIVE_HOME/conf 
[root@NNMaster01 conf]# cp  hive-env.sh.template hive-env.sh 
[root@NNMaster01 ~]# vi  hive-env.sh 

 

 

Configuring Hive

 

3.1. Create Dirctory tree :
[root@NNMaster01 ~]# hdfs dfs -mkdir -p /user/hive/warehouse 
[root@NNMaster01 ~]# hdfs dfs -mkdir -p /tmp/hive 
[root@NNMaster01 ~]# hdfs dfs -chmod 777 /tmp  
[root@NNMaster01 ~]# hdfs dfs -chmod 777 /user/hive/warehouse 
[root@NNMaster01 ~]# hdfs dfs -chmod 777 /tmp/hive 

Verification via WebBrowser (Port 50070)

 

 

3.2. Initialized the Schema:
[root@NNMaster01 ~]#rm /opt/hive/lib/log4j-slf4j-impl-2.4.1.jar
[root@NNMaster01 ~]#schematool -initSchema -dbType derby

 

 

3.3. Test Hive:
[root@NNMaster01 ~]#hive 
hive>show tables; 
hive>create database mytestdb; 
hive>show databases; 
### The database creates in a default location of the Hive warehouse. In Our Home Lab, Hive database store in a /user/hive/warehouse.
hive>USE mytestdb; #The command to use the database is USE database_name>

 

 

About Helix

Ball tip biltong pork belly frankfurter shankle jerky leberkas pig kielbasa kay boudin alcatra short loin.

Jowl salami leberkas turkey pork brisket meatball turducken flank bilto porke belly ball tip. pork belly frankf urtane bilto

Latest News

21 August 2017