Network connectivity solutions
Before DataWorks can run data synchronization, scheduling, or other tasks, the virtual private cloud (VPC) associated with your resource group must be able to reach your data sources, including databases, data services, and other data in the target network environment. This topic describes network connectivity solutions for different network environments.
Background
Most DataWorks features, such as creating data sources, data synchronization, data analytics, data collection, and DataService Studio, operate on connected data sources or compute resources. If a data source is not in the VPC associated with your DataWorks resource group, for example, if it is in another VPC or an on-premises data center, select an appropriate connectivity solution to connect the VPC associated with the resource group to the network where the data source resides.
For example, in a data synchronization flow, the VPC associated with the resource group must be connected to the networks of both the source and the destination.

Prerequisites
You have purchased a resource group with the required specifications. For details, see Use a serverless resource group.
For more information about resource groups, see Overview of resource groups.
The solutions in this topic apply to serverless resource groups and the following legacy resource groups: exclusive resource groups for Data Integration, exclusive resource groups for scheduling, and exclusive resource groups for Data Service.
Notes
Serverless resource groups can access data sources in complex network environments over a private network by associating a VPC. However, serverless resource groups cannot access the public network by default. To reach a data source over the Internet, configure an Internet NAT Gateway and EIPs for the VPC attached to the resource group. For details, see Connect to a data source over the Internet.
Public network connections offer no speed or stability guarantees. For data synchronization, use a private network or Cloud Enterprise Network (CEN).
Network connectivity between a resource group and a data source is required before tasks can run.
Resource groups do not support classic network environments. Migrate your data sources and services from a classic network to a VPC before proceeding.
If a connectivity test fails, check the host IP address and port, database name, username, password, and database permissions, and then click Test Connectivity.
Choose a solution
Your choice depends on where your data source is relative to your DataWorks workspace resource group. Use the information below to identify the right solution based on your scenario:
Solution 1: Connect to an Alibaba Cloud data source (same account, same region)
Use cases
This solution is recommended if your data source and DataWorks workspace meet all of the following conditions:
The data source is an Alibaba Cloud product.
The data source and the DataWorks workspace belong to the same Alibaba Cloud account.
The data source and the DataWorks workspace are in the same region.
Solution description
For the same-account, same-region scenario, we recommend that you use a VPC (private network) connection. Deploy the resource group of your DataWorks workspace and the data source in the same VPC to enable network connectivity.
Network connectivity diagram
In the same-account, same-region scenario, configure network connectivity between a DataWorks serverless resource group and an ApsaraDB RDS database as follows:
On the Database Connection page of the RDS instance, confirm the VPC to which the instance belongs. For example, VPC 1 with the CIDR block 192.168.0.0/16.
On the Resource Groups page of the DataWorks console, obtain the VPC associated with the serverless resource group (VPC 2). If VPC 2 is the same as VPC 1 of the RDS instance, no changes are required. Otherwise, add a binding to VPC 1 of the RDS instance.
In the VPC Binding section of the resource group details, obtain the vSwitch CIDR block. For example, 192.168.0.0/24.
Add the vSwitch CIDR block to the whitelist on the Whitelist and Security Group page of the RDS instance. For example, 192.168.6.0/24.
Configure network connectivity
For the detailed solution description and configuration steps, see Connect to a data source in the same account and region.
Solution 2: Connect to an Alibaba Cloud data source (same account, different regions)
Use cases
This solution is recommended if your data source and DataWorks workspace meet all of the following conditions:
The data source is an Alibaba Cloud product.
The data source and the DataWorks workspace belong to the same Alibaba Cloud account.
The data source and the DataWorks workspace are in different regions.
Solution description
For the same-account, different-region scenario, we recommend that you use a VPC (private network) connection. Use a network connectivity tool (Cloud Enterprise Network or VPC Peering Connection) to connect the VPC of your DataWorks workspace resource group with the VPC where the data source resides.
Network connectivity diagram
In the same-account, different-region scenario, where DataWorks resides in the China (Shanghai) region and the database resides in the China (Hangzhou) region, configure network connectivity as follows:
View the VPC information of the database instance to obtain VPC 1, its CIDR block, such as
192.168.0.0/16, and the vSwitch CIDR block.On the Resource Groups page of the DataWorks console, find the serverless resource group that you want to use and obtain its associated VPC (VPC 2).
Use a network connectivity tool, such as Cloud Enterprise Network, to connect the VPC on the DataWorks side to the VPC on the database side.
In the VPC Binding section of the resource group details, view the associated vSwitch CIDR block, such as
172.16.0.0/24.Add the vSwitch CIDR block
172.16.0.0/24to the whitelist of the database.In the VPC Binding section of the resource group details page, click Custom Route and add a route for the CIDR block of the VPC on the database side that points to the vSwitch subnet IP range of the database.
Configure network connectivity
For the detailed solution description and configuration steps, see Connect to a data source in the same account but a different region.
Solution 3: Connect to an Alibaba Cloud data source (different accounts)
Use cases
This solution is recommended if your data source and DataWorks workspace meet all of the following conditions:
The data source is an Alibaba Cloud product.
The data source and the DataWorks workspace belong to different Alibaba Cloud accounts.
Solution description
For the different-account scenario, we recommend that you use a VPC (private network) connection. Use a network connectivity tool (Cloud Enterprise Network or VPC Peering Connection) to connect the data source under Account A with the DataWorks workspace resource group under Account B.
Network connectivity diagram
In the different-account scenario, where Account A owns the ApsaraDB RDS database and Account B owns DataWorks, configure cross-account network connectivity as follows:
On the Database Connection page of the RDS instance under Account A, obtain the VPC of the instance and its CIDR block. In this example, the CIDR block is
192.168.0.0/16.On the Resource Groups page of the DataWorks console under Account B, view the details of the serverless resource group and confirm the vSwitch CIDR block that is associated in the Data Scheduling & Data Integration section. In this example, the CIDR block is
172.16.66.0/24.Use a network connectivity tool, such as Cloud Enterprise Network, to connect the VPC of Account B to the VPC of Account A so that the two VPCs can communicate with each other.
In Whitelist Settings of the RDS instance, add the vSwitch CIDR block
172.16.66.0/24of the DataWorks resource group to the whitelist.On the resource group details page in the DataWorks console, click Custom Route and configure a route to the vSwitch CIDR block of the target RDS database.
Configure network connectivity
For the detailed solution description and configuration steps, see Connect to a data source under a different account.
Solution 4: Connect to a data source deployed on ECS
Use case
This solution is recommended if your data source meets the following condition:
The data source is deployed on an Alibaba Cloud ECS instance.
Solution description
If the ECS instance hosting the data source and DataWorks are under the same account and in the same region, we recommend that you use a VPC (private network) connection. Deploy the resource group of your DataWorks workspace and the ECS instance in the same VPC to enable network connectivity.
If the ECS instance hosting the data source and DataWorks are under different accounts or under the same account but in different regions, we recommend that you use a VPC (private network) connection. Use a network connectivity tool (Cloud Enterprise Network or VPC Peering Connection) to connect the VPC of your DataWorks workspace resource group with the VPC where the ECS instance resides.
Network connectivity diagram
Same account, same region
If the data source is deployed on an ECS instance that belongs to the same Alibaba Cloud account and resides in the same region as DataWorks, configure network connectivity as follows:
In the ECS console, view the VPC and vSwitch information of the ECS instance that you want to use, such as MySQL_on_ECS.
On the Resource Groups page of the DataWorks console, find the serverless resource group that corresponds to your workspace.
In the VPC Binding section of the resource group details, view the vSwitch CIDR block that is associated with Data Scheduling & Data Integration, such as
172.16.0.0/24.Add the vSwitch CIDR block to an inbound rule of the ECS security group. Set the protocol type to Custom TCP, the port range to MySQL(3306), the authorization object to the vSwitch CIDR block of the resource group, such as
172.16.0.0/24, and the action to Allow.
Same account, different regions
If the data source is deployed on an ECS instance that belongs to the same Alibaba Cloud account but resides in a different region from DataWorks, configure network connectivity as follows:
In the ECS console, view the VPC and vSwitch information of the ECS instance that you want to use. In this example, the instance is MySQL_on_ECS, which resides in Hangzhou Zone H and whose primary private IP address is
192.168.6.172.On the resource group details page of the DataWorks console, obtain the VPC (VPC2) bound to the resource group in the Data Scheduling & Data Integration section.
Use Cloud Enterprise Network or a VPC peering connection to connect the VPC of DataWorks, which is VPC2 in the China (Shanghai) region, to the VPC of the ECS instance, which is VPC1 in the China (Hangzhou) region.
View the vSwitch CIDR block of the DataWorks resource group, such as
172.16.0.0/24.Add an inbound rule to the ECS security group to allow access. Set the protocol type to Custom TCP, the source to the CIDR block of the DataWorks resource group
172.16.0.0/24, and the port range to MySQL(3306).Record the vSwitch CIDR block of the ECS instance. You need this CIDR block to configure a route.
On the resource group details page of the DataWorks console, click Custom Route and add a route that points to the vSwitch CIDR block of the ECS instance.
Different accounts
If the data source is deployed on an ECS instance under Alibaba Cloud Account A and DataWorks belongs to Alibaba Cloud Account B, configure network connectivity as follows:
In the ECS console of Account A, obtain the VPC and vSwitch information of the MySQL_on_ECS instance. In this example, the instance resides in Hangzhou Zone H and its primary private IP address is
192.168.6.172.In the DataWorks console of Account B, view the details of the serverless resource group and confirm that the vSwitch CIDR block associated with Data Scheduling & Data Integration is
172.16.66.0/24.Establish a cross-account VPC connection between VPC2 on the DataWorks side and VPC1 on the ECS side.
Add an inbound rule to the ECS security group to allow access. Set the protocol type to Custom TCP, the authorization object to
172.16.66.0/24, which is the vSwitch CIDR block of the DataWorks resource group, and the port range to MySQL(3306).On the resource group details page in the DataWorks console, click Custom Route and add a route that points to the vSwitch CIDR block of the ECS instance.
Configure network connectivity
For the detailed solution description and configuration steps, see Connect to a data source deployed on ECS.
Solution 5: Connect to a data source in an on-premises IDC
Use case
This solution is recommended if your data source meets the following condition:
The data source is deployed in an on-premises IDC.
Solution description
For data sources deployed in an on-premises IDC, we recommend that you use a VPC (private network) connection. Use a network connectivity tool (Express Connect) to connect the on-premises network where the data source resides with the VPC of your DataWorks workspace resource group.
If your data source is deployed in a third-party cloud, such as Huawei Cloud MRS or AWS RDS, you can also use this solution. Use a network connectivity method such as VPN or Express Connect to connect the third-party cloud network to the VPC of the resource group in your DataWorks workspace. After the connection is established, use the internal endpoint of the data source. If the data source has a public endpoint, see Solution 6: Connect to a data source over the Internet. For key configuration points, see Network connectivity for data sources in third-party clouds.
Network connectivity diagram
To connect to a data source that is deployed in an on-premises IDC, MySQL in this example, perform the following steps:
Confirm the CIDR block of the IDC, such as
172.16.10.0/24.In the DataWorks console, obtain the information about the resource group associated with Data Scheduling & Data Integration.
Use an Express Connect circuit to connect the VPC to the IDC.
View the vSwitch CIDR block that is associated with the resource group, such as
192.168.0.0/24.Configure whitelist and firewall rules on the MySQL database in the IDC to allow access from the vSwitch CIDR block of the resource group. Whitelist example:
CREATE USER 'dataworks_user'@'192.168.0.0/24' IDENTIFIED BY 'StrongPassword123';andGRANT ALL PRIVILEGES ON mydatabase.* TO 'dataworks_user'@'192.168.0.0/24' WITH GRANT OPTION;. Firewall example:sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.0.0/24" port="3306" protocol="tcp" accept'.On the resource group details page, click Custom Route and add a route for the CIDR block of the IDC.
Configure network connectivity
For the detailed solution description and configuration steps, see Connect to a data source in an on-premises IDC.
Solution 6: Connect to a data source over the Internet
Use case
This solution is recommended if your data source meets the following condition:
The data source has a public endpoint.
Solution description
Serverless resource groups cannot access the public network by default. You must configure an Internet NAT Gateway and EIPs for the VPC attached to the resource group before you can access data sources over the Internet.
Legacy resource groups have public network access by default and can connect directly.
NoteLegacy resource groups are being phased out. We recommend that you use serverless resource groups.
Network connectivity diagram
The diagram applies only to serverless resource groups. Legacy resource groups already have EIPs attached by default and can connect directly.

Configure network connectivity
For the detailed solution description and configuration steps, see Connect to a data source over the Internet.
Network connectivity for data sources in third-party clouds
Use case
This solution applies when your data source is deployed in a third-party cloud other than Alibaba Cloud, such as Huawei Cloud MRS, AWS RDS, or Tencent Cloud MySQL.
Connection methods
Internal network connection (recommended): Use VPN, Express Connect, or another network connectivity method to connect your Alibaba Cloud VPC to the third-party cloud environment, and then use the internal endpoint of the data source. This method improves connectivity and stability. For instructions, see Solution 5: Connect to a data source in an on-premises IDC.
Public network connection: If the data source has a public endpoint, configure an Internet NAT Gateway and an EIP for the VPC attached to the resource group. Public network connections can be affected by cross-border network restrictions or network jitter. To access a data source outside the Chinese mainland that has regional restrictions, establish cross-border connectivity by using a network service such as VPN Gateway or Express Connect. For instructions, see Solution 6: Connect to a data source over the Internet.
Key configuration points
Obtain the CIDR block where the data source resides in the third-party cloud. You can view the CIDR block in the third-party cloud console or contact your network administrator.
For an internal network connection, add a custom route for the CIDR block of the third-party cloud data source to the DataWorks resource group.
Configure the whitelist, security group, or firewall of the third-party cloud service to allow access from DataWorks:
For an internal network connection, allow the vSwitch CIDR block of the resource group.
For a public network connection, allow the EIP associated with the Internet NAT gateway. Allowing only the vSwitch CIDR block does not enable public network access.
For service-specific whitelist procedures, see the official documentation of the third-party cloud service.
If the endpoint of the data source is a domain name and domain name resolution fails, use PrivateZone to configure internal DNS resolution for the VPC attached to the resource group.
In a workspace in standard mode, make sure that the data source endpoints in both the development and production environments are reachable.
After the configuration is complete, use Test Connectivity to verify the network connection.
Additional information
Direct access to Alibaba Cloud data sources in the same VPC
When a DataWorks resource group and an Alibaba Cloud data source, such as ApsaraDB RDS for MySQL, ApsaraDB RDS for SQL Server, or AnalyticDB, are deployed in the same VPC, the resource group can access the data source directly over the private network. No additional network connectivity tool is required.
Recommended method: Use a VPC private network connection. When you add the data source, select the VPC and vSwitch where the data source resides. Private network connections provide lower latency and greater stability and do not consume public network bandwidth.
Alternative method: If the data source also supports public network access, you can enter its public endpoint in connection string mode. Public network connections are affected by bandwidth and network fluctuations. Use this method only when a private network connection is unavailable.
Direct access to self-managed data sources in the same VPC
When a DataWorks resource group and a self-managed data source, such as MySQL or SQL Server deployed on an ECS instance, are in the same VPC, the resource group can access the data source directly over the VPC private network. No additional Data Integration network connectivity tool is required.
When you add the data source, select the VPC and vSwitch where the ECS instance resides, and enter the private IP address and port of the database.
Make sure that the database listens on its private IP address and that the ECS security group rules allow access from the VPC CIDR block of the DataWorks resource group.
If the self-managed data source also supports public network access, you can use its public endpoint in connection string mode. We recommend that you use the VPC private network for greater stability.
Egress IP addresses and whitelists for external data sources
When you use a serverless resource group to access an external data source outside Alibaba Cloud, such as Microsoft Azure Databricks or a self-managed SQL Server database, configure the data source whitelist to allow access from DataWorks. Serverless resource groups cannot access the Internet by default. To access an external data source over the Internet, first associate a VPC with the resource group and configure an Internet NAT gateway and an elastic IP address (EIP) in that VPC. After configuration, obtain the egress IP address based on the network path and add it to the data source whitelist:
Access method | How to obtain the egress IP address | Whitelist configuration |
Access an external data source over the Internet | In the NAT Gateway console, view the EIP associated with the Internet NAT gateway. | Add the EIP to the access whitelist of the external data source, such as Databricks or SQL Server. |
Access a data source over the private network in the same VPC | Use the CIDR block of the VPC associated with the resource group. | Add the VPC CIDR block to the access whitelist of the data source. |
FAQ
Q: What do I do if a data source connectivity test returns Communications link failure or connect timed out?
A: When you run Test Connectivity for a data source by using a serverless resource group, the Communications link failure or connect timed out error typically indicates that the resource group cannot reach the target public data source because it has no Internet access by default. Perform the following checks:
Confirm the resource group type. A serverless resource group cannot access the Internet by default. Configure an Internet NAT gateway and an EIP for the VPC associated with the resource group.
In the VPC console, check whether the associated VPC has a NAT gateway with an EIP. If not, create the NAT gateway, associate an EIP, and configure SNAT rules.
Make sure that the firewall or security group of the target data source allows access from the EIP.
After configuration, return to the Data Integration page in DataWorks and rerun Test Connectivity to verify the connection.
Q: What do I do if the data source connectivity test succeeds but a task encounters a network error?
A: If Test Connectivity succeeds but a task fails with a network connectivity error, the test and the task may use different resource groups. Check the following scenarios:
Scenario 1: An incorrect resource group is selected in the scheduling configuration
Open the Scheduling Configuration of the task node and make sure that the selected resource group can reach the target data source. If the resource group is incorrect, change it, save the configuration, and rerun the node.
Scenario 2: The resource group in the workflow runtime configuration is inconsistent
Check the Runtime Configuration on the right side of the node editor. Make sure that the displayed resource group matches the resource group that passed Test Connectivity. Workflow-level runtime settings may override node-level scheduling settings.
Scenario 3: The resource group and data source are in different VPCs, or the whitelist is incomplete
If resource group creation or connectivity fails, check the following:
Check whether the resource group and data source are associated with the same VPC. If they are in different VPCs, use the appropriate network connectivity solution to connect the networks.
Check whether the data source whitelist includes the VPC CIDR block of the DataWorks resource group. You can view the CIDR block on the Resource Groups page.
References
For more information about resource groups, see Overview of DataWorks resource groups.
To create and use a resource group, see Use serverless resource groups.
To configure network connectivity for the VPC associated with a resource group, see Configure network connectivity.
To configure an Internet NAT gateway for the VPC and vSwitch associated with a resource group, see Use the SNAT feature of an Internet NAT gateway to access the Internet.
For common questions about network connectivity, see Resource group operations and network connectivity.