Hmaster there is no single point of issue, HBase can start multiple hmaster, with the zookeeper Master election mechanism to ensure that there is always a master running.
So here to configure HBase high availability, only need to start two hmaster, let zookeeper to choose a master acitve.
HBase configuration:
Under the $hbase_home/conf directory
1.hbase-site.xml
Export hbase_opts= "$HBASE _opts-xx:+heapdumponoutofmemoryerror-xx:+useconcmarksweepgc-xx:+cmsincrementalmode" Export JAVA_HOME=/USR/JAVA/JDK1.7.0_60 Export Hbase_manages_zk=falseexport Hadoop_home=/data/hadoop-2.6.0export Hbase_log_dir=/data/hadoop/hbase/logs
a distributed run of HBase relies on a zookeeper cluster. All nodes and clients must be able to access the zookeeper. By default, HBase manages a zookeep cluster. This cluster will start with the start of hbase. Of course, you can also manage a zookeeper cluster yourself, but you need to configure HBase. You need to change the HBASE_MANAGES_ZK to switch. This value is true by default, so that when HBase starts, it also starts zookeeper.
Let HBase use an existing Zookeep cluster that is not managed by hbase, you need to set the Hbase_manages_zk property to False
2.hbase-site.xml
<Configuration>< Property><name>Hbase.rootdir</name><value>Hdfs://appcluster/hbase</value><Description>The directory shared by Regionservers.</Description></ Property>< Property><name>Hbase.master</name><value>60000</value><!--notice here, just the port, no need to write the host name! -</ Property>< Property><name>Hbase.zookeeper.quorum</name><value>hadoop001,hadoop002,hadoop003</value></ Property>< Property><name>Hbase.zookeeper.property.clientPort</name><value>2181</value></ Property>< Property><name>Hbase.zookeeper.property.dataDir</name><value>/data/hadoop/zookeeper</value></ Property>< Property><name>hbase.cluster.distributed</name><value>True</value></ Property>< Property><name>Hbase.tmp.dir</name><value>/data/hadoop/hbase/tmp</value></ Property></Configuration>
3.regionservers
Add Regionserver's hostname
HBase Startup:
Enter the start command on the hadoop001
start-hbase.sh
JPS Visible:
Master (because Hadoop HA has been started before, so you will see many processes)
23703 NameNode23968 ResourceManager24132 DFSZKFailoverController23813 DataNode24857 HRegionServer24723 HMaster23428 QuorumPeerMain23522 JournalNode25448 Jps24070 NodeManager
Regionserver
9832 HRegionServer8923 QuorumPeerMain9379 NodeManager10495 Jps9197 DataNode9622 ResourceManager9006 JournalNode10436 NameNode9552 Dfszkfailovercontroller
Start Hmaster on a regionserver
hbase-daemon.sh Start Master
JPs
9832 HRegionServer8923 QuorumPeerMain9379 NodeManager10495 Jps9197 DataNode9622 ResourceManager9006 journalnode 10005 hmaster10436 NameNode9552 Dfszkfailovercontroller
This time you can see that the Hmaster has started.
How to distinguish which is active which is standby, look at log
In the log of HBase, you can see
2015-08-07 14:00:14,765 INFO [Hadoop002:60000.activemastermanager] Master. Activemastermanager:another Master is the active master, hadoop001,60000,1438927191790; Waiting to become the next active master
So we can tell which one is active.
HBase High Availability (HA)