Hadoop installation Deployment 3------Install Hive

Source: Internet
Author: User

Install MySQL

MySQL is installed on the master node

1) Uninstall the MySQL-related installation package from the system and uninstall only the MySQL-beginning package

Rpm-qa|grep-i MySQL

-I action is case insensitive

You can see that there are two installation packages



Remove the two services (remove the suffix)

Rpm-e mysql-client-5.6.19-1.linux_glibc2.5.x86_64

Rpm-e mysql-server-5.6.19-1.linux_glibc2.5.x86_64

To view the remaining directories:

Whereis MySQL

Then delete the MySQL directory:


Delete related files:



The most critical:


2) Install MySQL dependency

Yum Install vim Libaio net-tools

3) Install the mysql5.5.39 RPM package



4) Copy the configuration file


5) Start the MySQL service

Service MySQL Start

6) Set to boot from boot

Chkconfig MySQL on

7) Set the root user login password

/usr/bin/mysqladmin-u root password ' root '

8) Log in to MySQL as the root user


Installing Hive

Hive is installed on the master node.

1) Create hive users, databases, etc. in MySQL

Insert into Mysql.user (Host,user,password) VALUES ("localhost", "Hive", Password ("Hive"));

Create DATABASE hive;

Grant all on hive.* to [email protected] '% ' identified by ' hive ';

Grant all on hive.* to [email protected] ' localhost ' identified by ' hive ';

Flush privileges;

2) Quit MySQL


3) Add Environment variables

4) Modify Hive-site.xml




<DESCRIPTION>JDBC connect string for a JDBC metastore</description>





<description>driver class name for a JDBC metastore</description>





<description>password to use against Metastore database</description>





<description>this is the port the Hive Web Interface would listen on</description>





<description>creates necessary schema on a startup if one doesn ' t exist. Set this to false after creating it once</description>










<description>username to use against Metastore database</description>





<description>local scratch space for Hive jobs</description>





<description>temporary Local directory for added resources in the remote file system.</description>





<description>location of Hive run time structured log file</description>


5) Copy the Mysql-connector-java-5.1.6-bin.jar to the lib below the hive


6) Copy the Jline-2.12.jar to the corresponding directory in Hadoop, replace the Jline-0.9.94.jar, or the boot will error


mv/home/hdpsrc/hadoop-2.6.3/share/hadoop/yarn/lib/jline-0.9.94.jar/home/hdpsrc/hadoop-2.6.3/share/hadoop/yarn/ Lib/jline-0.9.94.jar.bak

7) Create Hive Temp Folder


8) Start Test hive

After you start Hadoop, execute the hive command


Test input Show database;

hive> show databases;



Time taken:0.907 seconds, fetched:1 row (s)

Hadoop installation Deployment 3------Install Hive

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.