This topic provides a step-by-step guide on connecting to an OceanBase Cloud database using Alibaba Cloud VPC.
Prerequisites
- You have registered an Alibaba Cloud primary account.
- You have registered an OceanBase Cloud account, and have created an instance and a tenant. For more information, refer to Create an instance and Create a tenant.
Usage notes
This topic applies only to the original private connection mode.
Procedure
Log in to the OceanBase Cloud console. In the instance list page, expand the target instance, select Connect > Get Connection String under the target tenant.
In the pop-up dialog box, select Private Network.
Under Step 1: Create a private endpoint, fill in the following information:
Alibaba Cloud Account ID: Navigate to Alibaba Cloud Console. Hover your mouse over the avatar in the upper right corner. Copy your main account ID from the drop-down menu.
VPC and vSwitch: Navigate to Alibaba Cloud VPC Console. Select the same region as the OceanBase Cloud instance in the top navigation bar, then copy the existing VPC ID. Select the vSwitch under this VPC and copy the vSwitch ID. You can also choose to create a new VPC and vSwitch.
Notice
- Check the network settings before you submit them. Incorrect settings can cause the request to fail, and you cannot edit a failed request to retry. If creation fails, contact OceanBase Cloud technical support.
- On Alibaba Cloud instances that support proxy deployment configuration, the private connection for the primary endpoint reuses the public connection’s proxy when possible. If the console prompts you to configure a proxy, select the proxy tier, deployment mode, zones, and node specification before you submit the request.
Click Create Private Endpoint.
Note
Creating a private endpoint may take a few minutes, so please be patient.
After the private endpoint is created, under Step 2: Access Database select an existing database and account, or create new ones.
Notice
If you choose to create a new account, please properly record the password generated when creating the account.
In the Connection Method drop-down box, select the connection method as needed, and copy the generated connection string to your client for connection.
Related operations
After you create a private endpoint, you can view it in the topology on the tenant overview page, edit its prefix or port, or delete it. If the proxy supports deployment configuration, use the Database Proxy page to select a different VPC or vSwitch. For more information, see Manage database proxy.
Edit a private endpoint
On the instance list page of OceanBase Cloud console, click the target tenant name to enter the Overview page of the tenant.
In the Topology Diagram section of the tenant overview page, click the edit button on the right of the private endpoint.
In the edit private endpoint dialog box, modify Prefix and Port, and click OK.
Delete a private endpoint
On the instance list page of OceanBase Cloud console, click the target tenant name to enter the Overview page of the tenant.
Under the Topology Diagram of the tenant overview page, click the delete button to the right of the existing private endpoint.
In the dialog box that appears, check the deletion conditions, and click OK.
Connect to an Alibaba Cloud ECS instance
If you need to connect to an Alibaba Cloud ECS instance, select the same VPC network and VSwitch when configuring the private endpoint.