Updated on 2022-07-04 GMT+08:00

Enhanced Datasource Connections

The enhanced datasource connection uses VPC peering at the bottom layer to directly connect the VPC network between the DLI cluster and the destination datasource. Data is exchanged in point-to-point mode. The enhanced datasource connection function supports all cross-source services implemented by DLI, including HBase, CloudTable OpenTSDB, MRS OpenTSDB, DWS, RDS, CSS, DCS, and DDS. In addition, UDFs, Spark jobs, and Flink jobs can be used to access self-built data sources.

  • The CIDR block of the DLI queue which is bound with a datasource connection cannot overlap with that of the data source.
  • Datasource connections cannot be created for the default queue.
  • To access a datasource connection table, you need to use the queue for which a datasource connection has been created.
  • The preview function is not supported for datasource tables.

It has the following functions:

Enhanced Datasource Connection Page

This page displays all enhanced datasource connections. If there are a large number of connections, they are displayed on multiple pages.

Table 1 Datasource connection list parameters

Parameter

Description

Connection Name

Name of the created datasource connection.

Connection Status

Status of a datasource connection. Currently, the console displays only connections in the Active state.

VPC

The VPC used by the destination data source.

Subnet

The subnet used by the destination data source.

Created

Time when a connection is created. The connections in the connection list can be displayed according to the creation time in ascending or descending order.

Operation

  • Delete Connection: Delete a created datasource connection.
  • Routing Info: Used to display the custom route information of the datasource connection.
  • Modify Host: Customize the IP address corresponding to the host or domain name.
  • Bind Queue: After the binding queue is executed, the bound queue can use the enhanced datasource connection to the data source.
  • More:
    • Unbind Queue: Unbind a datasource connection from a queue.
    • Add Route: Add a custom route for the datasource connection.
    • Delete Route: Delete a custom route for a datasource connection.
    • Manage Permissions: Authorize or reclaim permissions for other projects.

Creating a Connection

The following describes how to create a datasource HBase connection for MRS.

Only enhanced datasource connection to MRS HBase is supported.

  1. Apply for a cluster in MRS.

    If a cluster is available, you do not need to apply for one.

  2. In the navigation pane of the DLI management console, choose Datasource Connections.
  3. Click the Enhanced tab and click Create in the upper left corner.

    Enter the Connection Name, select the Bind Queue (optional), VPC, and Subnet, and enter the Host Information (optional). For details about the parameters, see Table 2.

    Table 2 Parameters

    Parameter

    Description

    Connection Name

    Name of the created datasource connection.

    • The name can contain only letters, digits, and underscores (_). The parameter must be specified.
    • The connection name contains up to 64 characters.

    Bind Queue

    (Optional) Bind a queue that requires datasource connections.

    NOTE:

    Before using an enhanced datasource connection, you must bind a queue and ensure that the VPC peering connection is in the Active state.

    VPC

    The VPC used by the destination data source.

    Subnet

    The subnet used by the destination data source.

    Host Information

    (Optional) The IP address corresponding to the host or domain name. Enter one record in each line. The format is as follows: IP address Host name/Domain name. When connecting to the HBase cluster of MRS, you need to configure the host name and IP address of the ZooKeeper instance.

    To go to the MRS cluster management page, perform the following steps:

    1. In the MRS cluster list, click the name of the target cluster. The Overview page is displayed.
    2. In the Basic Information area of the cluster, locate the row that contains the target cluster and click View in the Operation column.
    3. Enter the username and password, and click Log In. (The username and password are set when you apply for an MRS cluster. The default username is admin.)
    4. Click the Service Management tab.
    5. Access the ZooKeeper service.
    6. Click the Instance tab to view the corresponding service IP address. You can select any service IP address.
    NOTE:

    If the MRS cluster has multiple IP addresses, enter any service IP address when creating a datasource connection.

  4. Click OK.

Searching for a Connection

On the Enhanced page, you can enter the keyword of a connection name in the search box to search for the matching connection.

Viewing Connection Details

On the Enhanced page, select a connection and click to view its details. The connection ID and host information are included.

Viewing Details about a Bound Queue

On the Enhanced page, select a connection and click the connection name to view the information about the bound queue.
Table 3 Parameters in the datasource connection queue details list

Parameter

Description

VPC Peering ID

Specifies the ID of the VPC peering connection created in the cluster to which the queue belongs.

NOTE:

A VPC peering connection is created for each queue bound to an enhanced datasource connection. The VPC peering connection is used for cross-VPC communication. Ensure that the security group used by the data source allows access from the DLI queue CIDR block, and do not delete the VPC peering connection during the datasource connection.

Queue

Name of a bound queue.

Connection Status

Datasource connection status. The following three statuses are available:

  • Creating
  • Active
  • Failed
NOTE:

If the connection status is Failed, click on the left to view the detailed error information.

Updated

Time when a connection is updated. The connections in the connection list can be displayed according to the update time in ascending or descending order.

Operation

Unbind Queue: This operation is used to unbind a datasource connection from a queue.

Deleting a Connection

On the Enhanced page, click Delete Connection in the Operation column to delete unnecessary connections.

A connection with Connection Status of Creating cannot be deleted.

Binding a Queue

  • Method 1:

    On the Enhanced page, select a connection and click Bind Queue in the Operation column. In the dialog box that is displayed, select the queues to be bound and click OK.

  • Method 2:

    Click the name of the selected connection. The Connection Details page is displayed. Click Create in the upper left corner. In the dialog box that is displayed, select the queues to be bound and click OK.

Unbinding a Queue

  • Method 1:

    On the Enhanced page, select a connection and click More > Unbind Queue in the Operation column. In the dialog box that is displayed, select the queues to be unbound and click OK.

  • Method 2:

    Click the name of the selected connection. The Connection Details page is displayed. Select the queue to be unbound and click Unbind Queue in the Operation column. In the displayed dialog box, confirm the queue to be unbound and click OK.

Modifying the Host Information

On the Enhanced page, select a connection and click Modify Host. In the dialog box that is displayed, enter the host information. The format is Host IP address Host name/Domain name. Multiple records are separated by line breaks.

  • After this configuration, all host information is overwritten.
  • The host name or domain name can contain a maximum of 128 characters, including digits, letters, underscores (_), hyphens (-), and periods (.). It must start with a letter.

Custom Route Information

You can add custom routes to enhanced datasource connections.

  • Viewing route information

    On the Enhanced page, select a connection and choose Routing Info in the Operation column to view the route information of the datasource connection.

  • Adding a route

    On the Enhanced page, select a connection and choose More > Add Route in the Operation column, or click Add Route on the Routing Info page to add a custom route for the datasource connection. In the displayed dialog box, enter the route name and route CIDR block. For details about the parameters, see Table 4.

    Table 4 Parameters in the custom route details list

    Parameter

    Description

    Connection Name

    Name of the connection for which a route is to be added.

    Route Name

    Name of a custom route, which is unique in the same enhanced datasource scenario. The name contains 1 to 64 characters, including digits, letters, underscores (_), and hyphens (-).

    IP Address

    Custom route CIDR block. The CIDR block of different routes can overlap but cannot be the same.

  • Deleting a route

    On the Enhanced page, select a connection and choose More > Delete Route in the Operation column, or click Delete Route on the Routing Info page to delete a custom route for the datasource connection.

Managing Permissions

You can grant or revoke permissions for enhanced datasource connections of other projects.

  • Grant permissions: In the Manage Permissions dialog box, select Add IAM User and enter the ID of the project to be authorized.

    After a project is authorized, you can log in to the system as a user of the authorized project or switch to the corresponding project. On the Enhanced tab page, you can view the authorized datasource connection and bind the created queue to the datasource connection. Cross-project datasource connections and routes can be created.

    • If the authorized projects belong to different users in the same region, you can use the user account of the authorized projects to log in.
    • If the authorized projects belong to the same user in the same region, you can use the current account to switch to the corresponding project.

    For example, if project B needs to access the data source of project A, perform the following operations:

    • For Project A:
      1. Log in to DLI using the account of project A.
      2. Create an enhanced datasource connection ds in DLI based on the VPC information of the corresponding data source.
      3. Grant project B the permission to access the enhanced datasource connection ds.
    • For Project B:
      1. Log in to DLI using the account of project B.
      2. Bind the enhanced datasource connection ds to a queue.
      3. (Optional) Set host information and create a route.

    After creating a VPC peering connection and route between the enhanced datasource connection of project A and the queue of project B, you can create a job in the queue of project B to access the data source of project A.

  • Revoke: In the Manage Permissions dialog box, select Revoke Permission and select the ID of the project whose permissions need to be revoked.