Hbase 1.2 HA配置

在网上看到很多博客都说要配置backup-masters,实际上是不用配置的。

1、配置Hbase集群使用自带的zookeeper还是另外的zookeeper集群,我使用的是自己单独搭建的zookeeper集群,配置如下

hbase-env.sh
# Tell HBase whether it should manage it's own instance of Zookeeper or not.
export HBASE_MANAGES_ZK=false

2、配置Zookeeper信息

vim ${HBASE_CONF_DIR}/hbase-site.xml
<property>
          <name>hbase.zookeeper.quorum</name>
          <value>SZD-L0090345,SZD-L0090346,SZD-L0090343</value>
          <description>
                Comma separated list of servers in the ZooKeeper ensemble (This config. should have been named hbase.zookeeper.ensemble).
          For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com". By default this is set to localhost for local and pseudo-distributed modes 
          of operation. For a fully-distributed setup, this should be set to a full list of ZooKeeper ensemble servers. If HBASE_MANAGES_ZK is set in hbase-env.sh 
          this is the list of servers which hbase will start/stop ZooKeeper on as part of cluster start/stop.  Client-side, we will take this list of
          ensemble members and put it together with the hbase.zookeeper.clientPort config. and pass it into zookeeper constructor as the connectString parameter.
          </description>
</property>
<property>
         <name>hbase.zookeeper.property.clientPort</name>
         <value>2181</value>
         <description>Property from ZooKeeper's config zoo.cfg. The port at which the clients will connect.</description>
</property>

3、在一台master上启动集群 start-hbase.sh,这个过程会启动本机的hmaster和集群的regionserver,并且将集群的状态信息更新到zookeeper目录。

4、在zookeeper Dump页面查看集群信息,地址http://master_ip:60010/zk.jsp,可以看到集群中的active master、backup master、regionserver等信息。

5、测试HA,在另外一台或多台master上启动/停止单个hmaster服务,在http://master_ip:60010/zk.jsp界面观察集群信息变化。

启动单个hmaster服务:hbase-daemon.sh start hmaster

停止单个hmaster服务:hbase-daemon.sh stop hmaster


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值