[grid@gc conf]$ vi hbase-site.xml
# 添加如下内容
<property>
<name>hbase.rootdir</name> #设置hbase数据库存放数据的目录
<value>hdfs://gc:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name> #打开hbase分布模式
<value>true</value>
</property>
<property>
<name>hbase.master</name> #指定hbase集群主控节点
<value>gc:60000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>gc,rac1,rac2</value> #指定zookeeper集群节点名,因为是由zookeeper表决算法决定的
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name> #指zookeeper集群data目录
<value>/home/grid/hbase-0.90.5/zookeeper</value>
</property>
6. 编辑regionservers文件
[grid@gc conf]$ cat regionservers
# 把localhost改为如下
rac1
rac2
7. 将修改的hbase目录同步其它节点
--分别同步到rac1,rac2两节点
[grid@gc ~]$ scp -r hbase-0.90.5 rac1:/home/grid/
[grid@gc ~]$ scp -r hbase-0.90.5 rac2:/home/grid/
8. 启动/关闭Hbase数据库集群
--启动hbase之前必需检查Hadoop是否已经启动
[grid@gc ~]$ hadoop-0.20.2/bin/hadoop dfsadmin -report
Configured Capacity: 45702094848 (42.56 GB)
Present Capacity: 3562618880 (3.32 GB)
DFS Remaining: 3562348544 (3.32 GB)
DFS Used: 270336 (264 KB)
DFS Used%: 0.01%
Under replicated blocks: 4
Blocks with corrupt replicas: 0
Missing blocks: 0
-------------------------------------------------
Datanodes available: 2 (2 total, 0 dead)
Name: 192.168.2.101:50010
Decommission Status : Normal
Configured Capacity: 22851047424 (21.28 GB)
DFS Used: 135168 (132 KB)
Non DFS Used: 20131606528 (18.75 GB)
DFS Remaining: 2719305728(2.53 GB)
DFS Used%: 0%
DFS Remaining%: 11.9%
Last contact: Tue Dec 25 09:40:14 CST 2012
Name: 192.168.2.102:50010
Decommission Status : Normal
Configured Capacity: 22851047424 (21.28 GB)
DFS Used: 135168 (132 KB)
Non DFS Used: 22007869440 (20.5 GB)
DFS Remaining: 843042816(803.99 MB)
DFS Used%: 0%
DFS Remaining%: 3.69%
Last contact: Tue Dec 25 09:40:13 CST 2012