ApsaraDB for HBase Performance-enhanced Edition allows you to use Apache Flink to connect to the database service. You can use HBase tables as dimension tables or result tables in Flink. For more information, see Create an HBase result table and Create an HBase dimension table.

When you use Data Definition Language (DDL) statements to create an HBase table as the Flink dimension or result table, you must use the endpoint of ApsaraDB for HBase Performance-enhanced Edition. For more information, see Connect to a cluster. When you use Flink to connect to ApsaraDB for HBase Performance-enhanced Edition, you can use the endpoint used by Java API. Both the default values of the username and password parameters are root. If you use a new account, make sure that the account has read and write permissions on the tables associated with Flink. For more information, see Manage users and ACLs. The following examples show how to use DDL statements to create HBase tables:

  1. CREATE TABLE hbase ( key varchar, name varchar, PRIMARY KEY (key), The rowkey of the hbase table. PERIOD FOR SYSTEM_TIME // Specify that this is a dimension table. ) with ( TYPE = ‘cloudhbase’, endpoint = ‘host:port’,— The endpoint used by Java API to connect to ApsaraDB for HBase Performance-enhanced Edition. columnFamily = ‘xxxxxx’, userName = ‘root’, — The username. password = ‘root’, — The password. tableName = ‘xxxxxx’);

Create an HBase result table

  1. create table liuxd_user_behavior_test_front ( row_key varchar, from_topic varchar, origin_data varchar, record_create_time varchar, primary key (row_key)) with ( type = cloudhbase’, endpoint = host:port’, The endpoint used by Java API to connect to ApsaraDB for HBase Performance-enhanced Edition. userName = root’, The username. password = root’, The password. columnFamily = ‘<yourColumnFamily>’, tableName = ‘<yourTableName>’, batchSize = 500’)

Network connection

If you use a Flink cluster in shared mode, you must connect to ApsaraDB for HBase over a Virtual Private Cloud (VPC) network. For more information, see Authorize Flink to access the VPC network. If you use a Flink cluster in exclusive mode, make sure that the Flink cluster and the HBase cluster are in the same VPC network. Otherwise, you can only use the public endpoint to connect to ApsaraDB for HBase. For more information, see Connect to a cluster. Before you connect to ApsaraDB for HBase, you must add the IP address of the Flink cluster to the HBase whitelist. For more information, see Configure a whitelist.

  1. </article>
  2. </main>