1.安装包下载
2.上传安装包以及mysql驱动包
scp Downloads/apache-hive-2.3.7-bin.tar.gz root@hadoop003:/root/
scp Downloads/mysql-connector-java-5.1.47.jar root@hadoop003:/root/
3.解压安装包
[root@hadoop003 ~]# tar -zxvf apache-hive-2.3.7-bin.tar.gz -C /usr/local/cluster/
[root@hadoop003 ~]# chown hadoop:hadoop -R /usr/local/cluster/apache-hive-2.3.7-bin/
[root@hadoop003 lib]# mv ~/mysql-connector-java-5.1.47.jar /usr/local/cluster/apache-hive-2.3.7-bin/lib/
[root@hadoop003 lib]# chown hadoop:hadoop mysql-connector-java-5.1.47.jar
4.增加hive-site.xml
# vim hive-site.xml
javax.jdo.option.ConnectionURL
jdbc:mysql://hadoop002:3306/hive_metastore?createDatabaseIfNotExist=true
JDBC connect string for a JDBC metastore
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
Driver class name for a JDBC metastore
javax.jdo.option.ConnectionUserName
root
username to use against metastore database
javax.jdo.option.ConnectionPassword
KoiioK12#
password to use against metastore database
5.配置hive_home
vim /etc/profile
export HIVE_HOME=/usr/local/cluster/apache-hive-2.3.7-bin
export PATH=$PATH:$HIVE_HOME/bin
6.初始化元数据库
[hadoop@hadoop003 ~]$ schematool -dbType mysql -initSchema
7.启动hive客户端
hive
#创建测试库
hive> create database test;
8.界面查看hdfs文件