1.编辑 /etc/profile文件
#set java environment
JAVA_HOME=/usr/local/jdk1.7.0_80
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
HADOOP_HOME=/usr/local/hadoop
ZK_HOME=/usr/local/zookeeper-3.4.9
HIVE_HOME=/usr/local/hive/
PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$ZK_HOME/bin:$HIVE_HOME/bin:
2.使环境变量生效
source /etc/profile
3.修改hive配置文件
cp hive-env.sh.template hive-env.sh
cp hive-default.xml.template hive-site.xml
4.修改配置文件
4.1修改hive-site.xml
<configuration>
<!-- WARNING!!! This file is auto generated for documentation purposes ONLY! -->
<!-- WARNING!!! Any changes you make to this file will be ignored by Hive. -->
<!-- WARNING!!! You must make your changes in hive-site.xml instead. -->