Configuring Load Balancing
This section describes how to configure the endpoint for component access from outside the environment. Access it from your VPC or Internet.
CAE allows you to configure multiple load balancers at the same time to implement multiple access modes for a component.
Up to 10 load balancers can be configured for a component at the same time.
Prerequisites
You have created an application and component.
Adding a Load Balancing Configuration
- Log in to CAE.
- Choose Component Configurations.
- Select the target component from the drop-down list in the upper part of the page.
- Click Edit in the Access Mode module.
- In the Access Component from Another Environment area, click Load Balancing > Add Load Balancer.
- On the Create Load Balancer page, set parameters by referring to Table 1.
Table 1 Configuring load balancing for public network access Parameter
Description
Load Balancer
You can select Dedicated or Built-in load balancer.
- If you select Built-in load balancer, only EIP-based public network access is supported.
- If you select Dedicated, select the corresponding load balancer from the drop-down list.
NOTE:
- To use a Dedicated load balancer, add the configuration for VPC to access the CAE environment first.
- Only load balancers in the environment's VPC are supported.
- You can configure an EIP for the load balancer to access CAE components from public network.
If no load balancer is available, click Create Load Balancer to create a load balancer. For details, see Creating a Dedicated Load Balancer.
Health Check
The health check is for the load balancer.
- Disable
- Enable: default.
- Protocol
Protocol type of a health check request.
Value: TCP or HTTP. Default value: TCP.
NOTE:The protocol cannot be directly switched. To switch the protocol, disable it before selecting another one.
- Check Path
This parameter is mandatory when Protocol is set to HTTP.
Health check URL. The path must start with a slash (/) and contain 1 to 80 characters.
It can contain letters, digits, and the following characters: -/.%?&_.
- Check Interval (s)
Interval for sending health check requests, in seconds.
Value range: 1 to 50. Default value: 5.
- Timeout (s)
Maximum time required for waiting for a response from the health check, in seconds.
Value range: 1 to 50. Default value: 10.
- Max. Retries
Maximum number of health check retries.
Value range: 1 to 10. Default value: 3.
- Protocol
Access Control
You can create an access control policy to allow or forbid an IP address to access a component. The value can be an IP address or an IP network segment.
Port Settings
- Protocol: TCP and UDP are supported.
- Listening Port: listening port of the program in a component, which is obtained from the user program code.
Value range: 1 to 65535.
- Access Port: port provided by a component for external access, which is set by user and must be unique.
Value range: 1 to 65535.
Figure 1 Configuring load balancing
Figure 2 Configuring health check
- Click OK.
- (Optional) To add more load balancing configurations, repeat 5 to 7.
- Click OK.
- Make the configurations take effect.
- If the component has been deployed, click Activate Settings in the upper part of the page. In the dialog box displayed on the right, confirm the configurations and click OK for the configurations to take effect.
- If the component has not been deployed, click Set and Deploy Component in the upper part of the page. In the dialog box displayed on the right, click OK. After the deployment is complete, the configurations take effect.
If a Nginx component is used, the protocol is TCP, listening port is 80, and access port is 8089. After deployment, choose Components, click the public network address in the Access Address column of the Nginx component to view its static web page.
If you have configured an access control whitelist or blocklist, only IP addresses in the whitelist or not in the blocklist can access the component.Figure 3 Public network access
You can also use a domain name for access, for example, http://test-test-7.com:8089, if you have added a domain name and bound it.
Figure 4 Configuring a domain name
Figure 5 Access using a domain name
Modifying a Load Balancing Configuration
- Log in to CAE.
- Choose Component Configurations.
- Select the target component from the drop-down list in the upper part of the page.
- Click Edit in the Access Mode module.
- In the Access Component from Another Environment area, click Load Balancing.
- Find the target configuration item and click Edit in the Operation column.
Figure 6 Modifying a load balancing configuration
- Modify parameter settings by referring to Table 1.
- Click OK.
- Click OK.
- Make the configurations take effect.
- If the component has been deployed, click Activate Settings in the upper part of the page. In the dialog box displayed on the right, confirm the configurations and click OK for the configurations to take effect.
- If the component has not been deployed, click Set and Deploy Component in the upper part of the page. In the dialog box displayed on the right, click OK. After the deployment is complete, the configurations take effect.
Deleting a Load Balancing Configuration
- Log in to CAE.
- Choose Component Configurations.
- Select the target component from the drop-down list in the upper part of the page.
- Click Edit in the Access Mode module.
- In the Access Component from Another Environment area, click Load Balancing.
- Find the target configuration item and click Delete in the Operation column.
- In the displayed dialog box, click Yes.
Figure 7 Deleting a Load Balancing Configuration
- Click OK.
- Make the configurations take effect.
- If the component has been deployed, click Activate Settings in the upper part of the page. In the dialog box displayed on the right, confirm the configurations and click OK for the configurations to take effect.
- If the component has not been deployed, click Set and Deploy Component in the upper part of the page. In the dialog box displayed on the right, click OK. After the deployment is complete, the configurations take effect.
Feedback
Was this page helpful?
Provide feedbackThank 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