Install hive and hive

Source: Internet
Author: User

Install hive and hive


Hive installation is relatively simple, because there is no need to modify too many configuration files


1. Download and decompress

I put it in/usr/hadoop/hive


2. Set the environment variable. (It seems that it is not set)


vim /etc/profileexport JAVA_HOME=/usr/java/jdk8export HADOOP_HOME=/usr/hadoop/hadoop...export HIVE_HOME=/usr/hadoop/hiveexport HIVE_CONF_DIR=$HIVE_HOME/hive-confexport PATH=$HIVE_HOME/bin:$HADOOP_HOME/bin:$JAVA_HOME/bin:/sbin/:/bin:$PATH


3. Configure hive

Cp-r $ HIVE_HOME/conf $ HIVE_CONF_DIR/
Cd $ HIVE_CONF_DIR/
Cp hive-default.xml.template hive-default.xml
Cp hive-env.sh.template hive. env. sh


Vim hive-env.sh.
Export HADOOP_HEAPSIZE = 512
Export HIVE_CONF_DIR =/usr/hadoop/hive-conf



4. test:


Hive

This is the same as SQL in hive status.

However, an error may also be reported.

Permission issues may occur.

Remember what permission requires writable, but the current permission is...

You only need to set the folder permission to 777.

Chmod-R 777 file


Hive> show tables;
OK
Time taken: 4.824 seconds
Hive> create table hwz (id int, name string );
OK
Time taken: 0.566 seconds

Hive> select * from hwz;
OK
Time taken: 0.361 seconds






Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.