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.
They must be in the same region. For lower network latency, we recommend they also be in the same availability zone. To find the region and availability zone of your ECS instance, see View the region and availability zone of an ECS instance.
They must use the same network type. We recommend using the same Virtual Private Cloud (VPC). If your ECS instance is in the Classic Network, you can migrate it to a VPC. For instructions, see Migrate an ECS instance from the Classic Network to a VPC.
Procedure
-
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 -
Decompress the package.
tar zxvf ali-phoenix-4.12.0-AliHBase-1.1-0.9.tar.gz -
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 -iThen, 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.
-
Start SQLLine.
Find the ZooKeeper endpoint on the cluster details page of your ApsaraDB for HBase instance. Then, run the
bin/sqlline.pyscript 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.comIf the command prompt displays output similar to
jdbc:xxxx>, SQLLine has started successfully. -
Run the following command to verify the configuration.
!tablesIf the command returns a list of tables, the configuration is successful. You can then proceed to more advanced usage.
-
Run the following command to exit Phoenix.
!quit
Related content
For more information, see Getting started with HBase SQL (Phoenix).