All Products
Search
Document Center

Lindorm:Connect to LindormTable with Lindorm Shell

Last Updated:Aug 21, 2026

Lindorm Shell is an HBase-compatible command-line tool from Lindorm. You can use it to connect to LindormTable with the HBase Java API for data operations like creating tables, inserting data, and querying data. This topic shows you how to download Lindorm Shell and connect to LindormTable.

Prerequisites

  • Java Development Kit (JDK) 1.8 or later is installed.

  • Add your client's IP address to the Lindorm instance's whitelist. For more information, see Configure a whitelist.

Usage notes

  • When you connect to LindormTable by using Lindorm Shell, you can perform only basic data definition language (DDL) and data manipulation language (DML) operations. For information about unsupported operations, see HBase API usage limits.

  • Do not use the HBase API to access wide tables created with SQL. This may return garbled characters.

  • We recommend using Lindorm Shell on a Linux or macOS operating system.

    Important

    If you use Lindorm Shell on Windows, you may encounter errors or missing library messages. If this happens, you must add the required library to the operating system as indicated by the error message.

Procedure

  1. Download Lindorm Shell.

    1. In the upper-left corner of the Lindorm console, select your instance's region. On the Instances page, click the target instance's ID.

    2. In the left-side navigation pane, click Database Connections, and then click the Wide Table Engine tab.

    3. Click Lindorm Shell Download.

  2. Run the following command to decompress the Lindorm Shell package. This example decompresses the package to the alihbase-2.0.18 directory.

    tar zxvf hbaseue-shell.tar.gz
  3. Configure connection parameters.

    1. Go to the alihbase-2.0.18/conf directory and open the hbase-site.xml file.

      vi hbase-site.xml
    2. Configure the connection endpoint, username, and password for LindormTable.

      <configuration>
          <property>
              <name>hbase.zookeeper.quorum</name>
              <value>ld-bp17j28j2y7pm****-proxy-lindorm-pub.lindorm.rds.aliyuncs.com:30020</value>
          </property>
          <property>
              <name>hbase.client.username</name>
              <value>testuser</value>
          </property>
          <property>
              <name>hbase.client.password</name>
              <value>password</value>
          </property>
      </configuration>

      Parameters:

      • hbase.zookeeper.quorum: The connection endpoint for LindormTable. You can find this endpoint in the Access by Using HBase Java API section of the console.

        • VPC endpoint: Use this endpoint if Lindorm Shell is on an ECS instance in the same VPC as your Lindorm instance.

        • Public endpoint: Use this endpoint if Lindorm Shell is on an on-premises machine or an ECS instance outside your Lindorm instance's VPC.

      • hbase.client.username and hbase.client.password: The username and password used to access LindormTable. If you forget your password, you can change it in the Cluster Management System of LindormTable. For more information, see Change the password of a user.

  4. Connect to LindormTable using Lindorm Shell.

    Go to the alihbase-2.0.18/bin directory and run the following command.

    ./hbase shell

    The following output indicates a successful connection.

    Version 2.0.18, r08b8d58a9d6ce89765d5ebe2ddff425aed644c16, Mon Feb  1 12:46:39 CST 2021
    Took 0.0034 seconds
    Note

    For more information about how to use the shell, see Lindorm Shell reference.

Lindorm Shell reference

Command reference

For more information about shell commands, see The Apache HBase Shell.

Data definition language (DDL)

  • create: Creates a table.

  • list: Lists all tables.

  • disable: Disables a table.

  • is_disabled: Checks whether a table is disabled.

  • enable: Enables a table.

  • is_enabled: Checks whether a table is enabled.

  • describe: Displays a table's details, including its properties and schema.

  • alter: Modifies a table.

  • exists: Checks whether a table exists.

  • drop: Drops a specified table.

Data manipulation language (DML)

  • put: Updates the value of a specific cell.

  • get: Retrieves the contents of a specified row or cell.

  • delete: Deletes the value of a cell in a table.

  • deleteall: Deletes all cells in a specified row.

  • scan: Scans and returns table data.

  • count: Counts and returns the number of rows in a table.

  • truncate_preserve: Truncates a table. This operation disables, deletes, and then recreates the specified table. The new table retains the same region splits as the original table.

Enter and exit shell

  • Enter the Shell environment.

    bin/hbase shell
  • Exit the Shell environment.

    quit

Examples

Create and insert data

  1. Create a table. You must specify a name for the table and at least one column family.

    create 'table_name', 'column_family_name'

    Example:

    // Create a table named test with a column family named cf.
    create 'test', 'cf'
  2. Insert data.

    put 'table_name', 'row_key', 'column_family:column_name', 'value'

    Example:

    put 'test', 'row1', 'cf:a', 'value1'
    put 'test', 'row2', 'cf:b', 'value2'
    put 'test', 'row3', 'cf:c', 'value3'
    Note

    row1 is the row key of the test table, cf:a specifies the column family and column name, and value1 is the value.

Query data

  • Query information about all tables. You can use regular expressions to filter tables.

    list
    list 'abc.*'
    list 'test'
  • Query data in a specified table.

    The scan command provides a flexible way to access HBase data. You can use the scan command to scan an entire table or query data within a specific range. A scan operation is slightly slower than a single-row query using the get command. Run the following command to query data in the test table.

    scan 'table_name'

    Example:

    scan 'test'

    The following result is returned:

    ROW                                      COLUMN+CELL
     row1                                    column=cf:a, timestamp=1421762485768, value=value1
     row2                                    column=cf:b, timestamp=1421762491785, value=value2
     row3                                    column=cf:c, timestamp=1421762496210, value=value3
    3 row(s) in 0.0230 seconds
  • Query a single row of data from a table.

    get 'table_name', 'row_key' 

    Example:

    get 'test', 'row1' 

    The following result is returned:

    COLUMN CELL
     cf:a timestamp=1421762485768, value=value1
    1 row(s) in 0.0350 seconds

Disable and enable table

Disable or enable a table. Before you can delete a table, modify its settings, or perform other management operations, you must first disable the table with the disable command. After the operation is complete, use the enable command to re-enable it.

disable 'table_name'
enable 'table_name'

Drop table

Drop a specified table.

drop 'table_name'

Common configurations

Common settings

  • Set the period for major compaction on a specified table. We recommend that you do not change this setting unless necessary. The unit is milliseconds (ms).

    The following example sets the major compaction period to seven days.

    alter 'table_name', {NAME => 'column_family_name', CONFIGURATION => {'hbase.hregion.majorcompaction' => 16800000}}
    Note

    Default value: Math.Min(TTL, 1728000000). If you do not set a TTL, the default value is 1,728,000,000 ms, which is 20 days.

  • Set the compression algorithm for a column family of a specified table.

    alter 'table_name', NAME => 'column_family_name', COMPRESSION => 'ZSTD'
  • Set the block encoding type for a column family of a specified table.

    Set the block encoding type for the column family of the test table to DATA_BLOCK_ENCODING.

    alter 'table_name', NAME => 'column_family_name', DATA_BLOCK_ENCODING => 'DIFF'
  • Set a time-to-live (TTL) for a column family of a specified table. The unit of TTL is seconds (s). For example, 2,592,000s equals 30 days.

    alter 'table_name', NAME => 'column_family_name', TTL => 2592000

    If you want to retain data permanently, you can set the TTL value to FOREVER. Example:

    alter 'table_name' , {NAME => 'column_family_name', TTL => 'FOREVER'}
  • Pre-split a specified table.

    create 'table_name', {NAME => 'column_family_name', COMPRESSION => 'snappy' }, { NUMREGIONS => 50, SPLITALGO => 'HexStringSplit' }

    Parameters

    Parameter

    Description

    NAME

    The name of the column family.

    COMPRESSION

    The compression algorithm for the table data. Default: None. Supported algorithms:

    • ZSTD (Recommended)

    • SNAPPY

    • LZ4

    NUMREGIONS

    The number of regions. As a rule of thumb, calculate the number of regions to target a size of 6–8 GB per region. For large-scale instances, you can increase this number as needed.

    SPLITALGO

    The algorithm used to initialize the regions. Supported algorithms and their use cases are as follows:

    • HexStringSplit: This algorithm is suitable for row keys that are prefixed with a hexadecimal string.

    • DecimalStringSplit: This algorithm is suitable for row keys that are prefixed with a decimal numeric string.

    • UniformSplit: This algorithm is suitable for row keys that have a completely random prefix.

After you modify the configuration, you can run the following command to verify that the changes have taken effect:

describe 'table_name'