When you create a Huawei Cloud data source or configure a migration task in OceanBase Cloud, you can use a peering connection to access the VPC where the data source resides. This topic describes how to create a Huawei Cloud data service peering connection and use an existing connection to configure a data source.
Background
VPC peering enables private communication between two VPCs. OceanBase Cloud supports two types of peering connections:
- Instance peering connection: Connects the VPC of your application to the VPC of an OceanBase Cloud instance so that the application can access the OceanBase Cloud database.
- Data service peering connection: Connects the OceanBase Cloud data service VPC to the VPC of a data source so that migration, synchronization, and validation tasks can access the data source.
This topic describes how to configure and use Huawei Cloud data service peering connections.
Prerequisites
You have registered an OceanBase Cloud account and have the Organization Admin, Project Admin, or Data Services Admin role required to manage data service peering connections.
You use a Huawei Cloud account with the permissions required for the operations you need to perform, such as accepting peering connection requests, configuring route tables, and adjusting security groups or other network rules.
You have obtained the VPC ID, IPv4 CIDR block, and Huawei Cloud project ID for the region of the VPC where the data source resides. To find this information:
- View the VPC ID and IPv4 CIDR block (the VPC address range) in the Huawei Cloud VPC console. For instructions, see Obtain a VPC ID.
- In the Huawei Cloud console, open the username drop-down menu in the upper-right corner and click My Credentials. Find the project for the region where the VPC resides and copy its project ID. Use the Huawei Cloud project ID for that region, not a Huawei Cloud account ID or an OceanBase Cloud project ID. For instructions, see Obtain the peer project ID for a peering connection.
Considerations
- When you create a peering connection, the local region selected in OceanBase Cloud must match the Huawei Cloud region of the peer VPC. The peer project ID must also correspond to that region.
- The CIDR blocks that need to communicate must not overlap, as this can affect routing.
- In the same cloud vendor and region, you cannot create multiple data service peering connections for the same peer VPC. Use an existing connection if one is available.
- By default, you can create up to five data service peering connections for the same Huawei Cloud project ID in the same region. If the limit is reached, remove connections that are no longer used and try again.
Create a peering connection for the first time
If no data service peering connection is available, create one in OceanBase Cloud, accept the request and configure routes in Huawei Cloud, and then use the connection to configure a data source.
Step 1: Configure the peering connection
Log in to the OceanBase Cloud console. In the left-side navigation pane, click Networking.
On the Peering connection (Data services) tab, click Create.
In the Create data service peering connection dialog box, under Step 1: Configure the peering connection, configure Cloud provider and Local region.
ParameterDescriptionCloud provider Select Huawei Cloud. Local region Select the Huawei Cloud region where the VPC of the peer data source resides. In the VPC of the peer data source instance section, click Virtual Private Cloud to go to the Huawei Cloud console. Obtain the VPC information for the data source and configure the following parameters.
ParameterDescriptionPeer project ID Enter the Huawei Cloud project ID for the region of the VPC where the data source resides. You can view it on the My Credentials page in the Huawei Cloud console. For instructions, see Obtain the peer project ID for a peering connection. Do not enter a Huawei Cloud account ID or an OceanBase Cloud project ID. Peer VPC ID Enter the ID of the VPC where the data source resides. You can view it in the Huawei Cloud VPC console. For instructions, see Obtain a VPC ID. Peer CIDR View the IPv4 CIDR block (the VPC address range) of the VPC where the data source resides in the Huawei Cloud VPC console. For instructions, see Obtain a VPC ID. Note
- Enter the IPv4 CIDR blocks to access in the peer VPC. Make sure that they include the private IP address of the data source.
- To add multiple CIDR blocks, press Enter after each CIDR block.
Click Create. After you submit the creation request, record the peering connection ID, local VPC ID, and local CIDR block displayed on the page. You will use this information to accept the request and configure routes.
Step 2: Accept the connection
In OceanBase Cloud, under Step 2: Accept the connection, view the connection status and the following local VPC information. If the status is Waiting for connection, go to Huawei Cloud to accept the peering connection request from the local VPC.
ParameterDescriptionPeering connection ID The ID of the peering connection being created. Use it to find the request in Huawei Cloud. Local project ID The Huawei Cloud project ID for the region of the OceanBase Cloud data service VPC. Local VPC ID The ID of the OceanBase Cloud data service VPC. Local CIDR The CIDR block of the OceanBase Cloud data service VPC. Use it when you configure the routing policy. In this section, click Peering connections to go to the Huawei Cloud peering connections page and accept the request from the local VPC.
Accept the request promptly. If the Huawei Cloud time limit expires, the peering connection cannot be created. For more information, click Learn more in OceanBase Cloud.
Return to the OceanBase Cloud console. Under Step 2: Accept the connection, click Checking connection status. After confirming that the request has been accepted, configure routes.
Step 3: Add a routing policy
In OceanBase Cloud, under Step 3: Add a route policy, click Peering connections to go to the Huawei Cloud peering connections page.
Follow the instructions in OceanBase Cloud. In the search box, enter the Peering connection ID displayed in OceanBase Cloud. Open the connection details page and click Route list.
Click Add Route and follow the instructions to select the route table. Set the destination CIDR block to the Local CIDR displayed in OceanBase Cloud.
Return to the OceanBase Cloud console. Under Step 3: Add a route policy, click Complete. This step is marked as complete, and the connection status in the list changes to Connected.
Use an existing peering connection
If a data service peering connection is already in the Connected state, select it when you create a data source. You do not need to create another connection.
Log in to the OceanBase Cloud console. In the left-side navigation pane, choose Data Services > Data Source.
Click Create Data Source and select the data source type.
Set Cloud provider to Huawei Cloud, select the region of the data source and an instance type that supports peering connections, and set Connection type to Peering connection.
Select the target connection from the Peering connection ID drop-down list. Verify that its peer VPC ID and peer CIDR block match the network of the data source.
The list displays only connections in the Connected state for the selected cloud vendor and region. If no connection is available, complete the steps in Create a peering connection for the first time.
Enter the private connection address, port, and authentication information required for the data source type and authentication method. The connection address can be an IP address or domain name. If you use a domain name, make sure that it resolves to a reachable private IP address in the data service network.
Click Test Connection. After the test succeeds, click Save.
For information about other data source parameters, see Create a data source. You can reference the data source in a migration task or select the peering connection when you configure a data source directly in the task. For task-specific instructions, see the relevant topic under Migrate data.
Note
A peering connection in the Connected state does not mean that the database connection will succeed. If the connection test fails, check whether the route table is associated with the subnet of the data source and whether the security group, network ACL, DNS resolution, database listening port, and account permissions are correctly configured.
Follow-up operations
Continue the configuration
If the creation process is incomplete, on the Networking > Peering connection (Data services) page, find the connection in the Pending acceptance or Route configuration pending state. Click Continue to complete the remaining steps.
Delete a peering connection
On the Peering connection (Data services) page, check Associated resources for the target connection and confirm that no tasks still need it. You cannot delete a connection with associated resources. Release those resources only after confirming that they are no longer required.
In the Actions column of the target connection, click Delete. Read the prompt and confirm the deletion.
In the Huawei Cloud console, verify that the peering connection and its associated routes have been deleted. Remove any remaining user-side configuration that is no longer required.
When Huawei Cloud deletes a peering connection, it also deletes the associated routes from the route tables of both VPCs. For more information, see Delete a VPC peering connection.
Warning
- Deleting a peering connection interrupts network access through the connection and cannot be undone. Check the user-side configuration after deletion. When removing configuration, do not affect network rules that other workloads still use.
- You cannot modify the peering connection of an existing data source. To use another peering connection, create a data source and select it when you configure subsequent tasks.
