概述
在网上看到很多博客都说要配置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
最后
以上就是勤劳麦片为你收集整理的Hbase 1.2 HA配置的全部内容,希望文章能够帮你解决Hbase 1.2 HA配置所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复