你可以下载一个已打包好的hive稳定版,也可以下载源码自己build一个版本。
安装需要 java 1.6,java 1.7或更高版本。 Hadoop 2.x或更高, 1.x. Hive 0.13 版本也支持 0.20.x, 0.23.x Linux,mac,windows操作系统。以下内容适用于linux系统。 安装打包好的hive
需要先到apache下载已打包好的hive镜像,然后解压开该文件 $ tar -xzvf hive-x.y.z.tar.gz设置hive环境变量 $ cd hive-x.y.z$ export HIVE_HOME={{pwd}}设置hive运行路径 $ export PATH=$HIVE_HOME/bin:$PATH编译Hive源码
下载hive源码
此处使用maven编译,需要下载安装maven。
以Hive 0.13版为例 编译hive 0.13源码基于hadoop 0.23或更高版本
$cdhive$mvncleaninstall-Phadoop-2,dist$cdpackaging/target/apache-hive-{version}-SNAPSHOT-bin/apache-hive-{version}-SNAPSHOT-bin$lsLICENSENOTICEREADME.txtRELEASE_NOTES.txtbin/(alltheshellscripts)lib/(requiredjarfiles)conf/(configurationfiles)examples/(sampleinputandqueryfiles)hcatalog/(hcataloginstallation)scripts/(upgradescriptsforhive-metastore) 编译hive 基于hadoop 0.20
$cdhive$antcleanpackage$cdbuild/dist#lsLICENSENOTICEREADME.txtRELEASE_NOTES.txtbin/(alltheshellscripts)lib/(requiredjarfiles)conf/(configurationfiles)examples/(sampleinputandqueryfiles)hcatalog/(hcataloginstallation)scripts/(upgradescriptsforhive-metastore) 运行hive
Hive运行依赖于hadoop,在运行hadoop之前必需先配置好hadoopHome。 export HADOOP_HOME=
在运行hive之前设置HiveHome。 $ export HIVE_HOME=