1. Hadoop环境,参考:
http://blog.csdn.net/a237428367/article/details/50462858
2. tar XXX 你懂的
3. 添加环境变量
vi /hadoop/hive-1.2.1/bin/hive-config.sh
export JAVA_HOME=/usr/java/jdk1.8.0_65
export HADOOP_HOME=/hadoop/hadoop-2.6.3
export HIVE_HOME=/hadoop/hive-1.2.1
4.配置 hive-site.xml
mkdir /hadoop/hive-1.2.1/tmp
cp /hadoop/hive-1.2.1/conf/hive-default.xml.template /hadoop/hive-1.2.1/conf/hive-site.xml
vi /hadoop/hive-1.2.1/conf/hive-site.xml
<property>
<name>hive.querylog.location</name>
<value>/hadoop/hive-1.2.1/tmp</value>
<description>Location of Hive run time structured log file</description>
</property>
<property>
<name>hive.exec.local.scratchdir</name>
<value>/hadoop/hive-1.2.1/tmp</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/hadoop/hive-1.2.1/tmp</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>
5.配置 hive-log4j.properties
cp /hadoop/hive-1.2.1/conf/hive-log4j.properties.template /hadoop/hive-1.2.1/conf/hive-log4j.properties
vi /hadoop/hive-1.2.1/conf/hive-log4j.properties
#log4j.appender.EventCounter=org.apache.hadoop.hive.shims.HiveEventCounter
log4j.appender.EventCounter=org.apache.hadoop.log.metrics.EventCounter
6.将 /hadoop/hive-1.2.1/lib/ 下的 jline2.12.jar 替换 /hadoop/hadoop-2.6.3/share/hadoop/yarn/lib/ 下的 jline0.0.94.jar
7.启动Hadoop,启动Hive.
cd /hadoop/hive-1.2.1/bin
./hive