Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Hive Install

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

1. Http://mirror.bit.edu.cn/apache/hive/stable-2/ downloads hive; and uploads to linux system

2. Move apache-hive-2.3.3-bin.tar.gz to the / usr/local directory, extract it, and rename it to hive; as follows

[root@hmaster soft] # ls

Apache-hive-2.3.3-bin.tar.gz hadoop-2.7.3.tar.gz jdk-8u151-linux-i586.tar.gz

[root@hmaster soft] # mv apache-hive-2.3.3-bin.tar.gz / usr/local/

[root@hmaster soft] # cd / usr/local/

[root@hmaster local] # ls

Apache-hive-2.3.3-bin.tar.gz bin etc games hadoop include java lib lib64 libexec sbin share src

[root@hmaster local] # tar-xvf apache-hive-2.3.3-bin.tar.gz

[root@hmaster local] # mv apache-hive-2.3.3-bin hive

[root@hmaster local] # ls

Bin etc games hadoop hive include java lib lib64 libexec sbin share src

[root@hmaster local] #

3. Configure environment variables

[root@hmaster local] # vim / etc/profile

[root@hmaster local] # ^ C

[root@hmaster local] # source / etc/profile

[root@hmaster local] # echo $PATH

/ usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.8.0_151/bin:/usr/local/hadoop/bin:/usr/local/hadoop/sbin:/root/bin:/usr/java/jdk1.8.0_151/bin:/usr/local/hadoop/bin:/usr/local/hadoop/sbin:/usr/local/hive/bin

[root@hmaster local] #

# set java environment / usr/local/java/jdk1.8.0_151

Export JAVA_HOME=/usr/java/jdk1.8.0_151

Export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

Export PATH=$PATH:$JAVA_HOME/bin

Export PATH=$PATH:/usr/local/hadoop/bin:/usr/local/hadoop/sbin

Export PATH=$PATH:/usr/local/hive/bin

4. Configure hive-site.xml

[root@hmaster conf] # pwd

/ usr/local/hive/conf

[root@hmaster conf] # ll

Total 288

-rw-r--r--. 1 root root 1596 Feb 17 2017 beeline-log4j2.properties.template

-rw-r--r--. 1 root root 257573 Mar 28 2018 hive-default.xml.template

-rw-r--r--. 1 root root 2365 Feb 17 2017 hive-env.sh.template

-rw-r--r--. 1 root root 2274 Feb 17 2017 hive-exec-log4j2.properties.template

-rw-r--r--. 1 root root 2925 Mar 7 2018 hive-log4j2.properties.template

-rw-r--r--. 1 root root 2060 Feb 17 2017 ivysettings.xml

-rw-r--r--. 1 root root 2719 Mar 7 2018 llap-cli-log4j2.properties.template

-rw-r--r--. 1 root root 7041 Mar 7 2018 llap-daemon-log4j2.properties.template

-rw-r--r--. 1 root root 2662 Jul 20 2016 parquet-logging.properties

[root@hmaster conf] # cp hive-default.xml.template hive-site.xml

[root@hmaster hive] # pwd

/ usr/local/hive

[root@hmaster hive] # mkdir tmp

[root@hmaster hive] # ls

Bin binary-package-licenses conf examples hcatalog jdbc lib LICENSE NOTICE RELEASE_NOTES.txt scripts tmp

Copy the hive-site.xml file to the window for editing through the file transfer tool

Hive.metastore.schema.verification

False

Enforce metastore schema version consistency.

True: Verify that version information stored in is compatible with one from Hive jars. Also disable automatic

Schema migration attempt. Users are required to manually migrate schema after Hive upgrade which ensures

Proper metastore schema migration. (Default)

False: Warn if the version information stored in metastore doesn't match with one from in Hive jars.

Replace ${system:java.io.tmpdir} with the / usr/local/hive/tmp directory you created

Replace ${system:user.name} with root

Upload overlay file hive-site.xml

Execute the following command in the / usr/local/hive directory

[root@hmaster hive] # pwd

/ usr/local/hive

[root@hmaster hive] # schematool-initSchema-dbType derby

[root@hmaster hive] # ll

Total 60

Drwxr-xr-x. 3 root root 133 Oct 9 23:46 bin

Drwxr-xr-x. 2 root root 4096 Oct 9 23:46 binary-package-licenses

Drwxr-xr-x. 2 root root 4096 Oct 9 23:57 conf

-rw-r--r--. 1 root root 639 Oct 10 02:16 derby.log

Drwxr-xr-x. 4 root root 34 Oct 9 23:46 examples

Drwxr-xr-x. 7 root root 68 Oct 9 23:46 hcatalog

Drwxr-xr-x. 2 root root 44 Oct 9 23:46 jdbc

Drwxr-xr-x. 4 root root 12288 Oct 9 23:46 lib

-rw-r--r--. 1 root root 20798 Mar 7 2018 LICENSE

Drwxr-xr-x. 5 root root 133 Oct 10 02:16 metastore_db

-rw-r--r--. 1 root root 230 Mar 27 2018 NOTICE

-rw-r--r--. 1 root root 459 Mar 28 2018 RELEASE_NOTES.txt

Drwxr-xr-x. 4 root root 35 Oct 9 23:46 scripts

Drwxr-xr-x. 2 root root 6 Oct 10 01:33 tmp

Start the hive command: hive

Schematool-initSchema-dbType derby

Try initializing the database of metastore_db under the current directory

Note that the next time you execute hive, you should be in the same directory. By default, look for metastore in the current directory.

If you encounter a problem, delete the metastore_db and re-execute the command schematool-initSchema-dbType derby

In the actual working environment, MySQL is often used as the database of metastore.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report