Hive Installation Tutorial

Source: Internet
Author: User
Tags hadoop fs

1. Download hadoop-1.2.1-bin.tar.gz

Unzip, modify the name to hive

MV to/opt/hive

2. Configure Hive

CP Hive-default.xml.template Hive-site.xml

Modify Hive-site.xml

CP Hive-log4j.properties.template Hive-log4j.properties

modifying hive-env.sh, configuring environment variables

3. Install MySQL

sudo yum install Mysql-server

Change root password

mysqld admin-uroot Password root

Create a hive User

Mysql>create user ' hive ' @ ' localhost ' identfied by ' hive ';

Give hive full permissions

Mysql>grant Privileges On * * to [email protected];

Refresh

Mysql>flush privileges;

Log in to hive and create a hive database

Mysql>create database hive;

4. Create an HDFs directory

Hive default Database configuration directory is/user/hive/warehouse

Create/user/hive/warehouse

Hadoop fs-mkdir-p/user/hive/warehouse

Update permissions

Hadoop Fs-chmod G+w/user/hive/warehouse

Create/tmp/hive

Hadoop Fs-chmod 777/tmp/hive

5. Add Hive Environment variables

VI ~/.BASHRC

Export path= $PATH:/opt/hive/bin

SOURCE ~/.BASHRC

5. Using Hive

>hive

Hive>create table test (id int, name string);

Drawings: Hive Run Udaf

Hive Installation Tutorial

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.