Hive installation in Linux, Lab Reports of Computer Science

Hive installation in linux In apache Hadoop.

Typology: Lab Reports

2020/2021

Uploaded on 02/15/2021

shubham-kumar-67
shubham-kumar-67 🇮🇳

1 document

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Steps to Install Hive on Ubuntu
Step 1
Create a directory named Hive and download Hive tar file. Hive tar file can
be downloaded using then wget as shown below -
wget http://redrockdigimark.com/apachemirror/hive/stable-2/apache-hive-2.1.0-
bin.tar.gz
Step 2
The downloaded Hive tar file needs to be extracted using the tar command with –xvf
option as shown below -
tar –xvf apache-hive-2.1.0-bin.tar.gz
Step 3
Verify if the tar file has been uncompressed using the list command ‘ls’
Step 4
To access hive hadoop from any path, its environment variable must be set in
the .bashrc file that is present at the $HOME directory. .bashrc file can be opened
using the gedit command.
pf3
pf4

Partial preview of the text

Download Hive installation in Linux and more Lab Reports Computer Science in PDF only on Docsity!

Steps to Install Hive on Ubuntu

Step 1 Create a directory named Hive and download Hive tar file. Hive tar file can be downloaded using then wget as shown below - wget http://redrockdigimark.com/apachemirror/hive/stable-2/apache-hive-2.1.0- bin.tar.gz Step 2 The downloaded Hive tar file needs to be extracted using the tar command with –xvf option as shown below - tar –xvf apache-hive-2.1.0-bin.tar.gz Step 3 Verify if the tar file has been uncompressed using the list command ‘ls’ Step 4 To access hive hadoop from any path, its environment variable must be set in the .bashrc file that is present at the $HOME directory. .bashrc file can be opened using the gedit command.

Copy the below contents into the .bashrc file, save and close it - # Set HIVE_HOME export HIVE_HOME=”$HOME/hive/ apache-hive-2.1.0-bin” PATH=$PATH:$HIVE_HOME/bin Export $PATH Step 5 For the environment variables to be set as mentioned in the .bashrc file, the file needs to be sourced using the ‘source’ command- source .bashrc Step 6 For Hive to interact with Hadoop HDFS, it must know the path to the hadoop installation directory. This can be achieved by configuring one of the hadoop hive configuration files hive-config.sh. Set HADOOP_HOME in hive-config.sh export HADOOP_HOME=/opt/hadoop Step 7 Create a directory for the hive warehouse into hdfs. This directory will be used by Hive to store all the data into HDFS-

Now let’s inform hive about the database that it should use for its schema

definition. The below command tells hive to use derby database as its

metastore database. We can also specify this in the hadoop hive

configuration file ‘hive-site.xml’ file.

$HIVE_HOME/bin/schematool –initschema –dbtype derby

From the above screenshot, you can see that a metastore has been

created under the folder metastore_db.