Binding and Unbinding Load Balancers for a DWS Cluster
Overview
If the private IP address or EIP of a CN is used to connect to a cluster, the failure of this CN will lead to cluster connection failure. If a private or public domain name is used for connection, the DNS service randomly selects an IP address for each client. This cannot balance loads or avoid single-CN failures. Elastic Load Balance (ELB) is used to solve these problems. ELB can check the health of nodes in a cluster. If a CN in a cluster is faulty, ELB can switch requests to other healthy nodes to prevent failures to access the cluster.
ELB is a service that automatically distributes incoming traffic across multiple backend Elastic Cloud Servers (ECSs) based on predefined forwarding policies. ELB can evenly distribute requests from the client to multiple CNs, preventing failures caused by a single CN fault and improving fault tolerance of the cluster. For details, see the Elastic Load Balance User Guide.
Methods for Binding a Load Balancer to a Cluster
You can bind a load balancer to a cluster, regardless of whether they are in the same or different VPCs.
| Binding Type | Description | Use Case |
|---|---|---|
| Same VPC | The load balancer and the DWS cluster are in the same VPC. | The cluster can communicate with the load balancer. |
| Different VPCs | The load balancer and the DWS cluster are in different VPCs. | The load balancer and the cluster are in different network environments. Example: An enterprise's DWS cluster is deployed in VPC-A, and the database application server is deployed in VPC-B. If the enterprise wants to enable access to the DWS cluster from the application server through a load balancer, they can first enable communication between VPC-A and VPC-B, and then bind a load balancer in VPC-B to the cluster in VPC-A. |
Notes and Constraints
- This feature is supported only in cluster version 8.1.1.200 or later.
- To ensure load balancing and high availability of the cluster, bind a load balancer to a cluster as soon as possible after it is created in the production environment to prevent service interruption.
- To use ELB, you need to authorize DWS to access user resources. The system creates DWS AgencyAccess and deletes the agency with the highest permission to improve account security. This operation does not affect the service cluster. Only the function permissions on the management plane are changed. For details, see Allowing DWS to Manage Resources.
- The constraints for creating a load balancer are as follows:
- When creating a load balancer, determine its specifications based on your service access traffic. You are advised to select the maximum specifications. On the DWS console, you can bind a load balancer to a cluster but cannot change the specifications of the load balancer.
- You only need to create a load balancer. DWS automatically creates required listeners and backend server groups.
- When creating a load balancer, ensure that there are no listeners using the same port as the database. Otherwise, the load balancer cannot be bound to a cluster.
- If you want to access a load balancer using a public network IP address or domain name, bind an EIP or domain name to the load balancer on the ELB console.
- ELB does not support cross-database access. That means you can only access the database of a cluster to which a load balancer is bound, and cannot access databases of other clusters.
- The constraints for binding a load balancer are as follows:
- Only dedicated load balancers can be bound to DWS.
Load balancing is not supported in regions where dedicated load balancers are unavailable. Go to the ELB console to check whether dedicated load balancers are supported.
- To bind a load balancer to a DWS cluster, ensure that the load balancer is in the same region, VPC, and enterprise project as the cluster.
- The load balancer to be bound must use TCP and has a private IP address.
- When you bind a load balancer to a DWS cluster, the following parameters are set by default. If you want to modify the default settings, evaluate the impact.
Table 2 Default parameter settings of the load balancer Parameter
Default Value
Description
Forwarding Policy
ROUND_ROBIN
One of the forwarding policies of the load balancer. This policy distributes requests to backend CNs in sequence for load balancing.
Health Check Interval
10s
The health of CNs is checked every 10 seconds.
Timeout
50s
Health check timeout
Retries
3
Maximum number of retries allowed upon a health check failure
- When you bind a cluster to a load balancer across VPCs, you can bind it to a dedicated load balancer.
- When you bind a cluster to a load balancer across VPCs, you can only bind it to a dedicated load balancer.
- Before you bind a load balancer to a cluster across VPCs, ensure that the subnet segment of the cluster VPC is different from that of the VPC to which the load balancer belongs. Otherwise, the load balancer cannot communicate with the cluster.
- IPv4 load balancers can only be bound to IPv4 clusters. IPv6 dual-stack load balancers can only be bound to IPv6 dual-stack clusters.
- Only dedicated load balancers can be bound to DWS.
Associating ELB
- Log in to the DWS console.
- In the navigation pane on the left, choose Cluster > Cluster List. All clusters are displayed by default.
- In the cluster list, click the name of the target cluster to go to the Cluster Information page.
- In the Connection area, click Bind Load Balancer and select a load balancer. If there is no load balancer, create one on the ELB console. Then go back to the DWS console, refresh the Cluster Information page, and bind the created load balancer to the cluster.
By default, the load balancer in the VPC of the cluster is selected for DWS. If you select Bind to ELB in another VPC, the list of load balancers in other VPCs will be displayed for you to choose from. Before binding your cluster to an ELB across VPCs, ensure the cluster VPC has been connected to the ELB VPC. For details, see Prerequisites for Binding an ELB to a Cluster Across VPCs.
- After the request is delivered, go back to the Clusters page. Task information Associating ELB of the cluster is displayed. The process takes some time.
- Log in to the ELB management console, click the name of the associated ELB, switch to the Backend Server Groups tab, and check whether the cluster CNs are associated with the load balancer. If the health check result indicates that the backend nodes are deleted, ignore the problem. For details, see Viewing a Backend Server Group.

- In the Basic Information area on the Cluster Information page, check the ELB Address, which is used for connecting to the DWS cluster.
Prerequisites for Binding an ELB to a Cluster Across VPCs
Enabling ELB for a cross-VPC backend server
- Log in to the ELB console.
- In the ELB list, click the name of a dedicated ELB to go to its details page.

- On the Summary page, enable IP as a Backend, confirm the information, and click OK.

- Check VPC and IPv4 Subnet, which will be used for configuring routes.

Enable communication between the cluster VPC and the load balancer VPC through a VPC peering connection. You can also use other methods, such as enterprise routers or VPNs, to enable communication between the VPCs.
- Log in to the DWS console.
- In the navigation pane on the left, choose Cluster > Cluster List. All clusters are displayed by default.
- In the cluster list, click the name of a cluster to go to the cluster details page. Check the VPC and subnet segment of the cluster.

- In the Service List, choose Virtual Private Cloud. In the navigation pane on the left, choose My VPCs. Locate the VPC for which you want to create a VPC peering connection.
- Choose VPC Peering Connections. In the upper right corner of the page, click Create VPC Peering Connection.
- On the displayed page, set Local VPC to the cluster VPC, and set Peer VPC to the VPC of the ELB. Confirm the settings and click OK.

- Click Add Route to add the route information.
- Click the name of the created VPC peering connection. On the displayed page, click the Local Routes tab, click Route Tables, and add the route table of the cluster VPC.

- In the local route table, set Destination to the subnet CIDR block of the ELB VPC, set Next Hop Type to VPC peering connection, and set Next Hop to the created VPC peering connection. Click OK.

- Go to the basic information page of the created VPC peering connection, click the Peer Routes tab, click Route Tables, and add the route table of the ELB VPC.

- In the peer route table, set Destination to the subnet CIDR block of the cluster VPC, set Next Hop Type to VPC peering connection, and set Next Hop to the created VPC peering connection. Click OK.

- After the cluster is created, the network between the VPC where the cluster resides and the VPC where the load balancer resides is connected. For details, see section Binding an ELB.
Disassociating ELB
When you unbind a load balancer from a cluster, related cluster information is cleared on DWS but the load balancer is not deleted. Delete the load balancer in time to prevent unnecessary costs.
- Log in to the DWS console.
- In the navigation pane on the left, choose Cluster > Cluster List. All clusters are displayed by default.
- In the cluster list, click the name of the target cluster to go to the Cluster Information page.
- In the Connection area, click Dissociate ELB to dissociate the load balancer from the cluster.
- After the request is delivered, go back to the Clusters page. Task information Dissociating ELB of the cluster is displayed. The process takes some time.
- Log in to the ELB management console, click the name of the dissociated ELB, switch to the Backend Server Groups tab, and check whether the cluster CNs are deleted.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot