1.下载解压,tar -zxvf /opt/tools/hive-1.1.0-cdh5.7.6.tar.gz -C /opt/cdh-5.7.6/
2.修改配置文件,在conf文件目录下,去掉template启用hive-env.sh
mv hive-env.sh.template hive-env.sh
# Set HADOOP_HOME to point to a specific hadoop install directory
HADOOP_HOME=/opt/modules/hadoop-2.6.0-cdh5.7.6
# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=/opt/cdh-5.7.6/hive-1.1.0-cdh5.7.6/conf
3.在/etc/profile中添加配置全局变量:
#Hive
export Hive_HOME=/opt/cdh-5.7.6/hive-1.1.0-cdh5.7.6
export PATH=$Hive_HOME/bin:$PATH
4.创建目录和赋予权限:
bin/hdfs dfs -mkdir /tmp
bin/hdfs dfs -mkdir -p /user/hive/warehouse
bin/hdfs dfs -chmod g+w /tmp
bin/hdfs dfs -chmod g+w /user/hive/warehouse
5.启动,bin/hive
时间: 2024-10-30 08:34:33