Hive3 detailed tutorial (I) hive3 + Hadoop 3 environment installation

Miss Zhu 2022-02-13 08:38:57 阅读数:967

hive3 hive detailed tutorial hive3

This time Hive Use Hive3.1.2.
Three virtual machine nodes are planned this time , Among them in hp301 Installation on mysql and hive.

Host name IP Address
hp301 mysql/hive

Use Hive The environment that needs to be used is Hadoop, This use is Hadoop3.3.1, Its installation 、 See this blog for details Hadoop3 series :Hadoop3 Detailed tutorial
Use Hive Need to be in Linux Install on virtual machine Mysql, See... For the installation process , This blog is about Linux Install and uninstall on MySQL The connection of :Linux Next MySQL Install and uninstall

After finishing the above operation , We can do it Hive Installation .
The following are the detailed installation steps :
1. download apache-hive-3.1.2-bin.tar.gz Upload to hp301 /apps Next .
2. Unzip to /usr/local Next

tar -zxvf /apps/apache-hive-3.1.2-bin.tar.gz -C /usr/local

3. For the convenience of subsequent use , Create a soft connection to it :

ln -s /usr/local/apache-hive-3.1.2-bin/ /usr/local/hive3

4. To configure Hive Environment variables of :
stay /etc/profile.d So let's make a new one


Write the following code in it :

export HIVE_HOME=/usr/local/hive3
export PATH=$PATH:$HIVE_HOME/bin

Use source command , Enable environment variables :

source /etc/profile.d/

6. Modify the configuration file
take /usr/local/hive3/conf/ Renamed as
And add it later :


Create a new one hive-site.xml, Fill in :

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- jdbc URL -->
<!-- planning mysql The database in which metadata is stored is named metastore, Automatically created when initialization data does not exist -->
<!-- jdbc Driver-->
<!-- Database user name -->
<!-- Database password -->
<!-- Hive Verification of metadata storage version -->
<!-- Metadata storage Authorization -->
<!-- Hive Default in HDFS Working directory of -->

7. add to Java visit MySQL Of jar package
download mysql-connector-java-5.1.47-bin.jar And upload them to linux The server , Then copy it to /usr/local/hive3/lib Next

8. initialization Hive database , Carry out orders :

schematool -initSchema -dbType mysql

At this time to use navicat see hp301 The database of , You'll find one more metastrore The database of , All tables in the library even if Hive Table structure for storing metadata :
 Insert picture description here
9. Use Hive
start-up hadoop

hadoop After a successful launch , You can start hive client :


The command line effect shown in the figure :
 Insert picture description here
You can view the process through another connection ,Hive It's actually a RunJar process :
 Insert picture description here

copyright:author[Miss Zhu],Please bring the original link to reprint, thank you.