SlideShare une entreprise Scribd logo
1  sur  4
Télécharger pour lire hors ligne
RHive tutorial – Installing Hive
As an add-on to Hadoop, Hive cannot run independent of Hadoop.
This tutorial explains how additionally configure Hive to the Hadoop
environment made in the Hadoop setup tutorial.

Hive does not need to be installed for all servers where Hadoop is installed.
It is just needed for the server where Hadoop client will run.
Here, Hive will be installed in Hadoop namenode for convenience in setup.

Downloading Hive

Because Hive is written in Java just like Hadoop is, downloading the file and
decompressing it alone constitutes the entire setup procedure.

A stable version of Hive can be found in the URL below.

http://www.apache.org/dist//hive/hive-0.7.1/hive-0.7.1-bin.tar.gz

The latest stable version at the point of this tutorial’s creation is 0.7.1; it is
alright to build a separate snapshot version and use that instead.
If version 0.8x is released, it’s okay to use that.

Like the following, connect to the target server for Hive installation and
download the final version of Hive.

ssh	
  root@10.1.1.1	
  
mkdir	
  hive_stable	
  
cd	
  hive_stable	
  
wget	
   http://www.apache.org/dist//hive/hive-­‐0.7.1/hive-­‐0.7.1-­‐
bin.tar.gz	
  
tar	
  xvfz	
  ./hive-­‐0.7.1-­‐bin.tar.gz	
  
mkdir	
  /service	
  
mv	
  ./hive-­‐0.7.1-­‐bin	
  /service	
  

Configuring MySQL

We will be choosing and using MySQL for Hive’s repository.
Hive uses SQLite by default, but if you want to enable multiple users to use
Hive simultaneously, you need to be able to use MySQL or other DBs as
repositories.
Hence this tutorial will be using MySQL.
MySQL can be installed in a server apart from the one where Hive will be
installed, but this tutorial will install MySQL along where, Hadoop namenode is
installed (that is, where Hive is installed).

Use yum like the following to install mysql client and server

yum	
  install	
  mysql	
  mysql-­‐server	
  

After installation, start mysql server.

/etc/init.d/mysqld	
  start	
  

Now create a database in MySQL for Hive to use.
This tutorial will use the name “metastore” for that database.

Go into mysql and create a database like shown.

mysql>	
  CREATE	
  DATABASE	
  metastore;	
  
mysql>	
  USE	
  metastore;	
  
mysql>	
                 SOURCE	
                      /service/hive-­‐
0.7.1/scripts/metastore/upgrade/mysql/hive-­‐schema-­‐
0.7.0.mysql.sql;	
  

Here, “/service/hive-0.7.1" is Hive’s HOME directory, and
"$HIVE_HOME/scripts/metastore/upgrade/mysql" contains SQL files that can
set MySQL up for Hive or upgrade Hive database (which exists in MySQL
database). Select and run the ones suited to your version and complete setup.

Now create a MySQL user which Hive will use, and grant it the privilege to
access the database, “metastore”.

mysql>	
  CREATE	
  USER	
  'hiveuser'@'%'	
  IDENTIFIED	
  BY	
  'password';	
  
mysql>	
   GRANT	
   SELECT,INSERT,UPDATE,DELETE	
   ON	
   metastore.*	
   TO	
  
'hiveuser'@'%';	
  
mysql>	
  REVOKE	
  ALTER,CREATE	
  ON	
  metastore.*	
  FROM	
  'hiveuser'@'%';	
  

Configuring MySQL for Hive use is complete.
Now you need to configure Hive to enable it to connect to MySQL.
JDBC is required for allowing connecting to MySQL from Hive but JDBC is not
included in MySQL.
You must manually download it from the MySQL site and copy it into the
installed Hive.

JDBC is available for download from here:
http://dev.mysql.com/downloads/

As shown below, download and decompress it, then copy the jar file to
Hadoop’s lib directory.

$	
   curl	
   http://dev.mysql.com/get/Downloads/Connector-­‐J/mysql-­‐
connector-­‐java-­‐
5.1.18.tar.gz/from/http://mirror.services.wisc.edu/mysql/	
  
$	
  tar	
  xvfz	
  mysql-­‐connector-­‐java-­‐5.1.18.tar.gz	
  
$	
   cp	
   ./mysql-­‐connector-­‐java-­‐5.1.18/mysql-­‐connector-­‐java-­‐5.1.18-­‐
bin.jar	
  /service/hive-­‐0.7.1/lib/	
  

Now for modifying Hive’s configuration.
You need to open $HIVE_HOME/conf/hive-site.xml with a text editor and
appropriately adjust the items pertaining to MySQL.
If you have installed Hive for the first time, then the $HIVE_HOME/conf/hive-
site.xml file probably doesn’t exist in the directory.
Copy the hive-default.xml.template file in the same directory and edit it like the
following:

cd	
  /service/hive-­‐0.7.1/conf/hive-­‐site.xml	
  
cp	
  ./hive-­‐default.xml.template	
  ./hive-­‐site.xml	
  

Now look for the contents below in ./hive-site.xml and make suitable
adjustments for the MySQL accounts which will be used to connect to the
MySQL server.

<property>	
  
	
  	
  <name>javax.jdo.option.ConnectionURL</name>	
  
	
  	
  <value>jdbc:mysql://MYSQL_HOSTNAME/metastore</value>	
  
</property>	
  
	
  	
  
<property>	
  
	
  	
  <name>javax.jdo.option.ConnectionDriverName</name>	
  
	
  	
  <value>com.mysql.jdbc.Driver</value>	
  
</property>	
  
	
  	
  
<property>	
  
	
  	
  <name>javax.jdo.option.ConnectionUserName</name>	
  
	
  	
  <value>hiveuser</value>	
  
</property>	
  
	
  	
  
<property>	
  
	
  	
  <name>javax.jdo.option.ConnectionPassword</name>	
  
	
  	
  <value>password</value>	
  
</property>	
  
	
  	
  
<property>	
  
	
  	
  <name>datanucleus.autoCreateSchema</name>	
  
	
  	
  <value>false</value>	
  
</property>	
  
	
  	
  
<property>	
  
	
  	
  <name>datanucleus.fixedDatastore</name>	
  
	
  	
  <value>true</value>	
  
</property>	
  


From above, you should replace the “MYSQL_HOSTNAME” string to be the
hostname or the IP address of the server where MySQL is installed to. But this
tutorial installed MySQL in the very server where Hive was installed so it is
127.0.0.1.
If, for purposes of safer management or some other reason, you installed
MySQL to some other server then just replace “MYSQL_HOSTNAME” string
with its IP address.

Thus concludes the installation and configuration of Hive.
Consult Hive’s official site documents for a detailed usage guide for Hive.

Contenu connexe

Tendances

Installing apache sqoop
Installing apache sqoopInstalling apache sqoop
Installing apache sqoopEnrique Davila
 
Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16Enrique Davila
 
Installing hive on ubuntu 16
Installing hive on ubuntu 16Installing hive on ubuntu 16
Installing hive on ubuntu 16Enrique Davila
 
Single node hadoop cluster installation
Single node hadoop cluster installation Single node hadoop cluster installation
Single node hadoop cluster installation Mahantesh Angadi
 
Linux apache installation
Linux apache installationLinux apache installation
Linux apache installationDima Gomaa
 
Content server installation guide
Content server installation guideContent server installation guide
Content server installation guideNaveed Bashir
 
Hadoop single cluster installation
Hadoop single cluster installationHadoop single cluster installation
Hadoop single cluster installationMinh Tran
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptwebhostingguy
 
Setting up LAMP for Linux newbies
Setting up LAMP for Linux newbiesSetting up LAMP for Linux newbies
Setting up LAMP for Linux newbiesShabir Ahmad
 
Cloudera cluster setup and configuration
Cloudera cluster setup and configurationCloudera cluster setup and configuration
Cloudera cluster setup and configurationSudheer Kondla
 
2.4.1 use debian package management v2
2.4.1 use debian package management v22.4.1 use debian package management v2
2.4.1 use debian package management v2Acácio Oliveira
 
Salt conf 2014-installing-openstack-using-saltstack-v02
Salt conf 2014-installing-openstack-using-saltstack-v02Salt conf 2014-installing-openstack-using-saltstack-v02
Salt conf 2014-installing-openstack-using-saltstack-v02Yazz Atlas
 

Tendances (17)

Installing apache sqoop
Installing apache sqoopInstalling apache sqoop
Installing apache sqoop
 
Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16
 
Installing hive on ubuntu 16
Installing hive on ubuntu 16Installing hive on ubuntu 16
Installing hive on ubuntu 16
 
Hadoop on ec2
Hadoop on ec2Hadoop on ec2
Hadoop on ec2
 
Single node hadoop cluster installation
Single node hadoop cluster installation Single node hadoop cluster installation
Single node hadoop cluster installation
 
Linux apache installation
Linux apache installationLinux apache installation
Linux apache installation
 
Content server installation guide
Content server installation guideContent server installation guide
Content server installation guide
 
Linux
LinuxLinux
Linux
 
Hadoop single cluster installation
Hadoop single cluster installationHadoop single cluster installation
Hadoop single cluster installation
 
Hadoop completereference
Hadoop completereferenceHadoop completereference
Hadoop completereference
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.ppt
 
Setting up LAMP for Linux newbies
Setting up LAMP for Linux newbiesSetting up LAMP for Linux newbies
Setting up LAMP for Linux newbies
 
Cloudera cluster setup and configuration
Cloudera cluster setup and configurationCloudera cluster setup and configuration
Cloudera cluster setup and configuration
 
Installing lemp with ssl and varnish on Debian 9
Installing lemp with ssl and varnish on Debian 9Installing lemp with ssl and varnish on Debian 9
Installing lemp with ssl and varnish on Debian 9
 
2.4.1 use debian package management v2
2.4.1 use debian package management v22.4.1 use debian package management v2
2.4.1 use debian package management v2
 
are available here
are available hereare available here
are available here
 
Salt conf 2014-installing-openstack-using-saltstack-v02
Salt conf 2014-installing-openstack-using-saltstack-v02Salt conf 2014-installing-openstack-using-saltstack-v02
Salt conf 2014-installing-openstack-using-saltstack-v02
 

Similaire à R hive tutorial supplement 2 - Installing Hive

Apache Hive micro guide - ConfusedCoders
Apache Hive micro guide - ConfusedCodersApache Hive micro guide - ConfusedCoders
Apache Hive micro guide - ConfusedCodersYash Sharma
 
Getting started-with-zend-framework
Getting started-with-zend-frameworkGetting started-with-zend-framework
Getting started-with-zend-frameworkMarcelo da Rocha
 
php-and-zend-framework-getting-started
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-startedtutorialsruby
 
php-and-zend-framework-getting-started
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-startedtutorialsruby
 
php-and-zend-framework-getting-started
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-startedtutorialsruby
 
php-and-zend-framework-getting-started
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-startedtutorialsruby
 
Configure h base hadoop and hbase client
Configure h base hadoop and hbase clientConfigure h base hadoop and hbase client
Configure h base hadoop and hbase clientShashwat Shriparv
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuis Rodríguez Castromil
 
Single node setup
Single node setupSingle node setup
Single node setupKBCHOW123
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Maurício Linhares
 
Hadoop cluster 安裝
Hadoop cluster 安裝Hadoop cluster 安裝
Hadoop cluster 安裝recast203
 
02 Hadoop deployment and configuration
02 Hadoop deployment and configuration02 Hadoop deployment and configuration
02 Hadoop deployment and configurationSubhas Kumar Ghosh
 
Apache hadoop 2_installation
Apache hadoop 2_installationApache hadoop 2_installation
Apache hadoop 2_installationsushantbit04
 
Apache windows
Apache windowsApache windows
Apache windowsmexxixxo
 

Similaire à R hive tutorial supplement 2 - Installing Hive (20)

Apache Hive micro guide - ConfusedCoders
Apache Hive micro guide - ConfusedCodersApache Hive micro guide - ConfusedCoders
Apache Hive micro guide - ConfusedCoders
 
Ex-8-hive.pptx
Ex-8-hive.pptxEx-8-hive.pptx
Ex-8-hive.pptx
 
Getting started-with-zend-framework
Getting started-with-zend-frameworkGetting started-with-zend-framework
Getting started-with-zend-framework
 
PHP
PHP PHP
PHP
 
php-and-zend-framework-getting-started
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-started
 
php-and-zend-framework-getting-started
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-started
 
php-and-zend-framework-getting-started
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-started
 
php-and-zend-framework-getting-started
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-started
 
Apache - Quick reference guide
Apache - Quick reference guideApache - Quick reference guide
Apache - Quick reference guide
 
Configure h base hadoop and hbase client
Configure h base hadoop and hbase clientConfigure h base hadoop and hbase client
Configure h base hadoop and hbase client
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
 
Single node setup
Single node setupSingle node setup
Single node setup
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10
 
Hadoop cluster 安裝
Hadoop cluster 安裝Hadoop cluster 安裝
Hadoop cluster 安裝
 
Appache.ppt
Appache.pptAppache.ppt
Appache.ppt
 
Appache.ppt
Appache.pptAppache.ppt
Appache.ppt
 
02 Hadoop deployment and configuration
02 Hadoop deployment and configuration02 Hadoop deployment and configuration
02 Hadoop deployment and configuration
 
Mysql
MysqlMysql
Mysql
 
Apache hadoop 2_installation
Apache hadoop 2_installationApache hadoop 2_installation
Apache hadoop 2_installation
 
Apache windows
Apache windowsApache windows
Apache windows
 

Plus de Aiden Seonghak Hong

RHive tutorial supplement 3: RHive 튜토리얼 부록 3 - RStudio 설치
RHive tutorial supplement 3: RHive 튜토리얼 부록 3 - RStudio 설치RHive tutorial supplement 3: RHive 튜토리얼 부록 3 - RStudio 설치
RHive tutorial supplement 3: RHive 튜토리얼 부록 3 - RStudio 설치Aiden Seonghak Hong
 
RHive tutorial supplement 2: RHive 튜토리얼 부록 2 - Hive 설치
RHive tutorial supplement 2: RHive 튜토리얼 부록 2 - Hive 설치RHive tutorial supplement 2: RHive 튜토리얼 부록 2 - Hive 설치
RHive tutorial supplement 2: RHive 튜토리얼 부록 2 - Hive 설치Aiden Seonghak Hong
 
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치Aiden Seonghak Hong
 
RHive tutorial 5: RHive 튜토리얼 5 - apply 함수와 맵리듀스
RHive tutorial 5: RHive 튜토리얼 5 - apply 함수와 맵리듀스RHive tutorial 5: RHive 튜토리얼 5 - apply 함수와 맵리듀스
RHive tutorial 5: RHive 튜토리얼 5 - apply 함수와 맵리듀스Aiden Seonghak Hong
 
RHive tutorial 4: RHive 튜토리얼 4 - UDF, UDTF, UDAF 함수
RHive tutorial 4: RHive 튜토리얼 4 - UDF, UDTF, UDAF 함수RHive tutorial 4: RHive 튜토리얼 4 - UDF, UDTF, UDAF 함수
RHive tutorial 4: RHive 튜토리얼 4 - UDF, UDTF, UDAF 함수Aiden Seonghak Hong
 
RHive tutorial 3: RHive 튜토리얼 3 - HDFS 함수
RHive tutorial 3: RHive 튜토리얼 3 - HDFS 함수RHive tutorial 3: RHive 튜토리얼 3 - HDFS 함수
RHive tutorial 3: RHive 튜토리얼 3 - HDFS 함수Aiden Seonghak Hong
 
RHive tutorial 2: RHive 튜토리얼 2 - 기본 함수
RHive tutorial 2: RHive 튜토리얼 2 - 기본 함수RHive tutorial 2: RHive 튜토리얼 2 - 기본 함수
RHive tutorial 2: RHive 튜토리얼 2 - 기본 함수Aiden Seonghak Hong
 
RHive tutorial 1: RHive 튜토리얼 1 - 설치 및 설정
RHive tutorial 1: RHive 튜토리얼 1 - 설치 및 설정RHive tutorial 1: RHive 튜토리얼 1 - 설치 및 설정
RHive tutorial 1: RHive 튜토리얼 1 - 설치 및 설정Aiden Seonghak Hong
 
R hive tutorial - apply functions and map reduce
R hive tutorial - apply functions and map reduceR hive tutorial - apply functions and map reduce
R hive tutorial - apply functions and map reduceAiden Seonghak Hong
 
R hive tutorial - udf, udaf, udtf functions
R hive tutorial - udf, udaf, udtf functionsR hive tutorial - udf, udaf, udtf functions
R hive tutorial - udf, udaf, udtf functionsAiden Seonghak Hong
 
RHive tutorials - Basic functions
RHive tutorials - Basic functionsRHive tutorials - Basic functions
RHive tutorials - Basic functionsAiden Seonghak Hong
 

Plus de Aiden Seonghak Hong (13)

IoT and Big data with R
IoT and Big data with RIoT and Big data with R
IoT and Big data with R
 
RHive tutorial supplement 3: RHive 튜토리얼 부록 3 - RStudio 설치
RHive tutorial supplement 3: RHive 튜토리얼 부록 3 - RStudio 설치RHive tutorial supplement 3: RHive 튜토리얼 부록 3 - RStudio 설치
RHive tutorial supplement 3: RHive 튜토리얼 부록 3 - RStudio 설치
 
RHive tutorial supplement 2: RHive 튜토리얼 부록 2 - Hive 설치
RHive tutorial supplement 2: RHive 튜토리얼 부록 2 - Hive 설치RHive tutorial supplement 2: RHive 튜토리얼 부록 2 - Hive 설치
RHive tutorial supplement 2: RHive 튜토리얼 부록 2 - Hive 설치
 
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
 
RHive tutorial 5: RHive 튜토리얼 5 - apply 함수와 맵리듀스
RHive tutorial 5: RHive 튜토리얼 5 - apply 함수와 맵리듀스RHive tutorial 5: RHive 튜토리얼 5 - apply 함수와 맵리듀스
RHive tutorial 5: RHive 튜토리얼 5 - apply 함수와 맵리듀스
 
RHive tutorial 4: RHive 튜토리얼 4 - UDF, UDTF, UDAF 함수
RHive tutorial 4: RHive 튜토리얼 4 - UDF, UDTF, UDAF 함수RHive tutorial 4: RHive 튜토리얼 4 - UDF, UDTF, UDAF 함수
RHive tutorial 4: RHive 튜토리얼 4 - UDF, UDTF, UDAF 함수
 
RHive tutorial 3: RHive 튜토리얼 3 - HDFS 함수
RHive tutorial 3: RHive 튜토리얼 3 - HDFS 함수RHive tutorial 3: RHive 튜토리얼 3 - HDFS 함수
RHive tutorial 3: RHive 튜토리얼 3 - HDFS 함수
 
RHive tutorial 2: RHive 튜토리얼 2 - 기본 함수
RHive tutorial 2: RHive 튜토리얼 2 - 기본 함수RHive tutorial 2: RHive 튜토리얼 2 - 기본 함수
RHive tutorial 2: RHive 튜토리얼 2 - 기본 함수
 
RHive tutorial 1: RHive 튜토리얼 1 - 설치 및 설정
RHive tutorial 1: RHive 튜토리얼 1 - 설치 및 설정RHive tutorial 1: RHive 튜토리얼 1 - 설치 및 설정
RHive tutorial 1: RHive 튜토리얼 1 - 설치 및 설정
 
R hive tutorial 1
R hive tutorial 1R hive tutorial 1
R hive tutorial 1
 
R hive tutorial - apply functions and map reduce
R hive tutorial - apply functions and map reduceR hive tutorial - apply functions and map reduce
R hive tutorial - apply functions and map reduce
 
R hive tutorial - udf, udaf, udtf functions
R hive tutorial - udf, udaf, udtf functionsR hive tutorial - udf, udaf, udtf functions
R hive tutorial - udf, udaf, udtf functions
 
RHive tutorials - Basic functions
RHive tutorials - Basic functionsRHive tutorials - Basic functions
RHive tutorials - Basic functions
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 

Dernier (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

R hive tutorial supplement 2 - Installing Hive

  • 1. RHive tutorial – Installing Hive As an add-on to Hadoop, Hive cannot run independent of Hadoop. This tutorial explains how additionally configure Hive to the Hadoop environment made in the Hadoop setup tutorial. Hive does not need to be installed for all servers where Hadoop is installed. It is just needed for the server where Hadoop client will run. Here, Hive will be installed in Hadoop namenode for convenience in setup. Downloading Hive Because Hive is written in Java just like Hadoop is, downloading the file and decompressing it alone constitutes the entire setup procedure. A stable version of Hive can be found in the URL below. http://www.apache.org/dist//hive/hive-0.7.1/hive-0.7.1-bin.tar.gz The latest stable version at the point of this tutorial’s creation is 0.7.1; it is alright to build a separate snapshot version and use that instead. If version 0.8x is released, it’s okay to use that. Like the following, connect to the target server for Hive installation and download the final version of Hive. ssh  root@10.1.1.1   mkdir  hive_stable   cd  hive_stable   wget   http://www.apache.org/dist//hive/hive-­‐0.7.1/hive-­‐0.7.1-­‐ bin.tar.gz   tar  xvfz  ./hive-­‐0.7.1-­‐bin.tar.gz   mkdir  /service   mv  ./hive-­‐0.7.1-­‐bin  /service   Configuring MySQL We will be choosing and using MySQL for Hive’s repository. Hive uses SQLite by default, but if you want to enable multiple users to use Hive simultaneously, you need to be able to use MySQL or other DBs as repositories. Hence this tutorial will be using MySQL.
  • 2. MySQL can be installed in a server apart from the one where Hive will be installed, but this tutorial will install MySQL along where, Hadoop namenode is installed (that is, where Hive is installed). Use yum like the following to install mysql client and server yum  install  mysql  mysql-­‐server   After installation, start mysql server. /etc/init.d/mysqld  start   Now create a database in MySQL for Hive to use. This tutorial will use the name “metastore” for that database. Go into mysql and create a database like shown. mysql>  CREATE  DATABASE  metastore;   mysql>  USE  metastore;   mysql>   SOURCE   /service/hive-­‐ 0.7.1/scripts/metastore/upgrade/mysql/hive-­‐schema-­‐ 0.7.0.mysql.sql;   Here, “/service/hive-0.7.1" is Hive’s HOME directory, and "$HIVE_HOME/scripts/metastore/upgrade/mysql" contains SQL files that can set MySQL up for Hive or upgrade Hive database (which exists in MySQL database). Select and run the ones suited to your version and complete setup. Now create a MySQL user which Hive will use, and grant it the privilege to access the database, “metastore”. mysql>  CREATE  USER  'hiveuser'@'%'  IDENTIFIED  BY  'password';   mysql>   GRANT   SELECT,INSERT,UPDATE,DELETE   ON   metastore.*   TO   'hiveuser'@'%';   mysql>  REVOKE  ALTER,CREATE  ON  metastore.*  FROM  'hiveuser'@'%';   Configuring MySQL for Hive use is complete. Now you need to configure Hive to enable it to connect to MySQL. JDBC is required for allowing connecting to MySQL from Hive but JDBC is not included in MySQL.
  • 3. You must manually download it from the MySQL site and copy it into the installed Hive. JDBC is available for download from here: http://dev.mysql.com/downloads/ As shown below, download and decompress it, then copy the jar file to Hadoop’s lib directory. $   curl   http://dev.mysql.com/get/Downloads/Connector-­‐J/mysql-­‐ connector-­‐java-­‐ 5.1.18.tar.gz/from/http://mirror.services.wisc.edu/mysql/   $  tar  xvfz  mysql-­‐connector-­‐java-­‐5.1.18.tar.gz   $   cp   ./mysql-­‐connector-­‐java-­‐5.1.18/mysql-­‐connector-­‐java-­‐5.1.18-­‐ bin.jar  /service/hive-­‐0.7.1/lib/   Now for modifying Hive’s configuration. You need to open $HIVE_HOME/conf/hive-site.xml with a text editor and appropriately adjust the items pertaining to MySQL. If you have installed Hive for the first time, then the $HIVE_HOME/conf/hive- site.xml file probably doesn’t exist in the directory. Copy the hive-default.xml.template file in the same directory and edit it like the following: cd  /service/hive-­‐0.7.1/conf/hive-­‐site.xml   cp  ./hive-­‐default.xml.template  ./hive-­‐site.xml   Now look for the contents below in ./hive-site.xml and make suitable adjustments for the MySQL accounts which will be used to connect to the MySQL server. <property>      <name>javax.jdo.option.ConnectionURL</name>      <value>jdbc:mysql://MYSQL_HOSTNAME/metastore</value>   </property>       <property>      <name>javax.jdo.option.ConnectionDriverName</name>      <value>com.mysql.jdbc.Driver</value>  
  • 4. </property>       <property>      <name>javax.jdo.option.ConnectionUserName</name>      <value>hiveuser</value>   </property>       <property>      <name>javax.jdo.option.ConnectionPassword</name>      <value>password</value>   </property>       <property>      <name>datanucleus.autoCreateSchema</name>      <value>false</value>   </property>       <property>      <name>datanucleus.fixedDatastore</name>      <value>true</value>   </property>   From above, you should replace the “MYSQL_HOSTNAME” string to be the hostname or the IP address of the server where MySQL is installed to. But this tutorial installed MySQL in the very server where Hive was installed so it is 127.0.0.1. If, for purposes of safer management or some other reason, you installed MySQL to some other server then just replace “MYSQL_HOSTNAME” string with its IP address. Thus concludes the installation and configuration of Hive. Consult Hive’s official site documents for a detailed usage guide for Hive.