HBase SQL (Phoenix) 4.x

更新时间:
复制 MD 格式

The Phoenix query engine lets you use SQL to query data in ApsaraDB for HBase. It translates SQL queries into one or more HBase API calls and coordinates execution using coprocessors and custom filters. Phoenix completes simple queries in milliseconds.

For more information, see the official website of Apache Phoenix.

Background

  • Ali-Phoenix is compatible with open source clients (version 4.12).

  • Ali-Phoenix supports public access.

  • Ali-Phoenix includes fixes for several open source bugs.

  • Ali-Phoenix includes new features and performance optimizations.

Usage notes

If your application is deployed on an ECS instance, your ApsaraDB for HBase instance and the ECS instance must meet the following conditions to ensure network connectivity.

Procedure

  1. Download the Phoenix client.

    This topic uses version 4.12.0-AliHBase-1.1-0.9 as an example.

     wget https://hbase-opt.oss-cn-hangzhou.aliyuncs.com/ali-phoenix-4.12.0-AliHBase-1.1-0.9.tar.gz
  2. Decompress the package.

     tar zxvf ali-phoenix-4.12.0-AliHBase-1.1-0.9.tar.gz
  3. Add your client's IP address to your ApsaraDB for HBase instance's whitelist.

    Run the following command to get the private IP address of the ECS instance.

     hostname -i

    Then, add the retrieved ECS private IP address to the whitelist of the ApsaraDB for HBase instance. For more information, see Set whitelists and security groups.

  4. Start SQLLine.

    Find the ZooKeeper endpoint on the cluster details page of your ApsaraDB for HBase instance. Then, run the bin/sqlline.py script with the endpoint as an argument.

     ./sqlline.py hb-bp19142ir9****-001.hbase.rds.aliyuncs.com,hb-bp19142ir9ruxxxxx-002.hbase.rds.aliyuncs.com,hb-bp19142ir9ruxxxxx-004.hbase.rds.aliyuncs.com

    If the command prompt displays output similar to jdbc:xxxx>, SQLLine has started successfully.

  5. Run the following command to verify the configuration.

     !tables

    If the command returns a list of tables, the configuration is successful. You can then proceed to more advanced usage.

  6. Run the following command to exit Phoenix.

     !quit

Related content

For more information, see Getting started with HBase SQL (Phoenix).