一、下载hive1.2.1
二、上传至linux并解压
[root@master apps]# tar -zxvf apache-hive-1.2.1-bin.tar.gz
[root@master apps]# cd hive-1.2.1/
[root@master hive-1.2.1]# ll
总用量 464
drwxr-xr-x. 4 root root 156 7月 5 18:29 bin
drwxr-xr-x. 2 root root 212 7月 5 18:28 conf
drwxr-xr-x. 4 root root 34 7月 5 18:28 examples
drwxr-xr-x. 7 root root 68 7月 5 18:28 hcatalog
drwxr-xr-x. 4 root root 8192 7月 5 18:28 lib
-rw-rw-r--. 1 root root 24754 4月 30 2015 LICENSE
-rw-rw-r--. 1 root root 397 6月 19 2015 NOTICE
-rw-rw-r--. 1 root root 4366 6月 19 2015 README.txt
-rw-rw-r--. 1 root root 421129 6月 19 2015 RELEASE_NOTES.txt
drwxr-xr-x. 3 root root 23 7月 5 18:28 scripts
[root@master hive-1.2.1]#
三、解压后即可使用
1、启动hdfs
2、启动yarn
3、启动hive(正常启动)
[root@master hive-1.2.1]# bin/hive
Logging initialized using configuration in jar:file:/apps/hive-1.2.1/lib/hive-common-1.2.1.jar!/hive-log4j.properties
hive>
可能会出现的错误
jar包版本冲突
解决办法
[root@master /]# cd /apps/hive-1.2.1/lib/
[root@master lib]# ll
总用量 95280
查找 jline-2.12.jar
-rw-rw-r--. 1 root root 213854 4月 30 2015 jline-2.12.jar
然后进入(/apps/hadoop-2.8.0/share/hadoop/yarn/lib)
[root@master lib]# cd /apps/hadoop-2.8.0/share/hadoop/yarn/lib
在这个目录下有 jline.jar包与(/apps/hive-1.2.1/lib/)下的jline-2.12.jar版本不一致。
将其替换为两者最高版本。
然后继续启动
[root@master lib]# cd /apps/hive-1.2.1/
[root@master hive-1.2.1]# bin/hive
Logging initialized using configuration in jar:file:/apps/hive-1.2.1/lib/hive-common-1.2.1.jar!/hive-log4j.properties
hive>
安装成功!!!!!!