If you select the endpoint connection method when creating a data source or a data migration task with Alibaba Cloud as the cloud provider, you must first add the account ID displayed on the page to the allowlist of your endpoint service to allow the endpoint of that account to connect to the endpoint service. This topic describes how to obtain the required account ID and add it to the allowlist of the endpoint service.
Prerequisites
You have created a database instance of the corresponding type and obtained its connection address within your VPC. For example, a MySQL instance typically has a single address pair in the format
address:port, while a Kafka instance may have multiple address pairs (broker_address1:broker_port1,broker_address2:broker_port2, etc.).If resources associated with the endpoint service, such as the load balancing service or virtual servers, have security group configurations enabled, you need to add the private IP address belonging to the OceanBase Cloud data source to the corresponding security group. For details, see Private IP address range description.
Use the Nginx service to proxy the data source address as the backend for the endpoint service
For each data source instance that needs to expose an address externally, you must add a forwarding server configuration in the Nginx configuration. Taking Nginx port 3306 as an example, the configuration is as follows.
server {
listen 3306;
proxy_pass address:port;
proxy_timeout 60s;
}
If a data source has multiple connection addresses (for example, a Kafka data source), you need to use Nginx to forward requests to multiple addresses simultaneously. Taking two Brokers with Nginx ports 19092 and 19093 respectively as an example, the configuration is as follows.
server {
listen 19092;
proxy_pass broker_address1:broker_port1;
proxy_timeout 60s;
}
server {
listen 19093;
proxy_pass broker_address2:broker_port2;
proxy_timeout 60s;
}
Note
- Nginx must support the
ngx_stream_module. - It is recommended to set the Nginx
proxy_timeoutto 60 seconds or more. - For a PostgreSQL instance, set the Nginx port to 5432.
Create a network load balancer
Log in to the Alibaba Cloud Network Load Balancer NLB Instances page and click Create Network Load Balancer.
On the Cloud Service Purchase Page, select the region where the NLB instance will be located and configure the parameters.
ParameterDescriptionInstance Network Type Select Private. VPC Select the target VPC from the drop-down list. The VPC selected here must match the Virtual Private Cloud (VPC) of the Alibaba Cloud instance. If you need to create a new one, click Create VPC. For details, see Create and manage VPCs. Availability Zone Select at least 2 complete availability zones and switches. The availability zones selected here must match the region and availability zones of the Alibaba Cloud instance, and the resource group selected when creating the switch must match the resource group of the Alibaba Cloud instance. Protocol Version Select IPv4. Click Create Now to complete the creation of the network load balancer.
Configure listeners.
Return to the network load balancer's Instance page and click Create Listener next to the created NLB instance.
In the Configure Listening step, configure the parameters as prompted and click Next.
The following table describes the parameters that require your attention. For more information, see Add a TCP listener.
ParameterDescriptionSelect Listening Protocol Please select TCP. Full Port Feature Choose whether to enable the full port feature. After enabling this feature, the NLB instance can listen on all ports within the specified listening port range, eliminating the need to configure each port individually. Listening Port Range After enabling the full port feature, you need to enter the start port and end port. Listening Port If the full port feature is not enabled, you need to enter the listening port. This port is used to receive requests and forward them to the backend server. Please ensure it matches the forwarding port of Nginx. In the Select Server Group step, select an existing server group and click Next.
In the Configuration Review step, verify the information and click Submit.
In the Load Balancing Service Configuration Wizard dialog box, after the listener is successfully created, click Got it.
Create an endpoint service
Log in to the Endpoint Services page of the Alibaba Cloud VPC console.
At the top of the page, select the region for the endpoint service and click Create Endpoint Service.
In the Create Endpoint Service dialog box, configure the parameters.
Add the created NLB instance as a service resource and configure the parameters as prompted.
ParameterDescriptionRegion The region where the endpoint service is located. Service Resource Type Select Network Load Balancer (NLB). Select Service Resource Select the availability zone and instance of the created NLB as the service resource. Automatically Accept Endpoint Connections Decide whether to automatically accept endpoint connections based on your actual situation. If you select No, the endpoint service connection will remain in the Disconnected state. You can manually accept connection requests on the Endpoint Connections tab of the endpoint service details page. Support Proximity Resolution Within Same Zone Choose whether to support proximity resolution for endpoint domain names connecting to the service based on your actual situation. Service Payer Select Service User. Resource Group Select the resource group to which the endpoint service belongs. Tag Key/Tag Value Select or enter a tag key and value to identify the endpoint service, facilitating flexible management. Description A description of the endpoint service. Click OK to Create to complete the creation of the endpoint service.
Add an endpoint service to the allowlist
After creating an endpoint service, add the account that needs access to it to the allowlist.
Obtain the account ID to add to the allowlist
Log in to the OceanBase Cloud console.
Go to the Create Data Source dialog box.
This example uses the Create Data Source page. You can also click Data Services > Data Migration > Data Migration to obtain the IP address to add to the allowlist on the Create Migration Task page.
In the left-side navigation pane, click Data Services > Data Sources.
On the Data Source page, click Create Data Source in the upper-right corner and select the type of data source you want to create.
In the Create Data Source dialog box, set Cloud Vendor to Alibaba Cloud, Connection Type to Endpoint, and select the appropriate instance type based on your needs.
Copy the account ID displayed below the Connection Information text box.
Note
The account ID is displayed only after you select a region. The selected region must match the region where the Alibaba Cloud instance is located.
Add an account to the allowlist for an endpoint service
Log in to the Endpoint Service page in the Alibaba Cloud console.
Select the region for the endpoint service from the top menu bar.
On the Endpoint Service page, click the ID of the target endpoint service.
On the endpoint service details page, click Service Allowlist > Add to Allowlist.
In the Add to Allowlist dialog box, enter the account ID obtained above.
If you need to add multiple allowlisted accounts, separate them with commas (,).
Click OK.
Use an endpoint service
After creating an endpoint service and adding it to the allowlist, you need to copy its name or ID and fill it in the Alibaba Cloud > Endpoint > Connection Information fields on the Create Data Source or Create Migration Task page. For details on creating a data source, see Create a data source. For details on creating a migration task, see the corresponding type's documentation in the Data Migration module.
To copy the endpoint service name or ID, follow these steps:
Log in to the Endpoint Service page in the Alibaba Cloud console.
Select the region for the endpoint service from the top menu bar.
On the Endpoint Services page, click the ID of the target endpoint service.
On the endpoint service details page, depending on your needs, click Copy next to Endpoint Service Instance ID or Endpoint Service Name on the Basic Information tab.
