# 上传解压安装包
cd /kkb/install/
tar zxvf apache-hive-3.1.2-bin.tar.gz
mv apache-hive-3.1.2-bin hive
#解决hadoop、hive之间guava版本差异
cd /kkb/install/hive
rm -rf lib/guava-19.0.jar
cp /kkb/install/hadoop-3.1.4/share/hadoop/common/lib/guava-27.0-jre.jar ./lib/
#修改hive环境变量文件 添加Hadoop_HOME
cd /kkb/install/hive/conf/
mv hive-env.sh.template hive-env.sh
vim hive-env.sh
export HADOOP_HOME=/kkb/install/hadoop-3.1.4
export HIVE_CONF_DIR=/kkb/install/hive/conf
export HIVE_AUX_JARS_PATH=/kkb/install/hive/lib
#初始化metadata
cd /kkb/install/hive
bin/schematool -dbType derby -initSchema
#启动hive服务
bin/hive