Help Center/ GeminiDB/ GeminiDB HBase API/ Getting Started with GeminiDB HBase API/ Buying and Connecting to a GeminiDB HBase Instance
Updated on 2025-12-30 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

Preparations

  • Sign up for a HUAWEI ID and complete real-name authentication.

    Before buying a GeminiDB HBase instance, Signing Up for a HUAWEI ID and Enabling Huawei Cloud Services.

    If you have enabled Huawei Cloud services, skip this step.

  • To perform refined management on Huawei Cloud resources, create an IAM user and user group and grant permissions to the user by following Creating a User and Granting GeminiDB HBase API Permissions.
  • 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.

Buying an Instance

For details, see Buying a GeminiDB HBase Instance.

  1. Log in to the GeminiDB console.
  2. On the Instances page, click Buy DB Instance.
  3. On the displayed page, select a billing mode, configure instance parameters, and click Next.
    Figure 1 Billing mode and basic information
    Table 1 Billing mode

    Parameter

    Example Value

    Description

    Billing Mode

    Pay-per-use

    Billing mode of an instance

    • Yearly/Monthly: You prepay for an instance based on a fixed subscription period (monthly or yearly). Longer subscriptions offer larger discounts. This mode is a good option for long-term stable workloads.
    • Pay-per-use: You are billed based on how long you have actually used GeminiDB. Pricing is listed on a per-hour basis, and bills are calculated down to the second. This mode allows you to adjust resource usage easily. You neither need to prepare for resources in advance, nor end up with excessive or insufficient preset resources.
    Table 2 Basic information

    Parameter

    Example Value

    Description

    Region

    EU-Dublin

    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

    Custom

    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, and InfluxDB. You can select GeminiDB APIs by following How Do I Select an API?

    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

    AZ 1, AZ 2, and AZ 3

    An AZ is a part of a region with its own independent power supplies and networks. AZs are physically isolated but can communicate through an internal network.

    Figure 2 Specifications and storage
    Table 3 Specifications and storage

    Parameter

    Example Value

    Description

    Instance Specifications

    2 vCPUs | 8 GB

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

    Nodes

    3

    Number of nodes that the instance is deployed on.

    If the number of nodes exceeds the upper limit, you can choose Service Tickets > Create Service Ticket in the upper right corner of the console and contact the customer service.

    After an instance is created, you can add nodes. For details, see Manually Adding Instance Nodes.

    Storage Space

    500 GB

    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.

    Auto Scale

    No

    Whether autoscaling is enabled.

    You can enable Auto Scale after an instance is created. For details, see Automatically Scaling Up Storage Space.

    Table 4 Network configuration

    Parameter

    Example Value

    Description

    VPC

    default_vpc

    A dedicated virtual network where your instance is located. It isolates networks for different workloads to enhance security.

    The system will assign a default VPC (default_vpc). You can also use an existing, new, or shared VPC.

    After an instance is created, the VPC cannot be changed.

    • Select an existing VPC of the current account from the drop-down list.
    • To use a new VPC, create a VPC first and then select it from the drop-down list.

      For details about how to create a VPC, see Creating a VPC in Virtual Private Cloud User Guide.

    NOTE:
    • To connect an instance to an ECS over a private network, ensure they are in the same VPC. If they are not, create a VPC peering connection between them.

    Subnet

    default_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

    default

    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.

    Table 5 Database configuration

    Parameter

    Example Value

    Description

    Administrator Password

    Configured based on the password policy

    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.

    Enterprise Project

    default

    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

    Default-Cassandra-3.11

    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.

  4. On the displayed page, confirm instance details. To modify the configurations, click Previous.
  5. If no modification is required, read and agree to the service agreement and click Submit.
  6. Click Back to Instance Management to go to the instance list.
  7. 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.

Viewing the Instance IP Address

  1. Log in to the GeminiDB 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 3 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 4 Viewing the port

    Method 2:

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

    Figure 5 Viewing the IP address and port

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. 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>

  3. 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");
            config.set("hbase.security.authentication", "simple");
    
            // 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();
            }
        }
    }

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