Hbase安装

hadoop 438 浏览

hbase

环境

操作系统:Centos 6.4

jdk: 1.7.79

hadoop: 2.6.4

hbase: 0.99.2

三台主机:mini01(namenode+hbase master) +mini02(datanode + hbase regionserver) +mini03(datanode + hbase regionserver)

hbase


部署

一、解压hadoop-2.6.4.tar.gz

tar -zxvf hbase-0.99.2-bin.tar.gz

环境变量配置

vi /etc/profile
export HBASE_HOME=/home/app/hbase-0.99.2
export PATH=$HBASE_HOME/bin:PATH
source /etc/profile

环境变量配置三台机器全部设置


hbase配置文件修改

修改三个文件:hbase-env.sh、hbase-site.xml、regionservers

  1. 打开hbase-env.sh,修改jdk环境变量以及zookeeper配置
export JAVA_HOME=/usr/local/jdk1.7.0_79/
export HBASE_MANAGES_ZK=false

HBASE_MANAGES_ZK如果为true则使用zk单机版,false表示用户自行配置(hbase-site.xml中) 2)打开hbase-site.xml

<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://mini01:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.master</name>
<value>mini01:6000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>mini01,mini02,mini03</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/app/zookeeper-3.4.6/data</value>
</property>
</configuration>

3)打开regionservers

mini02
mini03

4)将以上文件全部拷贝到其他两台机器,保证三台机器(mini01,mini02,mini03)配置一致

scp -r conf root@mini02:/home/app/hbase-0.99.2/
scp -r conf root@mini03:/home/app/hbase-0.99.2/

hbase启动

启动

[root@mini01 bin]# start-hbase.sh 
starting master, logging to /home/app/hbase-0.99.2/logs/hbase-root-master-mini01.out
mini02: starting regionserver, logging to /home/app/hbase-0.99.2/bin/../logs/hbase-root-regionserver-mini02.out
mini03: starting regionserver, logging to /home/app/hbase-0.99.2/bin/../logs/hbase-root-regionserver-mini03.out
[root@mini01 bin]#

hbase shell

[root@mini01 bin]# hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.99.2, r6a0c4f3bae1e92109393423472bd84097f096e75, Tue Dec  2 20:47:47 PST 2014
 
hbase(main):001:0> 

说明已经成功 以上

关注微信公众号 "Kooola大数据" :) 聊人生 | 聊技术