Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ CloudTable Service/ Getting Started/ Getting Started with HBase

Getting Started with HBase

Updated on 2024-04-29 GMT+08:00

HBase is a column-based distributed storage system that features high reliability, performance, and scalability. This section describes how to use HBase from scratch. For example, how to run the HBase shell command to create tables, insert data into tables, modify tables, read and delete table data, and delete tables.

Background Information

Suppose a user develops an application to manage users who use service A in an enterprise. The procedure of operating service A on the HBase client is as follows:

  • Create the user_info table.
  • Add users' educational backgrounds and professional titles to the table.
  • Query user names and addresses by user ID.
  • Query information by user name.
  • Deregister users and delete user data from the user information table.
  • Delete the user information table after service A ends.
Table 1 User information

ID

Name

Gender

Age

Address

12005000201

A

Male

19

Shenzhen, Guangdong

12005000202

B

Female

23

Shijiazhuang, Hebei

12005000203

C

Male

26

Ningbo, Zhejiang

12005000204

D

Male

18

Xiangyang, Hubei

12005000205

E

Female

21

Shangrao, Jiangxi

12005000206

F

Male

32

Zhuzhou, Hunan

12005000207

G

Female

29

Nanyang, Henan

12005000208

H

Female

30

Kaixian, Chongqing

12005000209

I

Male

26

Weinan, Shaanxi

12005000210

J

Male

25

Dalian, Liaoning

Buying an HBase Cluster

  1. Log in to the CloudTable console.
  2. Select a region in the upper left corner.
  3. Click Cluster Management.
  4. Click Buy Cluster in the upper right corner of the Cluster Management page and set related parameters. For details about how to configure ports for security group rules, see Table 2.
  5. Click Buy Now. On the displayed page, confirm the specifications and click Finish.
  6. Return to the cluster list to view the cluster creation progress. If the cluster status is In service, the cluster is created. For details, see Creating an HBase Cluster.
    Table 2 Custom security rules

    Direction

    Protocol

    Port/Range

    Source/Security Group

    Usage

    Outbound

    All

    All

    0.0.0.0/0

    Permit in the outbound direction

    Inbound

    TCP

    16000

    Security group of the CloudTable HBase cluster

    HMaster RPC port

    TCP

    16020

    RegionServer RPC port

    TCP

    2181

    ZooKeeper client connection monitoring port

    TCP

    2888

    Follower connection monitoring port

    TCP

    3888

    ZooKeeper election port

    TCP

    2000

    HAgent access port

Downloading the HBase Client

  1. Log in to the CloudTable console.
  2. Select a region in the upper left corner.
  3. Click Help in the navigation pane.
  4. Choose Download the HBasex.x Client under Helpful Links (choose the version that you need) on the right of the help page to download the client installation package.

Preparing an ECS

  1. Buy an ECS.
    1. Log in to the ECS console.
    2. Click in the upper left corner to select a region.
    3. Click the service list icon and choose Compute > Elastic Cloud Server.
    4. Click Buy ECS.
    5. Configure ECS parameters.
      1. Select the CPU architecture and specifications.
        Figure 1 Configuring basic settings
      2. Select the image and disk specifications.
        Figure 2 Selecting the image and disk specifications
  2. Click Next: Configure Network.
    1. Select a VPC and a security group.
      Figure 3 Configuring network
    2. Select Auto assign and set Billed By to Traffic.
      Figure 4 Configuring EIP type and bandwidth billing type
  3. Click Next: Configure Advanced Settings.

    Configure the ECS name and password.

    Figure 5 Configuring advanced settings
  4. Click Next: Confirm to confirm the configuration information.
    Figure 6 Confirming the configuration information
  5. Select an enterprise project, select the sentence in the Agreement area, confirm the configuration information, and click Submit.
  6. Return to the ECS list page and view the ECS creation progress.

    When the ECS status changes to Running, the ECS is created.

Installing the Client

This part introduces how to manually install the client. You can also choose the one-click client deployment method.

  1. Use the SSH login tool (such as PuTTY) to log in to the Linux ECS through the EIP.

    For details about how to log in to the ECS, see "Remotely Logging In to a Linux ECS (Using an SSH Password)" in Logging In to a Linux ECS of the Elastic Cloud Server User Guide.

  2. Transfer the client downloaded in 2 to the Linux ECS.
  3. Decompress the client installation package.
    cd <Path of the client installation package>
    tar xzvf hbase-1.3.1-bin.tar.gz
    cd <Path of the client installation package>
    tar xzvf hbase-2.4.14-bin.tar.gz

    <Path of the client installation package>: Replace it with the actual path.

  4. Configure the ZooKeeper address in a configuration file.

    In the decompression directory of the client installation package, open the hbase/conf/hbase-site.xml file and set the following parameters:

    1. hbase.zookeeper.quorum: The value of this parameter is the ZooKeeper link of the cluster found in the cluster list.

      Log in to the CloudTable console and choose Cluster Management. In the cluster list, locate the required cluster and obtain its ZooKeeper link in the ZK Link column. Add this link address to the hbase/conf/hbase-site.xml file, as shown in Figure 8.

      Figure 7 Viewing the ZooKeeper link
      Figure 8 Configuring the ZooKeeper address
    2. mapreduce.cluster.local.dir: Check whether the configuration item exists. If the configuration item does not exist, add it.
      The configuration example is as follows:
      <configuration>
      <property>
      <name>hbase.zookeeper.quorum</name>
      <value>xxx-zk1.cloudtable.com,xxx-zk2.cloudtable.com,xxx-zk3.cloudtable.com</value>
      </property>
      
      <property>
      <name>mapreduce.cluster.local.dir</name>
      <value>${hadoop.tmp.dir}/mapred/local</value>
      </property>
      </configuration>
  5. Start the shell to access the cluster. Run the bin/hbase shell command to start the shell to access the cluster.

Running the HBase Client Command to Implement Service A

  1. Create the user_info table according to Table 1 and add related data to it.
    create 'user_info',{NAME => 'i'}

    For example, to add information about the user whose ID is 12005000201, run the following commands:

    put 'user_info','12005000201','i:name','A'
    put 'user_info','12005000201','i:gender','Male'
    put 'user_info','12005000201','i:age','19'
    put 'user_info','12005000201','i:address','Shenzhen, Guangdong'
  2. Add users' educational backgrounds and titles to the user_info table.

    For example, to add educational background and title information about user 12005000201, run the following commands:

    put 'user_info','12005000201','i:degree','master'
    put 'user_info','12005000201','i:pose','manager'
  3. Query user names and addresses by user ID.

    For example, to query the name and address of user 12005000201, run the following command:

    scan 'user_info',{STARTROW=>'12005000201',STOPROW=>'12005000201',COLUMNS=>['i:name','i:address']}
  4. Query information by user name.

    For example, to query information about user A, run the following command:

    scan 'user_info',{FILTER=>"SingleColumnValueFilter('i','name',=,'binary:A')"}
  5. Delete user data from the user information table.

    All user data needs to be deleted. For example, to delete data of user 12005000201, run the following command:

    delete 'user_info','12005000201','i'
  6. Delete the user information table.
    disable 'user_info';drop 'user_info'

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback