Hive配置MySQL
(1)上传MySQL的驱动到lib文件夹下
(2)在conf文件夹下创建和编辑hive-site.xml文件
Master

Salve
<?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>/usr/local/hive/warehouse</value>
</property>
<!-- 后续的版本都废掉hive.metastore.local属性 -->
<property>
<name>hive.metastore.local</name>
<value>false</value>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://hadoop1:9083</value>
</property>
</configuration>
(3)重启HDFS集群


(4)启动Hive

(5)启动MySQL,查看数据库

本文详细介绍如何将Hive与MySQL进行配置连接,包括上传MySQL驱动、编辑hive-site.xml文件、重启HDFS集群及启动Hive和MySQL的步骤。通过本教程,读者可以学会在Hadoop环境下使用MySQL作为Hive元数据存储。

1593

被折叠的 条评论
为什么被折叠?



