Cluster deployment of Apache HBase 1.2.12 under CentOS

Posted by sdallas411 on Sun, 24 Oct 2021 18:03:25 +0200

Cluster deployment of Apache HBase 1.2.12 under CentOS

1, Dependent environment

Pre dependency and installation

  • CentOS 7. X, JDK, Hadoop 2.7.7 cluster, zookeeper-3.4.14 cluster
  • The three node zookeeper is deployed this time. The corresponding machine hostname s are bigdata02, bigdata03 and bigdata04

The cluster planning is shown in the following table:


Download Apache HBase

  • HBase official website: Find the official website and download the HBase installation package hbase-1.2.12-bin.tar.gz
  • Recommended images for other websites:
  • Official documents of corresponding versions:
  • If you want to download another version:

2, Installing Apache Hbase

Create installation path

  • Create folder hbase under / path

    [root@bigdata02 /]# mkdir hbase
  • Put the downloaded hbase-1.2.12-bin.tar.gz into the HBase path and unzip it

    [root@bigdata02 hbase]# tar -zxvf hbase-1.2.12-bin.tar.gz

Modify profile

  • Modify to enter the conf path under the decompression path

    [root@bigdata02 conf]# vim
  • Modify the jdk path and the zk that is not applicable

    export JAVA_HOME=/usr/local/src/jdk8
    export HBASE_MANAGES_ZK=false
  • Modify hbase-site.xml

    [root@bigdata02 conf]# vim hbase-site.xml 
  • Add the following configuration:

        <!-- appoint hbase Table data in HDFS Root path stored on -->
        <!-- appoint hbase It is a distributed cluster mode -->
        <!-- appoint zookeeper Address, multiple","division -->
  • Here, you need to create the root path of hbase table data stored on HDFS under the HDFS path

    [root@bigdata02 conf]# hdfs dfs -mkdir /hbase
  • Modify regionservers

    [root@bigdata02 conf]# vim regionservers  
    # The contents are as follows:
  • Create backup masters under conf

    [root@bigdata02 conf]# touch backup-masters
    #The contents are as follows: configure the backup master node of the cluster
  • Copy the core configuration files hdfs-site.xml and core-site.xml of hadoop cluster to the conf path

Distribute the installation package to each node

  • Go back to the HBase path and distribute the installation package to each node. Note that the installation path should be the same; Distribute the hbase-1.2.12 folder to the other two nodes bigdata03 and bigdata04 (first establish the HBase file path at bigdata03 and bigdata04 nodes)

    [root@bigdata02 hbase] # scp -r hbase-1.2.12 root@bigdata03:/hbase
    [root@bigdata02 hbase] # scp -r hbase-1.2.12 root@bigdata04:/hbase

Synchronize server time

  • HBase cluster has stricter time synchronization requirements than HDFS, and the difference is required to be no more than 30s

    sudo yum install -y ntpdate
    sudo ntpdate -u

Configure environment variables for Hbase

  • Configure the environment variables of Hbase on the three machines

    # vim /etc/profile
    export HBASE_HOME=/hbase/hbase-1.2.12
  • Make it effective

    # source /etc/profile

3, Start service

  • Start the service in the following order: 1.Zookeeper cluster, 2.Hadoop cluster, 3.Hive cluster (if any) and 4.Hbase cluster;

  • Start hbase here at the bigdata02 node

    [root@bigdata02 hbase] #

4, View startup

  • Check whether the startup is normal and successful. jps each node in turn, as follows:

  • Note: both the primary node and the standby node start the hmaster process; Each slave node starts the hregionserver process

  • By accessing the browser page: http://bigdata02:16010

5, Turn off the Hbase service

  • Execute under the bin path of the HMaster node:

    [root@bigdata04 bin]# ./ stop master
  • Execute under the bin path of the HRegionServer node:

    [root@bigdata04 bin]# ./ stop regionserver RegionServer

Topics: Apache CentOS HBase