Help Center/ GeminiDB/ GeminiDB HBase API/ Getting Started with GeminiDB HBase API/ Buying and Connecting to a GeminiDB HBase Instance
Updated on 2025-08-05 GMT+08:00

Buying and Connecting to a GeminiDB HBase Instance

This section describes how to buy and connect to a GeminiDB HBase instance on the GeminiDB console.

For details about other connection methods, see Connecting to a GeminiDB HBase Instance

Prerequisites

  • For details about how to create an ECS, see Purchasing an ECS in Getting Started with Elastic Cloud Server.
  • JDK has been installed on the ECS.
  • Download the HBase client. Click a directory of the latest version 2.6.X and download hbase-2.6.X-client-bin.tar.gz. For example, if the latest version is 2.6.1, click that directory and download hbase-2.6.1-client-bin.tar.gz. HBase 1.X is not recommended due to compatibility issues.

Viewing the Instance IP Address

  1. Log in to the Huawei Cloud console.
  2. On the Instances page, click the target instance.

    Method 1:

    In the Node Information area on the Basic Information page, view the private IP address of each GeminiDB HBase instance node.

    Currently, GeminiDB HBase instances cannot be bound to EIPs.

    Figure 1 Viewing the IP address

    In the Network Information area, view the GeminiDB HBase instance port. The default port for connecting to the client is 2181.

    Figure 2 Viewing the port

    Method 2

    In the navigation pane, choose Connections to view the private IP address and EIP of the instance.

    Figure 3 Viewing the IP address and port

Step 2: Buying an Instance

For details, see Buying a GeminiDB HBase Instance.

  1. Log in to the Huawei Cloud console.
  2. In the service list, choose Databases > GeminiDB.
  3. On the Instances page, click Buy DB Instance.
  4. On the displayed page, select a billing mode, configure instance parameters, and click Next.
    Figure 4 Billing mode and basic information (classic storage)
    Figure 5 Billing mode and basic information (cloud native storage)
    Table 1 Billing mode

    Parameter

    Description

    Billing Mode

    Select Yearly/Monthly or Pay-per-use.

    • Yearly/Monthly
    • Pay-per-use
      • You do not need to set Validity Period because you are billed based on how long you have actually used your instance.
      • To use an instance for a long time, change its billing mode to yearly/monthly to reduce costs. For details, see Changing a Pay-per-Use Instance to Yearly/Monthly.
    Table 2 Basic information

    Parameter

    Description

    Region

    Region where a tenant is located

    NOTE:

    To reduce network latency, select a region nearest from which you will access the instance. Instances deployed in different regions cannot communicate with each other over a private network. After you buy an instance, you cannot change its region.

    DB Instance Name

    The instance name:

    • Can be the same as an existing instance name.
    • Can include 4 to 64 bytes and must start with a letter. It is case-sensitive and allows only letters, digits, hyphens (-), and underscores (_).

    Compatible API

    HBase

    GeminiDB is compatible with mainstream NoSQL databases, including Redis, DynamoDB, Cassandra, HBase, MongoDB, and InfluxDB. You can select GeminiDB APIs by following How Do I Select an API?

    Storage Type

    • Classic: classic architecture with decoupled storage and compute
    • Cloud native: new, more flexible, new-gen version with support for more AZs
    NOTE:
    • The way you use instances with classic or cloud native storage is similar. Cloud native storage supports more AZs. If both classic and cloud native are supported, you can select any of them.
    • Cloud native storage is now in OBT. To use it, choose Service Tickets > Create Service Ticket in the upper right corner of the console and contact the customer service.

    DB Instance Type

    Cluster

    One cluster consists of at least three nodes. A cluster is easy to scale out to meet increasing data growth needs. A cluster is recommended when dealing with stringent availability demands, substantial data volumes, and the need for seamless scalability.

    AZ

    Availability zone where the instance is created. An AZ is a part of a region with its own independent power supplies and networks. AZs are physically isolated but can communicate with each other over a private network.

    Figure 6 Specifications and storage
    Table 3 Specifications and storage

    Parameter

    Description

    Instance Specifications

    Higher CPU specifications provide better performance. Select specifications as needed.

    Nodes

    The number of nodes ranges from 3 to 80.

    Storage Space

    Instance storage space. The range depends on the instance specifications.

    To scale up storage, you need to add at least 1 GB each time. The value must be an integer.

    Disk Encryption

    You can determine whether to encrypt disks.

    • Disable: Data is not encrypted.
    • Enable: Your data will be encrypted on disks and stored in ciphertext after you create an instance. When you download encrypted objects, the ciphertext will be decrypted into plain text and then sent to you. Disk encryption can improve data security and may have slight impacts on database writes and reads.
      • Key Name: Select an existing key or create one.
      NOTE:
      • This function is now in CBT. To use it, choose Service Tickets > Create Service Ticket in the upper right corner of the console and contact the customer service.
      • After an instance is created, the disk encryption status and key cannot be changed.
      • The key cannot be disabled, deleted, or frozen when used, or the database becomes unavailable.
      • For details about how to create a key, see "Creating a CMK" in Data Encryption Workshop User Guide.
    Figure 7 Network configuration
    Table 4 Network configuration

    Parameter

    Description

    VPC

    Virtual private network where your instances are located. A VPC isolates networks for different services. You can select an existing VPC or create a VPC.

    If no VPC is available, the system creates one for you.

    For details, see "Creating a VPC" in Virtual Private Cloud User Guide.

    You can also use VPCs and subnets shared by other accounts.

    VPC owners can share the subnets in a VPC with one or multiple accounts through Resource Access Manager (RAM), which ensures cost efficiency of network resources.

    For more information about VPC subnet sharing, see VPC Sharing in Virtual Private Cloud User Guide.

    NOTE:
    • After the instance is created, its VPC cannot be changed.
    • If you want to connect to an instance using an ECS over a private network, ensure that the instance and the ECS are in the same VPC. If they are not, create a VPC peering connection between them.

    Subnet

    A subnet where your instance is created. The subnet provides dedicated and isolated networks, improving network security.

    NOTE:

    An IPv6 subnet cannot be associated with your instance. Select an IPv4 subnet.

    Security Group

    A security group controls access between instances and other services. Ensure that the security group you selected allows your client to access the instance.

    If no security group is available, the system creates one for you.

    Figure 8 Database configuration

    Table 5 Database configuration

    Parameter

    Description

    Administrator

    Username of the administrator account. The default value is rwuser.

    Administrator Password

    Password of the administrator account. The password:

    • Can include 8 to 32 characters.
    • Must contain uppercase letters, lowercase letters, digits, and any of the following special characters: ~!#%^*-_=+?
    • Cannot contain @ or /
    • For security reasons, set a strong password. The system will verify the password strength.

    Keep your password secure. The system cannot retrieve it if it is lost.

    Confirm Password

    Enter the administrator password again.

    Enterprise Project

    This parameter is provided for enterprise users.

    An enterprise project groups cloud resources, so you can manage resources and members by project. The default project is default.

    Select an enterprise project from the drop-down list. For more information about enterprise projects, see Enterprise Management User Guide.

    Parameter Template

    A parameter template contains the configuration values of a database engine. The parameters can be applied to one or more instances of the same type. After creating an instance, you can modify the parameter template.

    You can modify the instance parameters as required after the instance is created.

    Retain the default values for other parameters.

  5. On the displayed page, confirm instance details. To modify the configurations, click Previous.
  6. If no modification is required, read and agree to the service agreement and click Submit.
  7. Click Back to Instance Management to go to the instance list.
  8. On the Instances page, view and manage the created instance.
    • It takes about 5 to 9 minutes to create an instance. During the process, the instance status is Creating.
    • After the instance is created, its status becomes Available.

Connecting to an Instance Using Java

  1. Obtain the private IP address and port of the GeminiDB HBase instance.

    For details about how to obtain the private IP address and port, see Viewing the Instance IP Address.

  2. Log in to the ECS. For details, see Logging In to an ECS in Getting Started with Elastic Cloud Server.
  3. Add the following Maven dependencies to the pom.xml file of your project. HBase 1.X is not recommended due to compatibility issues causing read and write failures. You are advised to use HBase 2.2.3 or later. SSL is supported only in HBase 2.6.0 or later.

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

  4. Edit the code for connecting to the GeminiDB HBase instance. Replace your_hbase_instance_quorum with the cluster IP address, your_user_name with the username (rwuser by default) you set when creating the cluster, and your_password with the password you set when creating the cluster. Before running the code, ensure that an HBase table has been created in the instance, and replace your_table_name with the table name.

    import org.apache.hadoop.conf.Configuration;
    import org.apache.hadoop.hbase.HBaseConfiguration;
    import org.apache.hadoop.hbase.TableName;
    import org.apache.hadoop.hbase.client.*;
    import org.apache.hadoop.hbase.util.Bytes;
    
    import java.io.IOException;
    
    public class HBaseExample {
        public static void main(String[] args) throws IOException {
            // Creates a configuration object and sets HBase connection parameters.
            Configuration config = HBaseConfiguration.create();
            config.set("hbase.zookeeper.quorum", "your_hbase_instance_quorum");
            config.set("hbase.zookeeper.property.clientPort", "2181");
    
            // Enters a username and password.
            UserGroupInformation ugi = UserGroupInformation.createProxyUser("your_user_name",   UserGroupInformation.createRemoteUser("your_password"));
    
            // Establishes a connection to the HBase instance.
            Connection connection = ConnectionFactory.createConnection(config, User.create(ugi));
    
            try {
                // Obtains table objects.
                TableName tableName = TableName.valueOf("your_table_name");
                Table table = connection.getTable(tableName);
    
                // Inserts data.
                Put put = new Put(Bytes.toBytes("row_key"));
                put.addColumn(Bytes.toBytes("cf"), Bytes.toBytes("col"), Bytes.toBytes("value"));
                table.put(put);
    
                // Obtains a single row of data.
                Get get = new Get(Bytes.toBytes("row_key"));
                Result result = table.get(get);
                byte[] value = result.getValue(Bytes.toBytes("cf"), Bytes.toBytes("col"));
                System.out.println("Success: " + Bytes.toString(value));
    
            } finally {
               // Closes the connection.
                connection.close();
            }
        }
    }

  5. Run the sample code to check whether the result is normal. If it is, "Success: value" is displayed.