1. 分发mysql-connector
添加mysql-connector-java.jar包到hive的lib目录下,并分发到每一个节点中(集群分发脚本)
[root@node01 ~]# cp /opt/software/mysql-connector-java.jar /opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/lib/hive/lib/
[root@node01 lib]# xsync mysql-connector-java.jar
2. 添加Hive服务
3. 创建metastore数据库
在所选择MetaStore的节点上,配置hive的hive-site.xml(/opt/cloudera/parcels/CDH/lib/hive/conf/hive-site.xml),添加以下配置:
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://node02.kaikeba.com:3306/metastore?createDatabaseIfNotExist=true&useSSL=false</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value