-
下载 & 解压
-
配置hive-env.sh
$ cd conf
$ cp hive-env.sh.template hive-env.sh
$ vim hive-env.sh
"配置HADOOP_HOME
HADOP_HOME=${HADOOP_HOME}
- 配置hive-site.xml
$ cp hive-default.xml.template hive-site.xml
$ vim hive-site.xml
<!-- mysql驱动 --!>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<!-- mysql用户 --!>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
<description>Username to use against metastore database</description>
</property>
<!-- mysql密码 --!>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
<description>password to use against metastore database</description>
</property>
<!-- mysql URL --!>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:msyql://localhost:3306/hive?createDatabaseIfnotExist=true</value>
</property>
<!-- 全部替换绝对路径--!>
<name>hive.querylog.location</name>
<name>hive.exec.local.scratchdir</name>
<name>hive.downloaded.resources.dir</name>
- 下载mysql二进制驱动
https://dev.mysql.com/downloads/connector/j/5.1.html
$ 解压将 ****.jar放入hive/lib目录
- 创建数据库
mysql> create database hive; // 数据库名与hive-sites中 <name>javax.jdo.option.ConnectionURL</name>
数据库名一致
- 初始化 同步元数据
$ schematool -dbType mysql -initSchema