This is article 34 in the Big Data series. Records complete steps of HBase single node installation and configuration on top of existing Hadoop + ZooKeeper cluster.
Complete illustrated version: CSDN Original | Juejin
Prerequisites
This article configures based on following ready environment:
- Three 2C4G cloud servers:
h121,h122,h123 - Hadoop 2.9.2 cluster running normally (HDFS, YARN)
- ZooKeeper 3.x three-node cluster running
- SSH passwordless between nodes configured
- JDK 8 installed
Download and Extract
Execute on h121 node:
# Download HBase 1.3.1
wget https://archive.apache.org/dist/hbase/1.3.1/hbase-1.3.1-bin.tar.gz
# Extract to unified installation directory
tar -zxvf hbase-1.3.1-bin.tar.gz -C /opt/servers
Associate Hadoop Configuration
HBase needs to be aware of HDFS configuration, import Hadoop configuration files via symlink or copy:
# Symlink core-site.xml (recommended, keep in sync)
ln -s /opt/servers/hadoop-2.9.2/etc/hadoop/core-site.xml \
/opt/servers/hbase-1.3.1/conf/core-site.xml
# Copy hdfs-site.xml
cp /opt/servers/hadoop-2.9.2/etc/hadoop/hdfs-site.xml \
/opt/servers/hbase-1.3.1/conf/hdfs-site.xml
Core Configuration Files
hbase-env.sh
# Specify JDK path
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
# Disable HBase built-in ZooKeeper, use external standalone ZooKeeper cluster
export HBASE_MANAGES_ZK=FALSE
HBASE_MANAGES_ZK=FALSE is key configuration: production environment should always use independent ZooKeeper cluster, not HBase’s built-in ZooKeeper, for unified management and avoiding resource competition.
hbase-site.xml
<configuration>
<!-- HBase data storage path on HDFS -->
<property>
<name>hbase.rootdir</name>
<value>hdfs://h121.wzk.icu:9000/hbase</value>
</property>
<!-- Enable distributed mode (different from local pseudo-distributed) -->
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
</configuration>