Hmaster configuration for Hbase

Compared with the HA of Hadoop's NameNode and ResourceManager, Hbase's Hmaster configuration HA is relatively simple, and almost no configuration is required:


Xml code copy code  Favorite code
  1. <configuration>  
  2.   <property>  
  3.       <name>hbase.rootdir</name>  
  4.       < value > hdfs://ns1/hbase </ value > <!--This must be the same as the configuration in core-site.xml-->  
  5.   </property>  
  6.   <!-- Enable distributed mode -->  
  7.   <property>  
  8.   <name>hbase.cluster.distributed</name>  
  9.    <value>true</value>  
  10.   </property>  
  11.  <property>  
  12.         <name>hbase.zookeeper.property.clientPort</name>  
  13.         <value>2181</value>  
  14.     </property>  
  15.   <!-- This is right, only configure the port, in order to configure multiple HMaster -->  
  16.    <property>  
  17.    <name>hbase.master</name>  
  18.    <value>60000</value>  
  19.    </property>  
  20.      <property>  
  21.      <name>hbase.tmp.dir</name>  
  22.      <value>/ROOT/server/hbase/hbasetmp</value>  
  23.          </property>  
  24. <!-- When using the external zk cluster of Hbase, use the following zk port -->  
  25.      <property>  
  26.      <name>hbase.zookeeper.quorum</name>  
  27.      <value>h1,h2,h3</value>  
  28.      </property>  
  29.         <property>  
  30.                 <name>hbase.regionserver.lease.period</name>  
  31.                 <value>120000</value>  
  32.         </property>  
  33. </configuration>  
<configuration>
  <property>
      <name>hbase.rootdir</name>
      <value>hdfs://ns1/hbase</value><!--This must be the same as the configuration in core-site.xml-->
  </property>
  <!-- Enable distributed mode-->
  <property>
  <name>hbase.cluster.distributed</name>
   <value>true</value>
  </property>
 <property>
        <name>hbase.zookeeper.property.clientPort</name>
        <value>2181</value>
    </property>
  <!-- This is right, only configure the port, in order to configure multiple HMaster -->
   <property>
   <name>hbase.master</name>
   <value>60000</value>
   </property>
     <property>
     <name>hbase.tmp.dir</name>
     <value>/ROOT/server/hbase/hbasetmp</value>
         </property>
<!-- When using the external zk cluster of Hbase, use the following zk port-->
     <property>
     <name>hbase.zookeeper.quorum</name>
     <value>h1,h2,h3</value>
     </property>
        <property>
                <name>hbase.regionserver.lease.period</name>
                <value>120000</value>
        </property>
</configuration>




After completion, execute start-hbase.sh to start the Hbase cluster, and then
execute . If the startup is successful, you can
see the standby master on the 16010 interface. After everything is normal, you can Kill the master master and test automatic fault tolerance.







Use the jps command to view the processes of the two masters, as follows:

Java code copy code  Favorite code
  1. [webmaster@Hadoop-0-187 ~]$ jps  
  2. 20449 JobHistoryServer  
  3. 27295 Jps  
  4. 14204  DataNode  
  5. 20209  NameNode  
  6. 17328 ResourceManager  
  7. 3310  QuorumPeerMain  
  8. 19329 HMaster  
  9. 13827 DFSZKFailoverController  
  10. 15474 NodeManager  
  11. 14409 JournalNode  
  12. [webmaster@Hadoop-0-187 ~]$   
[webmaster@Hadoop-0-187 ~]$ jps
20449 JobHistoryServer
27295 Jps
14204 DataNode
20209 NameNode
17328 ResourceManager
3310 QuorumPeerMain
19329 HMaster
13827 DFSZKFailoverController
15474 NodeManager
14409 JournalNode
[webmaster@Hadoop-0-187 ~]$



Java code copy code  Favorite code
  1. [webmaster@Hadoop-0-186 ~]$ jps  
  2. 30300 JournalNode  
  3. 30789 NodeManager  
  4. 582 HMaster  
  5. 30203  DataNode  
  6. 3683 Jps  
  7. 30127  NameNode  
  8. 31256 ResourceManager  
  9. 2396  QuorumPeerMain  
  10. 29987 DFSZKFailoverController  
  11. 32745 HRegionServer  
  12. [webmaster@Hadoop-0-186 ~]$   
[webmaster@Hadoop-0-186 ~]$ jps
30300 JournalNode
30789 NodeManager
582 HMaster
30203 DataNode
3683 Jps
30127 NameNode
31256 ResourceManager
2396 QuorumPeerMain
29987 DFSZKFailoverController
32745 HRegionServer
[webmaster@Hadoop-0-186 ~]$



It means the configuration is successful!

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326668886&siteId=291194637