Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Environment:Heibaiying BigData Notes HBase Environment

From Leeroopedia


Knowledge Sources
Domains Infrastructure, NoSQL_Database
Last Updated 2026-02-10 10:00 GMT

Overview

Apache HBase 1.2.0/2.1.4 column-family NoSQL database environment running on HDFS with Zookeeper coordination.

Description

This environment provides Apache HBase in two version variants: HBase 1.2.0 (1.x API) and HBase 2.1.4 (2.x API). HBase runs on top of HDFS for distributed storage and uses Zookeeper for region server coordination. The repository provides Java API utilities for both versions, covering CRUD operations, table management, and filter queries. The 2.x API introduces `Admin` and `Table` interfaces replacing the deprecated `HBaseAdmin` and `HTable` classes.

Usage

Use this environment for any HBase Java CRUD operations. It is the mandatory prerequisite for the HBase Java CRUD Operations workflow. HBase 2.x API is recommended for new projects; HBase 1.x API examples are provided for legacy compatibility.

System Requirements

Category Requirement Notes
OS Linux (CentOS 7.6 recommended) Any Linux with JDK 8
Java JDK 1.8 Required by both HBase 1.x and 2.x
Hadoop 2.6.0-cdh5.15.2 HBase requires compatible HDFS
Zookeeper 3.4.13+ For HBase Master and RegionServer coordination
Hardware Minimum 4GB RAM Per RegionServer node
Disk 20GB+ HDFS storage for HBase data

Dependencies

System Packages

  • `hbase` = 1.2.0 or 2.1.4
  • `hadoop` = 2.6.0-cdh5.15.2 (compatible version)
  • `zookeeper` >= 3.4.13
  • `java-1.8.0-openjdk-devel`

Java Packages (Maven)

HBase 1.x:

  • `org.apache.hbase:hbase-client` = 1.2.0

HBase 2.x:

  • `org.apache.hbase:hbase-client` = 2.1.4

Testing:

  • `junit:junit` = 4.12

Credentials

No API credentials required. HBase access is configured via Zookeeper connection:

  • `hbase.zookeeper.quorum`: Zookeeper host addresses (e.g., `hadoop001`)
  • `hbase.zookeeper.property.clientPort`: Zookeeper port (default: 2181)

Quick Install

# Download HBase 2.1.4
wget https://archive.apache.org/dist/hbase/2.1.4/hbase-2.1.4-bin.tar.gz
tar -xzf hbase-2.1.4-bin.tar.gz -C /opt/

# Configure environment
export HBASE_HOME=/opt/hbase-2.1.4
export PATH=$PATH:$HBASE_HOME/bin

# Configure hbase-site.xml with Zookeeper addresses
# Start HBase
start-hbase.sh

# Maven dependency (2.x):
# <dependency>
#   <groupId>org.apache.hbase</groupId>
#   <artifactId>hbase-client</artifactId>
#   <version>2.1.4</version>
# </dependency>

Code Evidence

HBase client dependency from `hbase-java-api-2.x/pom.xml`:

<dependency>
    <groupId>org.apache.hbase</groupId>
    <artifactId>hbase-client</artifactId>
    <version>2.1.4</version>
</dependency>

Connection configuration from `HBaseUtils.java` (2.x):

private static Configuration configuration;
private static Connection connection;

static {
    configuration = HBaseConfiguration.create();
    configuration.set("hbase.zookeeper.property.clientPort", "2181");
    configuration.set("hbase.zookeeper.quorum", "hadoop001");
    try {
        connection = ConnectionFactory.createConnection(configuration);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

Common Errors

Error Message Cause Solution
`MasterNotRunningException` HBase Master not started Run `start-hbase.sh` and verify with `jps` command
`TableNotFoundException` Table does not exist Create the table first using `HBaseUtils.createTable()`
`Connection refused to hadoop001:2181` Zookeeper not running Start Zookeeper before HBase

Compatibility Notes

  • HBase version MUST match Hadoop version: HBase 1.2.0 pairs with Hadoop 2.6.0-cdh5.15.2; mixing versions causes classpath conflicts.
  • HBase 1.x web UI: Port 60010. HBase 2.x web UI: Port 16010.
  • API differences: HBase 1.x uses `CompareFilter.CompareOp` enum; HBase 2.x uses `CompareOperator` enum (deprecated in 3.0).
  • Thread safety: `Connection` is thread-safe; `Table` and `Admin` are NOT thread-safe. Use one `Connection` per process, separate `Table`/`Admin` per thread.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment