本篇为安装篇较简单:前提:1: 安装了hadoop-1.0.4(1.0.3也可以)正常运行2:安装了hbase-0.94.3, 正常运行接下来,安装Hive,基于已经安装好的hadoop,步骤如下:1:下载从http://hive.apache.org/下载hive-0.9.0/创建目录/hive将文件hive-0.9.0保存在/hive下2:解压缩[root@pg2 download]# cd /hive[root@pg2 hive]# lshive-0.9.0.tar.gz[root@pg2 hive]# tar xfz hive-0.9.0.tar.gz[root@pg2 hive-0.9.0]# lsbin conf docs examples lib LICENSE NOTICE README.txt RELEASE_NOTES.txt scripts src[root@pg2 hive-0.9.0]# 3:配置进入conf目录[root@pg2 hive-0.9.0]# cd conf[root@pg2 conf]# lshive-default.xml.template hive-env.sh.template hive-exec-log4j.properties.template hive-log4j.properties.template[root@pg2 conf]# 做如下配置:首先复制几个template文件[root@pg2 conf]# cp hive-default.xml.template hive-default.xml[root@pg2 conf]# cp hive-env.sh.template hive-env.sh[root@pg2 conf]# cp hive-log4j.properties.template hive-log4j.properties[root@pg2 conf]# cp hive-exec-log4j.properties.template hive-exec-log4j.properties然后配置对应的配置文件a: hive-default.xml缺省先不修改b:hive-env.sh缺省的为256M,此处暂时不调整# export HADOOP_HEAPSIZE=1024# Set HADOOP_HOME to point to a specific hadoop install directoryHADOOP_HOME=/hadoop/hadoop-1.0.4# Hive Configuration Directory can be controlled by:export HIVE_CONF_DIR=/hive/hive-0.9.0/conf4:启动进入/hive/hive-0.9.0/bin[root@pg2 conf]# cd ../bin[root@pg2 bin]# lsext hive hive-config.sh[root@pg2 bin]# ./hiveWARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.Logging initialized using configuration in file:/hive/hive-0.9.0/conf/hive-log4j.propertiesHive history file=/tmp/root/hive_job_log_root_201301032313_932376477.txthive> hive> show tables;OKTime taken: 21.874 seconds
Hive>
hive安装可能会遇到的问题
1.hive报Invalid maximum heap size: -Xmx4096m错误解决方法
MongoDB@krusiting-laptop:~/hive-0.6.0$ bin/hive
Invalid maximum heap size: -Xmx4096m
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.
解决方法:
~/hive-0.6.0/bin/ext/util$ vim execHiveCmd.sh
修改
HADOOP_HEAPSIZE=4096
为
HADOOP_HEAPSIZE=256
参考链接:http://blog.csdn.net/lifuxiangcaohui/article/details/40378689