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
hp301 192.168.150.31
hp302 192.168.150.32
hp303 192.168.150.33

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

vi/etc/profile.d/hbase.sh
export HBASE_HOME=/usr/local/hbase2
export PATH=$PATH:$HBASE_HOME/bin
source /etc/profile.d/hbase.sh

5, Modify the configuration file :

HBase All the configuration files are in this folder :

/usr/local/hbase-2.4.8/conf

hbase-env.sh:
Open the following two comments in the source file , And replace the value :

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

hbase-site.xml:

<configuration>
<!-- 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 . -->
<property>
<name>hbase.rootdir</name>
<!-- Set up Hadoop master-->
<value>hdfs://hp301:9000/hbase</value>
</property>
<!-- Set up hbase The cluster is a distributed cluster -->
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<!-- Set up zookeeper colony , Separated by commas -->
<property>
<name>hbase.zookeeper.quorum</name>
<value>hp301:2181,hp302:2181,hp303:2181</value>
</property>
<!-- 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 ! -->
<property>
<name>dfs.replication</name>
<value>2</value>
</property>
<!-- Zookeeper Metadata storage directory , Need and Zookeeper Of zoo.cfg The configuration is consistent -->
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/zk_data/data</value>
</property>
<!-- Appoint HBase Master Web Page access port , Default port number 16010 -->
<property>
<name>hbase.master.info.port</name>
<value>16010</value>
</property>
<!-- Appoint HBase RegionServer Web Page access port , Default port number 16030 -->
<property>
<name>hbase.regionserver.info.port</name>
<value>16030</value>
</property>
<!-- Solution start HMaster uninitialized WAL The problem of -->
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
<property>
<name>hbase.wal.provider</name>
<value>filesystem</value>
</property>
</configuration>

open regionservers file , To configure regionserver host :

hp302
hp303

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

start-hbasse.sh

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 :

stop-hbase.sh

 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