Hive and MySQL installation and use

Source: Internet
Author: User

Hive: Like a data warehouse that manages Hadoop data while looking at Hadoop data, hive is like a SQL parsing engine, and hive can convert SQL operations into Mr Jobs, so the hive operation language is also called Hsql, Data is usually stored in Derby and MySQL. Derby default, due to its limitations, is not used, the author uses the MySQL database.

Version:

hadoop1.2.1:

Apache-hive-0.13.1-bin.tar.gz

Mysql-5.5-server

Mysql-5.5-client

Mysql-connector-java-5.1.10.jar

1. Install MySQL First

sudo apt-get install Mysql-server

sudo apt-get install mysql-client

sudo apt-get install Libmysqlclient-dev

2. Follow the prompts to set up MySQL

3. Installing hive

Copy hive to/usr

3.1 Decompression:

sudo tar-zxvf apache-hive-0.13.1-bin.tar.gz

3.2 Renaming:

sudo mv hive-0.13.1 Hive

3.3 Environment Variables:

sudo vim/etc/profile


Note Hive_home and path

Source/etc/profile

3.4 Rename the following file in/usr/hive/conf

sudo mv Hive-default.xml.template hive-site.xml

sudo mv Hive-env.sh.template hive-env.sh

3.5 Modifying a hadoop-env.sh file under Hadoop


3. 6 Modify/usr/hive/bin/hive-config.sh


3.7 Hive Installation Complete

Enter bin/below to execute hive into hive shell

4 MySQL is connected to hive:

4.1 Copy the Mysql-connector-java-5.1.10.jar to the/usr/hive/lib first.

4.2 Modifying the configuration file/usr/hive/conf/hive-site.xml (renamed)

Table storage location under HDFs:

About MySQL settings: According to your own MySQL configuration


5. Test Link success:

Mysql-uroot-p Password

show databases;

You will see the hive database.

6. You can create a table operation in hive.

Hive and MySQL installation and use

Related Article

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.