Configuring Hbase High Availability

为了增加hbase集群的可用性,可以为hbase增加多个backup master。当master挂掉后,backup master可以自动接管整个hbase的集群。配置方式很简单,只需在$HBASE_HOME/conf下增加backup-masters文件,文件里面增加backup master的机器列表,每台机器一条记录。环境如图所示:
Configuring Hbase High Availability
1、hbase-env.sh
编辑加入以下内容:

export JAVA_HOME=/usr/java/jdk1.8.0_152
export HBASE_MANAGES_ZK=false

2、hbase-site.xml
编辑加入图中内容:
Configuring Hbase High Availability
3、创建backup-masters

[hadoop@hdp01 conf]$ cat backup-masters 
hdp03

4、创建regionservers
RegionServer是HBase集群运行在每个工作节点上的服务。它是整个HBase系统的关键所在,一方面它维护了Region的状态,提供了对于Region的管理和服务;另一方面,它与Master交互,上传Region的负载信息上传,参与Master的分布式协调管理。

[hadoop@hdp01 conf]$ vi regionservers
hdp02
hdp03
hdp04

5、复制Hbase到其他节点

[hadoop@hdp01 conf]$ for i in {2..4};do scp -r /u01/hbase hdp0$i:/u01/hbase;done

6、启动hbase

[hadoop@hdp01 conf]$ $HBASE_HOME/bin/start-hbase
[hadoop@hdp01 ~]$ jps
5633 RunJar
5075 JobHistoryServer
5252 HMaster
3686 QuorumPeerMain
4566 SecondaryNameNode
10727 Jps
4747 ResourceManager
4350 NameNode
5535 RunJar
[hadoop@hdp03 ~]$ jps
4432 HRegionServer
9442 Jps
3575 QuorumPeerMain
4104 DataNode
4522 HMaster
4238 NodeManager

可以访问http://hdp01:16010,通过图形界面查看:
Configuring Hbase High Availability
7、验证
关闭hdp01的hbase:

[hadoop@hdp01 bin]$ ./hbase-daemon.sh stop master
stopping master.
[hadoop@hdp01 bin]$ jps
5633 RunJar
5075 JobHistoryServer
3686 QuorumPeerMain
4566 SecondaryNameNode
4747 ResourceManager
11339 Jps
4350 NameNode
5535 RunJar

然后访问http://hdp03:16010进行查看:
Configuring Hbase High Availability
最后,再次启动hdp01的hbase就会变为backup了。

[hadoop@hdp01 bin]$ ./hbase-daemon.sh start master --backup

Configuring Hbase High Availability
参考文献:
1、HBase原理-RegionServer宕机数据恢复
2、HBase深入分析之RegionServer
3、HBase RegionServer详解

Exciting projects that will teach you how complex data can be exploited to gain maximum insights About This Book Architect a good HBase cluster for a very large distributed system Get to grips with the concepts of performance tuning with HBase A practical guide full of engaging recipes and attractive screenshots to enhance your system's performance Who This Book Is For This book is intended for developers and architects who want to know all about HBase at a hands-on level. This book is also for big data enthusiasts and database developers who have worked with other NoSQL databases and now want to explore HBase as another futuristic scalable database solution in the big data space. What You Will Learn Configure HBase from a high performance perspective Grab data from various RDBMS/Flat files into the HBASE systems Understand table design and perform CRUD operations Find out how the communication between the client and server happens in HBase Grasp when to use and avoid MapReduce and how to perform various tasks with it Get to know the concepts of scaling with HBase through practical examples Set up Hbase in the Cloud for a small scale environment Integrate HBase with other tools including ElasticSearch In Detail Apache HBase is a non-relational NoSQL database management system that runs on top of HDFS. It is an open source, disturbed, versioned, column-oriented store and is written in Java to provide random real-time access to big Data. We'll start off by ensuring you have a solid understanding the basics of HBase, followed by giving you a thorough explanation of architecting a HBase cluster as per our project specifications. Next, we will explore the scalable structure of tables and we will be able to communicate with the HBase client. After this, we'll show you the intricacies of MapReduce and the art of performance tuning with HBase. Following this, we'll explain the concepts pertaining to scaling with HBase. Finally, you will get an understanding of how to integrate HBase with other tools such as ElasticSearch. By the end of this book, you will have learned enough to exploit HBase for boost system performance. Style and approach This book is intended for software quality assurance/testing professionals, software project managers, or software developers with prior experience in using Selenium and Java to test web-based applications. This books also provides examples for C#, Python, and Ruby users. Table of Contents Chapter 1. Configuring HBase Chapter 2. Loading Data from Various DBs Chapter 3. Working with Large Distributed Systems Part I Chapter 4. Working with Large Distributed Systems Part II Chapter 5. Working with Scalable Structure of tables Chapter 6. HBase Clients Chapter 7. Large-Scale MapReduce Chapter 8. HBase Performance Tuning Chapter 9. Performing Advanced Tasks on HBase Chapter 10. Optimizing Hbase for Cloud Chapter 11. Case Study
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值