Configure HIVE+MYSQLT

Source: Internet
Author: User
Keywords Nbsp; name java value

Download: Configure HIVE+MYSQLT

Configuration file:

Introduction to Hive Configuration files

hive-site.xml&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Hive profile

hive-env.sh Hive Running Environment file

hive-default.xml.template Default Template

hive-env.sh.template hive-env.sh Default configuration

hive-exec-log4j.properties.template exec default configuration

hive-log4j.properties.template Log Default configuration

Hive-site.xml

< property>

<name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost:3306/hive? Createdata baseifnotexist=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>root</value>

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

</property>

<property>

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

<value>test</value>

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

</property>

hive-env.sh

• Configure hive configuration file path

Export hive_conf_dir= Your path

• Configure the installation path for Hadoop

Hadoop_home=your HADOOP Home

A. Configuring hive-conf.sh
In the "/home/hadoop/hive-0.9.0/bin" directory, "hive-conf.sh" and add the following inside.

#set Java Environnement

hive_home=/home/hadoop/hive-0.9.0

hadoop_home=/home/hadoop/hadoop-1.1.1

java_home=/home/hadoop/jdk1.7.0

Path= $JAVA _home/bin: $HIVE _home/bin: $HADOOP _home/bin: $PATH

Classpath=.: $JAVA _home/lib/dt.jar: $HIVE _home/lib: $JAVA _home/lib/tools.jar

Export Hadoop_home

Export Java_home

Export Hive_home

Export PATH

Export CLASSPATH

/home/hadoop/hive-0.9.0/conf/hive-env.sh
Add the following in the above three files:

#set Java Environnement

hive_home=/home/hadoop/hive-0.9.0

hadoop_home=/home/hadoop/hadoop-1.1.1

java_home=/home/hadoop/jdk1.7.0

Path= $JAVA _home/bin: $HIVE _home/bin: $HADOOP _home/bin: $PATH

Classpath=.: $JAVA _home/lib/dt.jar: $HIVE _home/lib: $JAVA _home/lib/tools.jar

Export Hadoop_home

Export Java_home

Export Hive_home

Export PATH

Export CLASSPATH

1. Add users specifically for hive in MySQL

mysql> CREATE USER ' hive ' @ '% ' identified by ' hivepasswd ';

Mysql> grant all privileges in *.* to ' hive ' @ '% ' with GRANT OPTION;

2. Modify configuration file Conf/hive-default.xml

1.<property>

2. <name>hive.metastore.local</name>

3. <value>true</value> 4. <description>controls whether to connect to-remove Metastore server or open a new Metastore server in Hive Client jvm< /description> 5.</property>

6.<property>

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

8. <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value> 9. <DESCRIPTION>JDBC connect string for a JDBC metastore</description> 10.</property>

11.<property>

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

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

<description>driver class name for a JDBC metastore</description> 15.</property>

16.<property>

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

<value>hive</value>

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

20.</property>

21.<property>

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

23.&nb

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.