MySQL Configuration note for hive

Source: Internet
Author: User
Tags log4j

Configure hive to use the MySQL database

------------------------

1. Download and pressure hive.tar.gz

2. Configure Environment variables

Hive_home= ...

Path=: $HIVE _home/bin: $HIVE _home/conf


$>source/etc/environment

3. Create a configuration file

$>CD conf

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

$ CP hive-env.sh.template hive-env.sh

$ CP hive-exec-log4j.properties.template Hive-execlog4j.properties

$ CP hive-log4j.properties.template Hive-log4j.properties

4. Modify the conf/hive-env.sh configuration file

Export Hadoop_home=/soft/hadoop

Export hive_conf_dir=/soft/hive/conf

5. Modify the Conf/hive-site.xml file

Hive.metastore.warehourse.dir=/user/hive/warehouse//hdfs System

Hive.exec.scratchdir=/tmp/hive-${user.name}//hdfs system

6. Configure the use of MySQL database

0. Create a myhive database on MySQL

Create Database myhive;

1. Configure Hive-ste.xml

[Conf/hive-site.xml]

#javax. Jdo.option.ConnectionURL//The database URL

#javax. Jdo.option.ConnectionDriverName//The JDBC driver name

#javax. Jdo.option.ConnectionUserName//Database username

#javax. Jdo.option.ConnectionPassword//Database Password

<property>

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

<value>jdbc:mysql://myhost:3306/myhive?createDatabaseIfNotExist=true</value>

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

</property>

<property>

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

<value>com.mysql.jdbc.Driver</value>

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

</property>

<property>

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

<value>hive</value>

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

</property>

<property>

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

<value>hive</value>

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

</property>

7. Copy the MySQL driver to ${hive_home}\lib


This article is from the "11009607" blog, please be sure to keep this source http://11019607.blog.51cto.com/11009607/1832275

MySQL Configuration note for hive

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.