This topic describes how to create a Private Link endpoint for a tenant using Alibaba Cloud Private Link, migrate from an existing private connection to Private Link, and update an endpoint after changing the zones of a database proxy cluster.
Prerequisites
Alibaba Cloud
- Register an Alibaba Cloud account and obtain your primary account ID.
- Have the VPC ID and vSwitch ID for your application clients ready. Select the target region in the VPC console and find both IDs in the vSwitch list. See Obtain VPC information.
- Make sure you have permission to create endpoints, change endpoint zones, and configure security groups.
OceanBase Cloud
Register an OceanBase Cloud account, create a cluster instance, and create a tenant.
Enable Private Link. If it is not enabled, contact OceanBase Cloud Technical Support.
Verify that the database proxy cluster meets the following requirements.
- The proxy cluster uses architecture version 2.0. After you enable Private Link, a version 1.0 proxy cluster cannot create an original private connection address or a Private Link endpoint. Upgrade the proxy cluster to version 2.0 before creating an address. For more information, see Manage database proxy.
- The proxy cluster serves only one access endpoint of one tenant. This can be a primary, read-only, or read/write splitting endpoint. If the proxy cluster serves multiple access endpoints, click Change configuration for the target endpoint and create a separate proxy cluster for that endpoint.
- The proxy cluster does not have a Pending Switch tag. If you are replacing an existing private connection address with a Private Link endpoint and the proxy cluster has a Pending Switch tag, click Change configuration to complete the deployment mode switch first. Create the Private Link endpoint after the tag disappears.
Usage notes
After Private Link is enabled for a UID, subsequent private connection addresses covered by this feature use Private Link instead of the original private connection mode. Existing private connection addresses are not migrated automatically. We recommend deleting them after you migrate your applications as described in this topic.
You cannot change a tenant's primary zone while the tenant has both an original private connection address and a Private Link endpoint.
Migrate an existing private connection to Private Link
If the tenant uses an existing private connection address, read the following considerations before creating a Private Link endpoint. Otherwise, proceed to Create a Private Link endpoint.
Migration considerations
- Impact on public connections: If the target access endpoint also has a public connection, creating a Private Link endpoint may involve migrating the public load balancer and interrupting existing connections. Schedule a maintenance window and ensure that clients can reconnect automatically. Recovery time depends on the changes and client reconnection behavior.
- Proxy configuration and cluster deployment mode: While a database proxy cluster has both an original private connection address and a Private Link endpoint, you cannot change the proxy configuration or switch the database cluster deployment mode.
- When to migrate: Migrate during off-peak hours. Delete the original private connection address promptly after verification to minimize the time that both connection types coexist.
- Before deleting the original address: Verify that all applications have switched to the Private Link endpoint and no longer depend on the original address.
Migration procedure
Keep the original private connection address and follow Create a Private Link endpoint to create and verify the new connection.
Replace the original connection string in your applications with the connection string for the Private Link endpoint. Verify that the applications have established new connections through Private Link and are running normally.
Verify that no applications still use the original private connection address.
In the OceanBase Cloud console, find the original private connection address and click ··· > Delete next to it.
Warning
Delete only the original private connection address. Do not delete the access endpoint itself, such as the primary or read-only endpoint, the Private Link endpoint, or any public address that is still in use.
Verify that the original private connection address has been deleted and that application connections still work.
Create a Private Link endpoint
Use this procedure to create a Private Link endpoint, either for a new connection or to replace an existing private connection. Before migrating an existing connection, read the Migration considerations.
Step 1: Create an endpoint service
Log in to the OceanBase Cloud console and open the workspace of the target tenant.
Follow the instructions for the endpoint type.
- Primary endpoint: On the primary endpoint card, click Create next to Private Link address. On the Networking page, click Create Private Link in the upper-right corner.
- Read-only or read/write splitting endpoint: Click Add Endpoint and select the routing policy and proxy cluster specification type.
Verify the cloud provider, instance, and tenant information, enter your Alibaba Cloud primary account ID, and submit the request.
After the endpoint service is created, record the service name shown on the page. You will need it to create an endpoint.
Step 2: Create an endpoint
In the Alibaba Cloud console, create an interface endpoint using the settings below. For instructions, see Access an endpoint service as a service consumer.
ParameterDescriptionRegion Select the region of your OceanBase Cloud instance. Type Select Other Endpoint Services. Service Name Enter the endpoint service name obtained in Step 1. VPC Select the VPC that contains your application clients. Zones and vSwitches Select zones supported by the endpoint service based on where your applications are deployed, and select a vSwitch in each zone. For higher availability, we recommend selecting at least two zones, prioritizing those that contain your applications. Enable Zone Affinity Enable this option. Security Group Select a security group for the endpoint. After the endpoint is created, copy its instance ID.
Return to the OceanBase Cloud console. In Step 2: Create an endpoint, enter the endpoint ID and click Connect.
Enter the endpoint domain name and VPC ID as prompted. After the connection succeeds, click Next.
Verify that the Private Link endpoint is displayed as successfully created on the target endpoint card.
Step 3: Configure the security group
Alibaba Cloud Private Link uses the endpoint security group to control access. You do not need to add application client IP addresses to the OceanBase Cloud tenant allowlist.
In the Alibaba Cloud console, find the security group associated with the endpoint.
Add inbound rules that allow application clients to access the database connection port. Depending on your network configuration, you can allow access from the security group of your application ECS instances or from specific IP addresses. For instructions, see Add security group rules.
Notice
Restrict access rules to the sources that need access.
Step 4: Connect to the database and verify the connection
Return to the OceanBase Cloud console. In the database access step, select a database, account, and connection method, then copy the generated connection string.
From the endpoint's VPC, or an application environment with private network connectivity to that VPC, use the connection string to connect to the database.
Verify that the database connection and the operations required by your applications work as expected.
Complete the steps for your scenario:
- For a new connection, configure your applications to use the connection string for the Private Link endpoint and verify that their connections and operations work as expected.
- For a migration, follow the Migration procedure to switch your applications to Private Link. Delete the original private connection address after verifying that it is no longer in use.
Update an endpoint after changing database proxy zones
When the zones of a database proxy cluster associated with Private Link change, the system adds load balancer zones as needed and updates the endpoint service to support the new zones while retaining the existing access zones. Existing endpoints do not automatically add or migrate network interfaces and usually require no changes. If you also deploy applications in a new zone, you can add that zone to an existing endpoint to support zone affinity.
Notice
Prepare a vSwitch in the target zone in advance and make changes during off-peak hours. Changing endpoint zones may affect existing connections.
After the database proxy zone change is complete in OceanBase Cloud, check which zones the associated endpoint service supports.
Log in to the Alibaba Cloud console, select the endpoint's region, and open the Endpoints page in the VPC console.
Click the target endpoint ID and open the Zone and ENI tab.
Click Add Zone, select the new zone supported by the endpoint service, and select a vSwitch in that zone within the VPC.
Verify that the connection in the new zone works.