Posted on 2014-06-04 22:00
tangtb 阅读(12274)
评论(0) 编辑 收藏 所属分类:
Hadoop 、
HBase
前置条件
成功安装配置Hadoop集群
Hadoop version support matrix

S = supported and tested, |
X = not supported, |
NT = it should run, but not tested enough. |
下载HBase
Hadoop使用的1.1.2,根据上表,可以下载HBase-0.94.x或者HBase-0.96.0,这里下载的是HBase-0.94.14
解压tar -zxf hbase-0.94.14.tar.gz

配置环境变量
vim .bashrc,并立即生效source .bashrc(完全分布式每个节点都需要配置)

编辑 hbase-env.sh修改HBASE_CLASSPATH环境变量

需要配置为Hadoop的conf目录
配置HBase使用自带的Zookeeper, 编辑 hbase-env.sh去掉HBASE_MANAGES_ZK环境变量注释,如下图所示:

覆盖HBase中hadoop核心jar包
[hadoop@appserver ~]$ cd hbase-0.94.14/lib/
[hadoop@appserver ~]$ mv hadoop-core-1.0.4.jar hadoop-core-1.0.4.jar.bak
[hadoop@appserver ~]$ cp ~/hadoop-1.1.2/hadoop-core-1.1.2.jar ~/hbase-0.94.14/lib/

设置HBase的数据存储目录和运行模式,编辑hbase-0.94.14/conf/hbase-site.xml

HBase的数据存储目录hbase.rootdir=Hadoop的core-site.xml中的fs.default.name属性值+目录名称
hbase.cluster.distributed配置true即为分布式模式,但实际实验环境只有一个节点(伪分布式)
完全分布式配置

配置conf目录下的regionservers,添加Datanode节点

复制Hbase到tangtb-PC节点(本例只有两个节点)
scp -r ~/hbase-0.94.14 tangtb-PC:/home/hadoop/
启动Hadoop和HBase
启动Hadoop集群,并查看各节点进程


启动HBase,并查看各节点进程


启动过程遇到的问题

上述错误会导致HRegionServer进程无法启动或启动后自动退出。
引起上述问题的原因是两个节点服务器的时间不一致,使用date –s 命令将节点时间设置为一致,重新启动HBase即可解决问题。
进行数据操作
使用hbase shell命令进入HBase进入命令行
Web监控页面
http://10.120.10.11:60010

