All Products
Search
Document Center

Lindorm:Connect to LindormTable using Lindorm Shell

Last Updated:Mar 28, 2026

Lindorm Shell is an HBase client tool that connects to LindormTable using the HBase Java API. Use it to create tables, read and write data, and run DDL operations from the command line. The setup takes about 5 minutes.

Prerequisites

Before you begin, make sure you have:

  • Java Development Kit (JDK) 1.8 or later installed

  • The client machine's IP address added to your Lindorm instance whitelist. See Configure a whitelist

Usage notes

  • Lindorm Shell supports simple data definition language (DDL) and data read/write operations only. For unsupported operations, see Limits on HBase API.

  • Do not use Lindorm Shell to access wide tables created with SQL. This can cause garbled characters.

  • Lindorm Shell runs on Linux and macOS.

Important

Running Lindorm Shell on Windows may cause errors or missing libraries. If this happens, add the required libraries based on the error messages.

Connect to LindormTable

Step 1: Download Lindorm Shell

  1. Log on to the Lindorm console. In the upper-left corner, select the region where your instance is located. On the Instances page, click the target instance ID.

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

  3. Click Lindorm Shell Download.

Step 2: Extract the package

Run tar to extract the downloaded package. The following example extracts it to the alihbase-2.0.18 folder.

tar zxvf hbaseue-shell.tar.gz

Step 3: Configure connection parameters

  1. Open hbase-site.xml in the alihbase-2.0.18/conf directory.

    vi alihbase-2.0.18/conf/hbase-site.xml
  2. Set the endpoint, username, and password:

    ParameterDescription
    hbase.zookeeper.quorumThe Access By Using HBase Java API endpoint for the Wide Table Engine. Use the VPC endpoint if Lindorm Shell runs on an ECS instance in the same VPC as your Lindorm instance. Use the public endpoint if it runs on a local machine or an ECS instance in a different VPC.
    hbase.client.usernameThe username for LindormTable.
    hbase.client.passwordThe password for LindormTable. To reset a forgotten password, see Change a user password in the LindormTable Cluster Management System.
    <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>

Step 4: Start Lindorm Shell

Run hbase shell from the alihbase-2.0.18/bin directory:

./hbase shell

A successful connection shows output similar to:

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

Lindorm Shell reference

Command reference

For the full list of shell commands, see Apache HBase Shell.

Enter and exit the shell

Use hbase shell to enter the shell environment:

bin/hbase shell

Use quit to exit:

quit

Data definition language (DDL)

CommandDescription
createCreates a table
listLists all tables
describeShows table properties and schema
alterModifies a table
existsChecks whether a table exists
disableDisables a table (required before drop or alter)
is_disabledChecks whether a table is disabled
enableRe-enables a disabled table
is_enabledChecks whether a table is enabled
dropDeletes a disabled table

Data manipulation language (DML)

CommandDescription
putWrites a value to a specific cell
getReads a specific row or cell
scanScans an entire table or a row range
countReturns the number of rows in a table
deleteDeletes a specific cell
deleteallDeletes all cells in a row
truncate_preserveDeletes all table data while preserving the original region partitions

Operation examples

Create a table and insert data

  1. Use create to create a table. Specify the table name and at least one column family name.

    create 'table_name', 'column_family_name'

    Example:

    create 'test', 'cf'
  2. Use put to insert rows. The syntax is put 'table', 'rowkey', 'column_family:column', 'value'.

    put 'test', 'row1', 'cf:a', 'value1'
    put 'test', 'row2', 'cf:b', 'value2'
    put 'test', 'row3', 'cf:c', 'value3'
    row1 is the rowkey of the test table, cf:a specifies the column family name and column name, and value1 is the value.

Query data

  • Use list to list all tables. Pass an optional regular expression to filter results.

    list
    list 'abc.*'
    list 'test'
  • Use scan to read all rows in a table, or query a row range. It is slower than get for single-row lookups.

    scan 'test'

    Result:

    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
  • Use get to retrieve a single row by rowkey.

    get 'test', 'row1'

    Result:

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

Disable and enable a table

Use disable before modifying or dropping a table. Use enable to restore it afterward.

disable 'table_name'
enable 'table_name'

Delete a table

Use drop to delete a disabled table.

drop 'table_name'

Common configurations

After you modify the configuration, run describe to verify that the changes have taken effect:

describe 'table_name'

Set major compaction epoch

Set the major compaction interval for a column family. The unit is milliseconds. Avoid changing this unless necessary.

The following example sets the interval to 7 days:

alter 'table_name', {NAME => 'column_family_name', CONFIGURATION => {'hbase.hregion.majorcompaction' => 16800000}}
The default value is Math.Min(TTL, 1,728,000,000 ms). Without a TTL, the default is 20 days (1,728,000,000 ms).

Set data compression

Set the compression algorithm for a column family. ZSTD is recommended.

alter 'table_name', NAME => 'column_family_name', COMPRESSION => 'ZSTD'

Set block encoding

Set the block encoding type (DATA_BLOCK_ENCODING) for a column family.

alter 'table_name', NAME => 'column_family_name', DATA_BLOCK_ENCODING => 'DIFF'

Set TTL

Set the time to live (TTL) for a column family in seconds. For example, 2,592,000 seconds equals 30 days.

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

To retain data indefinitely, set TTL to FOREVER:

alter 'table_name', {NAME => 'column_family_name', TTL => 'FOREVER'}

Pre-split a table

Create a table with pre-splitting to distribute data evenly across shards from the start. Calculate the number of shards based on 6–8 GB of storage per shard.

create 'table_name', {NAME => 'column_family_name', COMPRESSION => 'snappy'}, {NUMREGIONS => 50, SPLITALGO => 'HexStringSplit'}
ParameterDescription
NAMEThe column family name.
COMPRESSIONThe compression algorithm. Options: ZSTD (recommended), SNAPPY, LZ4. No compression is applied by default.
NUMREGIONSThe number of shards. Base this on 6–8 GB per shard.
SPLITALGOThe partition-splitting algorithm. HexStringSplit — for rowkeys prefixed with a hexadecimal string. DecimalStringSplit — for rowkeys prefixed with a decimal string. UniformSplit — for rowkeys with a fully random prefix.

What's next