Hive metadata architecture (Metastore) is an important component, save the Hive information about databases, tables, storage, partitions. Metadata consists of two aspects: one is a meta-database, the most common is the use of MySQL; on the other hand is a metadata service, shared with other query engine, such as such as Presto or Impala.
Hive Metabase
Hive supports two types of metadata database:
- Local or embedded metadata database: Derby
- Remote meta-database: MySQL
Description: embedded metadata database mainly for unit testing, and can only have a process to connect, so the production environment is not recommended. In fact, the most used online is to use MySQL as meta-database remotely.
(1) Configuration Hive metabase
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://master:3306/hive?characterEncoding=UTF-8</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>mysql</value>
</property>
</configuration>
Hive Metastore
Description Table (3) metabase
Hive Metastore Tables
Hive metadata service
Although the Hive metadata service also supports two ways, but the production environment uses a MySQL database as the yuan, so here only to configure and start the remote service.
(1) Configuration Hive metadata service. Want the system to learn big data , you can join the big data exchange technology to learn buttoned Junyang: 522 189 307
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
</property>
<property>
<name>hive.server2.thrift.port</name>
<value>10000</value>
</property>
<property>
<name>hive.server2.thrift.bind.host</name>
<value>0.0.0.0</value>
</property>
</configuration>
(2) Start Hive metadata service
hive --service hivestore &