When your PolarDB for PostgreSQL cluster needs to query a self-managed database on an ECS instance using foreign data wrapper (FDW) external tables or dblink, you must first create a network channel to establish the connection between the two. This topic describes how to create that channel from the PolarDB console.
Prerequisites
Before you begin, ensure that you have:
-
A PolarDB for PostgreSQL cluster running version 14 or earlier
-
An Enterprise Edition cluster
-
A self-managed PostgreSQL or Oracle database hosted on an ECS instance
-
The ECS instance deployed in a virtual private cloud (VPC)
-
The PolarDB for PostgreSQL cluster and the ECS instance in the same Alibaba Cloud account and region
Limits
-
Each PolarDB for PostgreSQL cluster supports up to three network channels per region.
Create a network channel
-
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the target region, then click the cluster ID to go to the Basic Information page.
-
In the left-side navigation pane, choose Settings and Management > Databases.
-
On the Databases page, click the Network Channels tab.
-
Select Network Channels to Self-managed Databases.
-
Click Create Network Channels to Self-managed Databases, then configure the parameters described in the following table.
Parameter Description Channel Name A name for the network channel. Use this name when you configure FDW external tables or dblink for cross-database queries. The name must contain lowercase letters and can contain digits and underscores ( _). It must start and end with a lowercase letter or a digit, and can be up to 64 characters long.Source Instance Name The name of the current PolarDB for PostgreSQL cluster. This value is fixed and read-only. Region of Destination Instance The region of the ECS instance, such as cn-hangzhou. This value is fixed to match the current cluster's region. To find the region ID, check the ECS instance details in the ECS console, or call the DescribeInstances API.VPC of Destination Instance The ID of the VPC in which the ECS instance resides. To find it, log on to the ECS console, go to the Instance Details page of the ECS instance, and check the Configuration Information section. VPC ID of Destination Instance The primary private IP address of the ECS instance. Despite the parameter name, this field requires the IP address, not a VPC ID. To find it, log on to the ECS console, go to the Instance Details page of the ECS instance, and check the Configuration Information section. VPC Port of Destination Instance The port that the self-managed database listens on. Remarks (Optional) A description for the network channel. -
Click OK.