Install and use hive

Source: Internet
Author: User

Hive is an SQL parsing engine that allows you to create tables in hive and execute SQL statements. The created table is stored in HDFS, And the executed SQL statement is executed through mapreduce. It is too convenient to compile mapreduce jobs by executing SQL statements!

1. decompress and set the environment

Hive-0.9.0.tar.gz is used. Decompress and rename the files in the/usr/local directory.

Ta-xzvf hive-0.9.0.tar.gzmv hive-0.9.0 hive

Set the environment variable hive_home in/etc/profile, point to/usr/local/hive, and set the bin directory to the PATH variable.

2. Rename the configuration file

Rename the configuration file in the conf directory and execute

MV hive-env.sh.template hive-env.shmv hive-default.xml.template
3. modify configuration information

Modify the hadoop hadoop-env.sh (otherwise the hive is started to report the error of the class not found)

Export hadoop_classpath =.: $ classpath: $ hadoop_classpath: $ hadoop_home/bin

Modify the hive-config.sh for $ hive_home/bin by adding the following three lines

Export java_home =/usr/local/jdkexport hive_home =/usr/local/hiveexport hadoop_home =/usr/local/hadoop
4. Start

First, make sure that hadoop is running, and then execute the command hive to enter the hive command line.

Okay, you have done it!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.