Hbase deployment

Published 2026-07-28 12:58 Updated 2026-10-13 17:14 702 words 4 min read ... Page views Reviewed The content has been read through by me or a friend I trust. Handwritten Every word here was typed by me.

Reviewed The content has been read through by me or a friend I trust.

This article describes the deployment process of HBase in detail, including environment preparation, configuration file modification, integration with Hadoop, node configuration distribution, cluster startup, and error troubleshooting. The main node starts the HMaster and gradually adds child nodes. Combined with log inspection and test verification, it ensures that the HBase cluster is running normally. Finally, it provides methods to handle common errors and shutdown commands.

Deployment of Hbase

Deploy Hbase

Deployment and configuration of Habase (modify path according to actual situation)

Download Hbase

wget -P /export/software/ https://repo.huaweicloud.com/apache/hbase/2.6.0/hbase-2.6.0-bin.tar.gz
tar -zxvf /export/software/hbase-2.6.0-bin.tar.gz -C /export/servers/
mv /export/servers/hbase-2.6.0 /export/servers/hbase

Modify folder owner

sudo chown -R hadooper:hadooper /export/servers/hbase/

Configure environment variables for easy call at any time

sudo vim /etc/profile 

Add the following at the end of the file:

export PATH=$PATH:/export/servers/hbase/bin

Refresh terminal environment variables

source /etc/profile

verify the installation

hbase version

configuredhbase-env.sh

sudo vim /export/servers/hbase/conf/hbase-env.sh

Add the following configuration

export JAVA_HOME=/export/servers/jdk
export HBASE_CLASSPATH=/export/servers/hbase/conf
export HBASE_MANAGES_ZK=false
export HBASE_USER_CLASSPATH_FIRST=true
export HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP="true" 

configuredhbase-site.xmland replace everything

sudo vim /export/servers/hbase/conf/hbase-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <!-- 核心:HBase存储路径指向Hadoop HA集群逻辑名称(与core-site.xml一致) -->
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://mycluster/hbase</value>
    </property>

    <!-- 启用分布式模式(集群/HA模式必须为true) -->
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>

    <!-- ZooKeeper集群地址(与Hadoop core-site.xml的ha.zookeeper.quorum一致) -->
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>hadoop01,hadoop02,hadoop03</value>
    </property>

    <!-- ZooKeeper客户端端口(默认2181,与集群配置一致) -->
    <property>
        <name>hbase.zookeeper.property.clientPort</name>
        <value>2181</value>
    </property>

    <!-- ZooKeeper数据目录(仅HBase内置ZooKeeper生效,独立ZooKeeper忽略此配置) -->
    <property>
        <name>hbase.zookeeper.property.dataDir</name>
        <value>/export/servers/zookeeper/data</value>
    </property>

    <!-- HA模式必需:禁用HDFS流能力强制检查 -->
    <property>
        <name>hbase.unsafe.stream.capability.enforce</name>
        <value>false</value>
    </property>

    <!-- 可选优化:HBase临时目录 -->
    <property>
        <name>hbase.tmp.dir</name>
        <value>/export/servers/hbase/tmp</value>
    </property>
<!-- 禁用异步 WAL -->
<property>
  <name>hbase.wal.async.enabled</name>
  <value>false</value>
</property>

<!-- 禁用异步 HDFS 写入(关键!)-->
<property>
  <name>hbase.fs.async.impl</name>
  <value></value>
</property>
</configuration>

The main modifications are shown in the figure

Configure child nodes

configuredregionserversFile (specify RegionServer node)

sudo vi /export/servers/hbase/conf/regionservers

Delete the original content and add the host names of all nodes

hadoop01
hadoop02
hadoop03

copy files

Hadoop’score-site.xmlfiles andhdfs-site.xmlFiles to hbaseconfdirectory so that Hbase can read hadoop’s running configuration

sudo cp /export/servers/hadoop/etc/hadoop/core-site.xml /export/servers/hbase/conf
sudo cp /export/servers/hadoop/etc/hadoop/hdfs-site.xml /export/servers/hbase/conf

distribution profile

Copy the configured files and hadoop directory in the main node to the child node

scp -r /etc/profile hadoop02:/tmp
scp -r /etc/profile hadoop03:/tmp
scp -r /export/servers/hbase hadoop02:/tmp
scp -r /export/servers/hbase hadoop03:/tmp

Enter child node

Execute the following instructions on each node

sudo mv /tmp/hbase /export/servers
sudo mv /tmp/profile /etc/

start

Start the HBase cluster (just start the main node)

start-hbase.sh

Start remaining nodes

Launch the second HMaster in hadoop02 Refresh terminal environment variables

source /etc/profile
hbase-daemon.sh start master

Launch the third HMaster in hadoop03 Refresh terminal environment variables

source /etc/profile
hbase-daemon.sh start master

finder

jps | grep -E 'HMaster|HRegionServer' 

hadoop01

hadoop02

hadoop03

test results

Check election results

Browser access main node ip

Connect to hbase and test

hbase shell

list query test

list

If the above results occur and no error is reported, the deployment is completed Then press ctrl+D or enter exit to exit

error analysis

There are many and complex problems in Hbase. Please force the original processes of Hbase (all nodes) to be killed before each run and clean uplogsDirectory (all nodes), first run thestart-hbase.sh, check the main node’slogsdirectorylogsWhether an error occurs in the file, and then run the sub-node’shbase-daemon.sh start master, if the child nodelogsIn the cataloglogsThere is no error in the file, and proceed againhbase shelland observe whether the terminal outputs correctly. If not, please check the logs logs of each node again.

Turn off the Hbase command normally (main node runs)

stop-hbase.sh

Force kill Hbase command (run on each node)

kill -9 $(jps | grep -E "HMaster|HRegionServer" | awk '{print $1}')

Written by Handwritten

If you enjoyed this, leave a comment~

Loading...