分享

Hive安装指导

pig2 2014-4-14 14:58:04 发表于 安装配置 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 22 87550
本帖最后由 pig2 于 2014-4-14 15:00 编辑
本篇为安装篇较简单:
这里关键是配置文件的配置。


前提:
1: 安装了hadoop-1.0.4正常运行
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]# ls
hive-0.9.0.tar.gz
[root@pg2 hive]# tar xfz hive-0.9.0.tar.gz

[root@pg2 hive-0.9.0]# ls
bin  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]# ls
hive-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 directory
HADOOP_HOME=/hadoop/hadoop-1.0.4

# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=/hive/hive-0.9.0/conf


4:启动
进入/hive/hive-0.9.0/bin
[root@pg2 conf]# cd ../bin
[root@pg2 bin]# ls
ext  hive  hive-config.sh
[root@pg2 bin]# ./hive
WARNING: 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.properties
Hive history file=/tmp/root/hive_job_log_root_201301032313_932376477.txt
hive>
hive> show tables;
OK
Time taken: 21.874 seconds
hive>

本帖被以下淘专辑推荐:

已有(23)人评论

跳转到指定楼层
pig2 发表于 2014-4-14 15:02:14
顺便补充一个问题:
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

回复

使用道具 举报

mjjian0 发表于 2014-5-8 22:06:59
hive的日志怎么配置啊
回复

使用道具 举报

pride1000 发表于 2014-5-16 14:53:49
我还是先把HADOOP安装好再来找你!
回复

使用道具 举报

小鱼 发表于 2014-8-10 16:25:00
为什么我启动hive提示Missing Hive Execution Jar: /usr/local/hive/lib/hive-exec-*.jar
回复

使用道具 举报

admin 发表于 2014-8-10 21:59:28
小鱼 发表于 2014-8-10 16:25
为什么我启动hive提示Missing Hive Execution Jar: /usr/local/hive/lib/hive-exec-*.jar
启动服务端了吗?
参考这个试试
hbase0.96与hive0.12整合高可靠文档及问题总结

回复

使用道具 举报

小鱼 发表于 2014-8-11 18:35:38
admin 发表于 2014-8-10 21:59
启动服务端了吗?
参考这个试试
hbase0.96与hive0.12整合高可靠文档及问题总结

你说的服务端是指hadoop吗?还是其他的?

回复

使用道具 举报

pig2 发表于 2014-8-12 00:26:12
小鱼 发表于 2014-8-11 18:35
你说的服务端是指hadoop吗?还是其他的?
hive  --service metastore
回复

使用道具 举报

aishangzailu 发表于 2014-8-18 20:32:53
好资料,学习了。
回复

使用道具 举报

hery 发表于 2014-9-30 13:53:25
讲的比较详细
回复

使用道具 举报

123下一页
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条