When you create a Google Cloud data source or configure a migration task in OceanBase Cloud, you can use a peering connection to access the VPC network where the data source resides. This topic describes how to create a Google Cloud data service peering connection and how to use an existing connection to configure a data source.
Background
A VPC Network Peering connection enables private communication between two VPC networks. OceanBase Cloud supports the following types of peering connections:
- Instance peering connection: Connects the VPC network of your application to the VPC network of an OceanBase Cloud instance so that the application can access the database.
- Data service peering connection: Connects the OceanBase Cloud data service VPC network to the VPC network of a data source so that data migration, synchronization, and validation tasks can access the data source.
This topic describes how to configure and use a Google Cloud data service peering connection.
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 Google Cloud account that has the permissions required to create VPC Network Peering connections and adjust firewall or other network rules.
You have obtained the project ID, VPC network name, and IPv4 CIDR block of the VPC network where the data source resides. To find this information:
- On the VPC networks page in the Google Cloud console, view the VPC network name. In the subnet information, find the IPv4 CIDR block that contains the private IP address of the data source.
- Identify the project that contains the VPC network of the data source and obtain its project ID.
Considerations
- The Local Region selected in OceanBase Cloud must be the same as the Google Cloud region of the data source.
- The subnet CIDR blocks of the two VPC networks cannot overlap. For more information, see VPC Network Peering.
- In the same cloud vendor and region, you cannot create multiple data service peering connections for the same peer VPC network. Use an existing connection if one is available.
- By default, you can create up to five data service peering connections for the same Google Cloud project ID in the same region. If the limit is reached, delete connections that are no longer used before you create another one.
- Google Cloud managed Kafka instances do not support VPC peering connections. The VPC peering connection option is not displayed for a Google Cloud managed Kafka data source in Data Sources, Migrations, or Data Validation.
Create a peering connection for the first time
If no data service peering connection is available, create one in OceanBase Cloud and create the corresponding VPC Network Peering connection in Google Cloud. Google Cloud exchanges subnet routes automatically after the peering connection is established. You do not need to add a separate routing policy.
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) page, click Create.
In the Create data service peering connection dialog box, configure the following parameters under Step 1: Configure the peering connection.
ParameterDescriptionCloud provider Select Google Cloud. Local region Select the region where the peer data source resides. In the VPC of the peer data source instance section, click Virtual Private Cloud to go to the VPC networks page in the Google Cloud console. Obtain the VPC network information and configure the following parameters.
ParameterDescriptionPeer project ID Enter the ID of the Google Cloud project that contains the VPC network of the data source. On the VPC networks page in the Google Cloud console, identify the project that contains the VPC network and obtain its project ID. Peer VPC name Enter the name of the VPC network where the data source resides. You can view it on the VPC networks page in the Google Cloud console. Peer CIDR On the VPC networks page in the Google Cloud console, view the subnet information for the VPC network of the data source to obtain the IPv4 CIDR block. Note
- Enter the IPv4 CIDR blocks to access. 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 OceanBase Cloud creates its side of the peering connection, proceed to Step 2: Accept the connection.
Step 2: Create the peering connection in Google Cloud
The OceanBase Cloud console names this section Step 2: Accept the connection. For Google Cloud, you need to create the corresponding peering connection in your Google Cloud project instead of accepting a request.
When the connection status in the list is Pending acceptance, click Continue. Under Step 2: Accept the connection, the page displays Waiting for connection. Record the following information.
ParameterDescriptionPeering connection name The name generated by OceanBase Cloud for the peering connection. Local project ID The Google Cloud project ID of the OceanBase Cloud data service VPC network. Local VPC name The name of the OceanBase Cloud data service VPC network. Click the Peering connections link to go to the VPC Network Peering page in the Google Cloud console, and click Create peering connection.
Configure the peering connection in Google Cloud.
ParameterDescriptionPeering connection name Enter a custom name. You can use the Peering connection name displayed in OceanBase Cloud. Your VPC network Select the VPC network where the data source resides. Peered VPC network Select In another project. Project ID Enter the Local project ID displayed in OceanBase Cloud. VPC network name Enter the Local VPC name displayed in OceanBase Cloud. Select Import custom routes and Export custom routes, and click Create. After the VPC Network Peering connection is established, Google Cloud exchanges subnet routes automatically. No separate routing policy is required.
Return to the OceanBase Cloud console. Under Step 2: Accept the connection, click Checking connection status. After the page displays Connection successful, the connection status changes to Connected.
Use an existing peering connection
If a data service peering connection is in the Connected state, you can select it when you create a data source.
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 Google Cloud, select the region 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 name 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. The connection address can be an IP address or domain name. If you use a domain name, make sure that it can be resolved to a reachable private IP address in the data service network.
Click Test Connection. After the connection 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 directly configure a data source in the task. For task-specific instructions, see the relevant topic under Migrate data.
Note
A Connected peering connection does not indicate that the database connection test will succeed. If the test fails, check the VPC Network Peering configuration, imported and exported routes, firewall rules, DNS resolution, database listening port, and account permissions.
Follow-up operations
Continue the configuration
If the connection configuration is incomplete, on the Peering connection (Data services) page, find the connection in the Pending acceptance state, and click Continue to complete the Google Cloud configuration.
Delete a peering connection
On the Peering connection (Data services) page, check Associated resources for the target connection. If the connection has associated resources, release the resources after you confirm that they are no longer required.
In the Actions column of the target connection, click the delete icon and confirm the operation.
In Google Cloud, delete the user-side VPC Network Peering connection and other configurations that are no longer required.
Warning
- Deleting a peering connection interrupts network access through the connection and cannot be undone. OceanBase Cloud removes only the configuration that it manages. You must remove the remaining user-side configuration.
- 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.
