Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Apache Hive Installation and Configuration Guide, Study notes of Data Analysis & Statistical Methods

A step-by-step guide on installing and configuring apache hive on a standalone system and as a node in a cluster. Apache hive is a data warehousing infrastructure built on top of hadoop for data summarization, query, and analysis. It supports large datasets stored in hdfs and amazon s3 filesystem, and provides an sql-like language called hiveql.

What you will learn

  • How do I install Apache Hive on Ubuntu?
  • What is the role of HiveQL in Apache Hive?
  • What is Apache Hive and what are its features?

Typology: Study notes

2020/2021

Uploaded on 05/16/2021

ashwini-khandre
ashwini-khandre 🇮🇳

5 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
10/7/2015 HIVEINSTALLATION—InstallationandConfiguration1.0.1documentation
data:text/html;charset=utf8,%3Ch1%20style%3D%22boxsizing%3A%20borderbox%3B%20margintop%3A%200px%3B%20fontweight%3A%20700%3B%2
1/4
HIVEINSTALLATION
ThissectionreferstotheinstallationsettingsofHiveonastandalonesystemaswellasonasystem
existingasanodeinacluster.
INTRODUCTION
ApacheHiveisadatawarehouseinfrastructurebuiltontopofHadoopforprovidingdata
summarization,query,andanalysis.ApacheHivesupportsanalysisoflargedatasetsstoredin
Hadoop’sHDFSandcompatiblefilesystemssuchasAmazonS3filesystem.ItprovidesanSQL
likelanguagecalledHiveQL(HiveQueryLanguage)whilemaintainingfullsupportfor
map/reduce.
HiveInstallation
InstallingHIVE:
Browsetothelink:http://apache.claz.org/hive/stable/
Clicktheapachehive0.13.0bin.tar.gz
SaveandExtractit
Commands
user@ubuntu:~$cd/usr/lib/
user@ubuntu:~$sudomkdirhive
user@ubuntu:~$cdDownloads
user@ubuntu:~$sudomvapache‐hive‐0.13.0‐bin/usr/lib/hive
SettingHiveenvironmentvariable:
Commands
user@ubuntu:~$cd
user@ubuntu:~$sudogedit~/.bashrc
Copyandpastethefollowinglinesatendofthefile
#SetHIVE_HOME
exportHIVE_HOME="/usr/lib/hive/apache‐hive‐0.13.0‐bin"
PATH=$PATH:$HIVE_HOME/bin
pf3
pf4

Partial preview of the text

Download Apache Hive Installation and Configuration Guide and more Study notes Data Analysis & Statistical Methods in PDF only on Docsity!

data:text/html;charset=utf 8,%3Ch1%20style%3D%22box sizing%3A%20border box%3B%20margin top%3A%200px%3B%20font weight%3A%20700%3B%2… 1/

HIVE INSTALLATION

This section refers to the installation settings of Hive on a standalone system as well as on a system

existing as a node in a cluster.

INTRODUCTION

Apache Hive is a data warehouse infrastructure built on top of Hadoop for providing data

summarization, query, and analysis. Apache Hive supports analysis of large datasets stored in

Hadoop’s HDFS and compatible file systems such as Amazon S3 filesystem. It provides an SQL

like language called HiveQL(Hive Query Language) while maintaining full support for

map/reduce.

Hive Installation

Installing HIVE:

Browse to the link: http://apache.claz.org/hive/stable/

Click the apache hive 0.13.0 bin.tar.gz

Save and Extract it

Commands

user@ubuntu:~$ cd /usr/lib/ user@ubuntu:~$ sudo mkdir hive user@ubuntu:~$ cd Downloads user@ubuntu:~$ sudo mv apache‐hive‐0.13.0‐bin /usr/lib/hive

Setting Hive environment variable:

Commands

user@ubuntu:~$ cd user@ubuntu:~$ sudo gedit ~/.bashrc

Copy and paste the following lines at end of the file

Set HIVE_HOME

export HIVE_HOME="/usr/lib/hive/apache‐hive‐0.13.0‐bin" PATH=$PATH:$HIVE_HOME/bin

data:text/html;charset=utf 8,%3Ch1%20style%3D%22box sizing%3A%20border box%3B%20margin top%3A%200px%3B%20font weight%3A%20700%3B%2… 2/

export PATH

Setting HADOOP_PATH in HIVE config.sh

Commands

user@ubuntu:~$ cd /usr/lib/hive/apache‐hive‐0.13.0‐bin/bin user@ubuntu:~$ sudo gedit hive‐config.sh

Go to the line where the following statements are written

Allow alternate conf dir location.

HIVE_CONF_DIR="${HIVE_CONF_DIR:‐$HIVE_HOME/conf" export HIVE_CONF_DIR=$HIVE_CONF_DIR export HIVE_AUX_JARS_PATH=$HIVE_AUX_JARS_PATH

Below this write the following

export HADOOP_HOME=/usr/local/hadoop (write the path where hadoop file is there)

Create Hive directories within HDFS

Command

user@ubuntu:~$ hadoop fs ‐mkdir /usr/hive/warehouse

Setting READ/WRITE permission for table

Command

user@ubuntu:~$ hadoop fs ‐chmod g+w /usr/hive/warehouse

HIVE launch

Command

user@ubuntu:~$ hive

data:text/html;charset=utf 8,%3Ch1%20style%3D%22box sizing%3A%20border box%3B%20margin top%3A%200px%3B%20font weight%3A%20700%3B%2… 4/

com.mysql.jdbc.Driver Driver class name for a JDBC metastore

hive.metastore.warehouse.dir /usr/hive/warehouse location of default database for the warehouse

Writing a Script

Open a new terminal (CTRL+ALT+T)

user@ubuntu:~$ sudo gedit sample.sql

create database sample; use sample; create table product(product int, productname string, price float)[row format delimited fields terminated by describe product;

load data local inpath ‘/home/hduser/input_to_product.txt’ into table product

select * from product;

SAVE and CLOSE

user@ubuntu:~$ sudo gedit input_to_product.txt user@ubuntu:~$ cd /usr/lib/hive/apache‐hive‐0.13.0‐bin/ $ bin/hive ‐f /home/hduser/sample.sql