To allow Realtime Compute in shared mode to access storage resources in a Virtual Private Cloud (VPC), you must grant Realtime Compute the permission to access the VPC. This topic describes how to grant Realtime Compute the permission to access a VPC.

Background

Realtime Compute projects in shared mode are deployed in a classic network. To allow Realtime Compute to access storage resources in a VPC, you must grant it the permission to access the VPC. Currently, Realtime Compute is allowed to access only ApsaraDB for RDS instances in a VPC.
Note
  • Realtime Compute clusters in exclusive mode reside in VPCs and therefore can access the VPCs without authorization.
  • After you grant Realtime Compute in shared mode the permission to access a VPC, some performance issues may occur when Realtime Compute accesses the storage resources in the VPC. For example, the bandwidth may be restricted. To avoid such issues, we recommend that you do not access storage resources in a VPC from Realtime Compute in shared mode.

Procedure

  1. Log on to the Realtime Compute development platform.
  2. Move the pointer over the username in the upper-right corner.
  3. In the drop-down list, click Project Management.
  4. In the left-side navigation pane, click VPC Access Authorization.
  5. In the upper-right corner of the VPC Access Authorization page, click Add Authorization.
  6. In the Authorize StreamCompute VPC Access dialog box, configure the parameters. The following table describes these parameters.
    Parameter Description
    Name The name of the VPC.
    Region The region where the storage resource resides.
    VPC ID The ID of the VPC.
    Note To view the VPC ID of an ApsaraDB for RDS instance, follow these steps:
    1. Log on to the ApsaraDB for RDS console.
    2. In the top navigation bar, select the region where the target RDS instance resides.
    3. Find the target RDS instance and click its instance ID.
    4. In the left-side navigation pane, click Database Connection.
    5. Navigate to Instance Connection > Database Connection > Network Type to view the VPC ID. Example: vpc-bp1lysht98wrvl9n3****.
    Instance ID The instance ID of the storage resource in the VPC.
    Note To view the ID of an ApsaraDB for RDS instance, follow these steps:
    1. Log on to the ApsaraDB for RDS console.
    2. In the top navigation bar, select the region where the target RDS instance resides.
    3. Find the target RDS instance and click its instance ID to go to the Basic Information page.
    4. In the Basic Information section, view the instance ID.
    Instance Port The port of the storage resource in the VPC.
    Note For more information about how to view the port of an ApsaraDB for RDS instance, see View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for MySQL instance.

FAQ

Q: How do I configure the url parameter when I use a DDL statement to reference a storage resource in a VPC?

A: You can configure the url parameter in the WITH clause based on the Mapping IP Address and Mapping Port parameters on the VPC Access Authorization page, for example, url='jdbc:mysql://<mappingIP>:<mappingPort>/<databaseName>'. To obtain the Mapping IP Address and Mapping Port, follow these steps:
  1. Log on to the Realtime Compute development platform.
  2. Move the pointer over the username in the upper-right corner.
  3. In the drop-down list, click Project Management.
  4. In the left-side navigation pane, click VPC Access Authorization.
  5. On the VPC Access Authorization page, view the Mapping IP Address and Mapping Port.