Hive chapter of big data tools and complete integration of MySQL Tutorial

I. Introduction

  Hive metadata stored in the database can be placed in RDBMS, Hive herein to integrate with the target MySQL database, a detailed description of the integrated process Hive with MySQL.

Second, install the driver

  MySQL latest version of Java drivers: mysql-connector-java-5.1.28-bin.jar, after downloading a copy to: Hive / Lib directory.

Third, the installation MySQL

  Version 3.1

  RHEL5+mysql-5.5.35-1.i386.rpm

  3.2 order  

  MySQL-shared-compat-5.5.35-1.rhel15.i386.rpm

      MySQL-server-5.5.35-1.rhel5.i386.rpm

      MySQL-client-5.5.35-1.rhel5.i386.rpm

Fourth, the configuration file

  Hive modify profile Hive-site.xml, the modified results are as follows:  

Copy the code

 1 <property>
 2   <name>javax.jdo.option.ConnectionURL</name>
 3   <value>jdbc:mysql://localhost:3306/hivedb?characterEncoding=UTF-8</value>
 4   <description>JDBC connect string for a JDBC metastore</description>
 5 </property>
 6 
 7 <property>
 8   <name>javax.jdo.option.ConnectionDriverName</name>
 9   <value>com.mysql.jdbc.Driver</value>
10   <description>Driver class name for a JDBC metastore</description>
11 </property>
12 
13 <property>
14   <name>javax.jdo.PersistenceManagerFactoryClass</name>
15   <value>org.datanucleus.jdo.JDOPersistenceManagerFactory</value>
16   <description>class implementing the jdo persistence</description>
17 </property>
18 
19 <property>
20   <name>javax.jdo.option.DetachAllOnCommit</name>
21   <value>true</value>
22   <description>detaches all objects from session so that they can be used after transaction is committed</description>
23 </property>
24 
25 <property>
26   <name>javax.jdo.option.NonTransactionalRead</name>
27   <value>true</value>
28   <description>reads outside of transactions</description>
29 </property>
30 
31 <property>
32   <name>javax.jdo.option.ConnectionUserName</name>
33   <value>root</value>
34   <description>username to use against metastore database</description>
35 </property>
36 
37 <property>
38   <name>javax.jdo.option.ConnectionPassword</name>
39   <value>root</value>
40   <description>password to use against metastore database</description>
41 </property>

Copy the code

Fifth, the results show

  After installation is complete, by accessing the mysql client can be used to verify that the installation was successful. Note the difference between the ordinary and create a table relational data.

  mysql>show tables;

Copy the code

 1 +----------------+
 2 | Tables_in_hive |
 3 +----------------+
 4 | BUCKETING_COLS |
 5 | COLUMNS |
 6 | DBS |
 7 | PARTITION_KEYS |
 8 | SDS |
 9 | SD_PARAMS |
10 | SEQUENCE_TABLE |
11 | SERDES |
12 | SERDE_PARAMS |
13 | SORT_COLS |
14 | TABLE_PARAMS |
15 | TBLS |
16 +----------------+

Copy the code

 VI Notes

  It has been looking for me alone consulted this question: Why can not I use the MySQL database in which the Hive? This is a place where there should be noted that the concept of Hive database is different from the RDBMS database, specify the MySQL database is based on the configuration file, if you are interested in big data development, want the system to learn big data , you can join big data technology learning exchange buttoned Junyang: 522 189 307 , welcome additions, but understand the course descriptions Hive database namespace is just a number, similar to the concept of grouping. hive in the database can use the MySQL database, DBS view through Select * from.

 

Published 138 original articles · won praise 0 · Views 7731

Guess you like

Origin blog.csdn.net/mnbvxiaoxin/article/details/104300717