Access a cluster using HBase Shell

更新时间:
复制 MD 格式

This topic describes how to connect to an ApsaraDB for HBase Standard Edition cluster using the HBase Shell.

Prerequisites

  • If you connect to the cluster over an internal network, ensure you have an ECS instance in the same VPC as your ApsaraDB for HBase Standard Edition cluster. You must also add the IP address of the ECS instance to the cluster's whitelist.

  • If you connect to the cluster over the internet, ensure the public IP address of the client where you run HBase Shell is added to the cluster's whitelist. If you have not configured a whitelist, see Configure a whitelist.

Usage

We strongly recommend using a Linux or macOS environment to connect to and use the wide-column engine with HBase Shell. If you use a Windows environment, you may encounter errors or issues with missing libraries. In such cases, you must add the required libraries to your system based on the error messages.

Procedure

  1. Download the HBase Shell package.

    1. Log on to the ApsaraDB for HBase console.

    2. On the Clusters page, click the target cluster ID.

    3. In the left-side navigation pane, click Database Connection.

    4. In the Connection Information section, click HBase Shell download.

  2. Configure the ZooKeeper addresses for the cluster.

    1. Obtain the ZooKeeper addresses: In the Connection Information section, copy the cluster's ZooKeeper addresses.

    2. Decompress the downloaded HBase Shell package and modify the hbase-site.xml file to add the ZooKeeper addresses.

      
      <configuration>
      <property>
      <name>hbase.zookeeper.quorum</name>
      <value>$ZK_IP1,$ZK_IP2,$ZK_IP3</value>
      </property>
      </configuration>
                                      
  3. Run the bin/hbase shell command to connect to the cluster.

Next steps

After you connect to the ApsaraDB for HBase Standard Edition cluster, you can perform various operations, such as creating tables, running Data Manipulation Language (DML) commands, and performing administrative tasks.

References

HBase Shell: Command list and Command exercises.