HBase2. 4.8 detailed tutorial (I) HBase environment construction

Miss Zhu 2022-02-13 08:38:35 阅读数:860

hbase2. hbase detailed tutorial hbase

        HBase Data stored in Hadoop On , and ZooKeeper be responsible for HMaster Election and active standby switching 、 System fault tolerance 、RootRegion management 、Region State management, etc , So install HBase Installation is required first Hadoop and ZooKeeper.
         What we are using this time is CentOS7、Hadoop3.3.1、ZooKeeper3.4.6、HBase2.4.8(Hbase3 The official version has not been released ,2.4.8 Is currently the 2021 Latest edition of )

         This plan is shown in the following three nodes , In order to save resources , Install... On three nodes Hadoop and ZooKeeper as well as HBase, among hp301 Main node .

Host name IP Address

In which Hadoop Please refer to the special article of this blog :
Hadoop3.3.1 Detailed tutorial
In which Zookeeper Please refer to the special article of this blog :
ZooKeeper3.4.6 Build a distributed environment

Here's the installation Hbase step :
1, download HBase2.4.8 Upload to server hp301 Of /apps Under the table of contents

2, decompression HBase To /usr/local

tar -zxvf /apps/hbase-2.4.8-bin.tar.gz -C /usr/local

3, by Hbase Create a soft connection

ln -s /usr/local/hbase-2.4.8 /usr/local/hbase2

4, Configure environment variables

export HBASE_HOME=/usr/local/hbase2
source /etc/profile.d/hbase.sh

5, Modify the configuration file :

HBase All the configuration files are in this folder :


Open the following two comments in the source file , And replace the value :

# To configure Java environment variable 
export JAVA_HOME=${
# close hbase Self contained zookeeper
export HBASE_MANAGES_ZK=false


<!-- This directory regionserver Shared directory , For persistent storage HBase The data of , The default value is :${hbase.tmp.dir}/hbase, If you don't change the default value , Data will be lost when the cluster restarts . -->
<!-- Set up Hadoop master-->
<!-- Set up hbase The cluster is a distributed cluster -->
<!-- Set up zookeeper colony , Separated by commas -->
<!-- hbase Number of copies backed up , No more than datanode Of nodes . hbase The number of data backups needs to be increased hbase-site.xml Set separately in the configuration file , otherwise hbase Written data regionServer Only one copy will be kept ! -->
<!-- Zookeeper Metadata storage directory , Need and Zookeeper Of zoo.cfg The configuration is consistent -->
<!-- Appoint HBase Master Web Page access port , Default port number 16010 -->
<!-- Appoint HBase RegionServer Web Page access port , Default port number 16030 -->
<!-- Solution start HMaster uninitialized WAL The problem of -->

open regionservers file , To configure regionserver host :


6, take hp301 Configured remote replication to hp302、hp303

take /usr/local/hbase-2.4.8 Remote replication to hp302、hp303
take /etc/profile.d/hbase.sh Remote replication to hp302、hp303
Respectively in hp302、hp303 To establish hbase2 Soft connection , And make hbase The environment variable for the is valid

7, test
start-up Hadoop colony , And start on three machines respectively ZooKeeper
start-up HBase colony


stay hp301 Check out jps:

 Insert picture description here

stay hp302 Check out 、 stay hp303 Check out , The effect is consistent :
 Insert picture description here

adopt hbase Provided hbase-webapp Can be accessed through the browser to see web UI

 Insert picture description here

8, Shut down the cluster :


 Insert picture description here

If it cannot be closed normally , You can try to close... Separately Master、RegionServer, The order is as follows :

hbase-daemons.sh stop master
hbase-daemons.sh stop regionserver

close ZooKeeper、 close Hadoop.

copyright:author[Miss Zhu],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130838324230.html