HBase 集群配置
来源:互联网 发布:apache sh commands 编辑:程序博客网 时间:2024/05/16 03:27
本文环境与上一讲--完全分布式Hadoop集群配置一致。OS是Ubuntu Server 10.04,HBase版本是0.20.6。
HRegionServer&HQuorumPeer:dm1,IP:192.168.0.17;
HRegionServer&HQuorumPeer:dm2,IP:192.168.0.18;
HRegionServer&HQuorumPeer:dm3,IP:192.168.0.9;
HMaster&NameNode:dm4,IP:192.168.0.10;(SecondaryNameNode)
虽然secondarynamenode和namenode放在同一台机器上比较不合理。但是考虑到这只是个实验的小集群(硬件环境不允许),再者有xenserver的时序快照的保障,就不将SecondaryNameNode部署在其他机器上了。
主要的还是配置工作,依然将HBase放在/home下,编辑/home/hbase/conf下的hbase-site.xml,hbase-default.xml,hbase-env.sh 这几个文件。具体步骤如下:
一.编辑所有机器上的hbase-site文件,命令如下:
1
vi /home/hbase/conf/hbase-site.xml
编辑文件如下列代码所示。注意项有2:
1.其中首先需要注意hdfs://dm4:9000/hbase这里,必须与你的Hadoop集群的core-site.xml文件配置保持完全一致才行,如果你Hadoop的hdfs使用了其它端口,请在这里也修改。再者就是Hbase该项并不识别机器IP,只能使用机器hostname才可行,即若使用dm4的IP(192.168.0.10)是会抛出java错误,至于具体的错误由于时间久远,我就懒得去翻查那大量的log了。
2.hbase.zookeeper.quorum 的个数必须是奇数。
01
<configuration>
02
<property>
03
<name>hbase.rootdir</name>
04
<value>hdfs:
//dm4:9000/hbase</value>
05
</property>
06
<property>
07
<name>hbase.cluster.distributed</name>
08
<value>
true
</value>
09
</property>
10
<property>
11
<name>hbase.master</name>
12
<value>
192.168
.
0.10
:
60000
</value>
13
</property>
14
<property>
15
<name>hbase.zookeeper.quorum</name>
16
<value>
192.168
.
0.9
,
192.168
.
0.17
,
192.168
.
0.18
</value>
17
</property>
18
</configuration>
二.编辑所有机器的 hbase-default.xml,命令如下:
1
vi /home/hbase/conf/hbase-
default
.xml
只需修改前面hbase.rootdir 与hbase.cluster.distributed 这两项。修改如下面代码所示:
HBase的数据重启就被擦掉,如果需要数据持久化的,就修改rootdir项,写定你的HDFS目录。
至于default内其它的项的含义与修改,再请参考官网。
01
<configuration>
02
<property>
03
<name>hbase.rootdir</name>
04
<value>hdfs:
//dm4:9000/hbase_rootdir</value>
05
<description>The directory shared by region servers.
06
Should be fully-qualified to include the filesystem to use.
07
E.g: hdfs:
//NAMENODE_SERVER:PORT/HBASE_ROOTDIR
08
</description>
09
</property>
10
<property>
11
<name>hbase.master.port</name>
12
<value>
60000
</value>
13
<description>The port master should bind to.</description>
14
</property>
15
<property>
16
<name>hbase.cluster.distributed</name>
17
<value>
true
</value>
18
<description>The mode the cluster will be in. Possible values are
19
false
: standalone and pseudo-distributed setups with managed Zookeeper
20
true
: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh)
21
</description>
22
</property>
三. 编辑所有机器的hbase-env.sh,命令如下:
1
vi /home/hbase/conf/hbase-env.sh
修改代码如下所示:
1
export HBASE_OPTS="$HBASE_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkS
2
weepGC -XX:+CMSIncrementalMode"
3
export JAVA_HOME=/usr/lib/jvm/java-
6
-sun-
1.6
.
0.22
4
export HBASE_MANAGES_ZK=
true
5
export HBASE_HOME=/home/hbase
6
export HADOOP_HOME=/home/hadoop
四.编辑所有机器的HBase的HMasters和HRegionServers。修改/home/hbase/conf 文件夹下的regionservers文
件。添加DataNode的IP即可。代码如下:
1
192.168
.
0.9
2
192.168
.
0.17
3
192.168
.
0.18
行文至此,HBase集群的配置已然完成。以下便是启动和测试。
五.启动.测试HBase数据库。
在HMaster即Namenode (dm4)启动HBase数据库(Hadoop集群必须已经启动)。 启动命令:
1
/home/hbase/bin/start-hbase.sh
Hbase启动如下图所示:
最好输入JPS命令测试一下你当前Hbase集群进程。如下图:
然后输入如下命令进入hbase的命令行管理界面:
1
/home/hbase/bin/hbase shell
在hbase shell下 输入list,如下所示,列举你当前数据库的名称,如下图所示。如果你的Hbase没配置成功会抛出java错误。
我们也可以通过WEB页面来管理查看HBase数据库。
HMaster:http://192.168.0.10:60010/master.jsp
我的HBase数据库截图:
- hbase集群配置
- HBase 集群配置
- Hbase集群配置
- Hbase集群配置
- Hbase集群安装配置
- HBase集群安装配置
- HBase集群配置
- Hbase集群配置
- Hbase集群安装配置
- hbase集群安装配置
- Hbase集群安装配置
- hbase集群的安装、配置
- Hadoop+ZooKeeper+HBase集群配置
- HBase数据集群配置安装
- HBase集群搭建+HA配置
- Hbase分布式集群安装配置
- HBase集群配置之Zookeeper安装配置
- HBase-0.90.4集群安装配置
- 数据连接池的基本实现
- 浅谈装饰模式和覆盖
- 语不惊人死不休(59)因果
- 是毁灭还是重生——从浏览器大战看未来软件发展
- vxworks外部中断处理
- HBase 集群配置
- 三星P1000中出现的怪现象
- Performance test for defferent encoding way in UltraVNC
- Error: no `server' JVM at `C:\Program Files\Java\jre6\bin\server\jvm.dll'.
- 一步一步写算法(之 可变参数)
- 新版linux系统设备架构中关于电源管理方式的变更
- 三思
- document.all用法
- struts2中配置普通的servlet引发的思考