Hive binds to MySQL as metabase

Source: Internet
Author: User

Suddenly remember to write an article about changing the hive metabase from the default local derby to a remote MySQL, and in the cloud note, I turned it over and found it, and now I share it with you.


Environment:
operating system: Centos6.5mysql:5.6hive:0.13.1hadoop:1.2.1

First, configure MySQL
1. Install MySQL (refer to "CentOS MySQL installation and configuration (non-default installation)")

2. Create hive metabase in MySQL, named Hivemysql>create database hive;

3. Authorization to Hadoopuser

Note that the password here must match the Javax.jdo.option.ConnectionPassword password in Hive-site.xml



Second, the installation configuration hive


1. Installing hive


Rename to Hive


2. Configure Hive

To configure the Hive environment variable:

#vim/etc/profile

After modifying and saving, remember source

#source/etc/profile


Copy and rename the hive-env.sh.template template to hive-env.sh and modify the content:

#cp hive-env.sh.template hive-env.sh

#vim hive-env.sh

Modify Hadoop_home for Hadoop installation path


Duplicate a copy of Hive-default.xml.template renamed to Hive-site.xml

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

#vim Hive-site.xml


Change the following in Hive-site.xml:

Attention:

<property>

<name>javax.jdo.option.ConnectionURL</name>

<value>jdbc:mysql://localhost/Hive?createdatabaseifnotexist=true</value>

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

</property>

The red location is the name of the MySQL database used, so be sure to give the MySQL user full access to hive.

Here is the user name and password configured to log in to MySQL, which was previously set up in MySQL and given sufficient permissions.


Add the missing mysql-connector-java-5.1.34.tar.gz package under the Lib directory in the Hive installation directory.

: http://ftp.jaist.ac.jp/pub/mysql/Downloads/Connector-J/

(the file was previously placed in the Sqoop directory, so copy directly from there)


Switch into the Hvie directory to start the metadata service process

Hive#./bin/hive--service Metastore


To create a new connection or terminal, enter hive:

Success! You can then use hive to do the work.



About


WARN Conf.  Hiveconf:deprecated:hive.metastore.ds.retry.* no longer have any effect. Use hive.hmshandler.retry.* instead


Workaround:

Replace hive.metastore.ds.retry in configuration file Hive-site.xml under Hive with hive.hmshandler.retry

Then there will be no such warning.



Hive binds to MySQL as metabase

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.