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.
Procedure
Log in to the OceanBase Cloud console. In the instance list page, expand the the information of 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
Please carefully check whether the above information is filled in correctly. Incorrect information may cause the private endpoint creation to fail, and it cannot be modified. If the private endpoint creation fails, please contact OceanBase Cloud technical support promptly.
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 the information of the private endpoint in the topology of the tenant overview page. If you need to modify the created private endpoint due to reasons such as replacing the VPC, you can edit or delete the private endpoint on OceanBase Cloud.
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.