Last updated: 2020-02-26 17:41:58PDF
This article will guide you through the initial use of Tencent Cloud's traditional Cloud Load Balancer: create a file called
clb-test Cloud Load Balancer of the traditional public network, and send the request from the client repost to the back-end two Cloud Virtual Machine.
- Cloud Load Balancer is only responsible for repost and Traffic and does not have the ability to handle requests. Therefore, you need to have an instance of Cloud Virtual Machine that handles user requests.
In this example, as long as you have two Cloud Virtual Machine instances, you can also plan the number of Cloud Virtual Machine. In this example, an instance of Cloud Virtual Machine has been created in Guangzhou.
rs-2. For information about how to create an instance of Cloud Virtual Machine, see Purchase and Launch Cloud Virtual Machine example .
- Here we take HTTP forwarding as an example. A Web server, such as Apache, Nginx and IIS, must be deployed on the CVMs.
To verify the results, the example is in
rs-1Apache is deployed on the and returns a "Hello Tomcat!" This is rsmuri 1! " The HTML, is in
rs-2Apache is deployed on the and returns a "Hello Tomcat!" This is rsmuri 2! " HTML. For more information on CVM deployment, see Deploy Java Web under Linux (CentOS) And Install and configure PHP under Windows .
- If the public network IP+ path of Access and Cloud Virtual Machine displays a page that has been deployed for you, the service is deployed successfully.
- Public network bandwidth must be purchased on Cloud Virtual Machine, because the current bandwidth attribute is on CVM, not CLB.
- In this example, the returned values vary with the services deployed on backend CVMs. In practice, the services deployed on CVMS are exactly the same to provide a consistent experience for all users.
Buy traditional Cloud Load Balancer instance
- Log in to Tencent Cloud's official website and go to the CLB purchase page .
- In this example, the region is the same as Cloud Virtual Machine's [Guangzhou], the instance type is "traditional", the network attribute is [public network], the network is selected [Default-VPC (default)], and the instance name is Enter "clb-test".
- Click [Buy now] to complete the payment.
For more information about Cloud Load Balancer's example, see Product attribute selection .
- On the "CLB Instance List" page, select the corresponding region to view the instance just created.
Create a CLB listener
Cloud Load Balancer listener is responsible for the actual repost by specifying Protocol and the port. This article takes the HTTP request configuration of Cloud Load Balancer and repost client as an example.
- Log in to the Cloud Load Balancer Console .
- In the "CLB Instance List", find the created traditional CLB instance and click its ID to enter its details page.
- In the basic Information section, you can click Edit after the name to change the instance name.
- In Listener In "Listener Management", click CREATE To create a CLB listener.
- In the pop-up box, configure the following:
- The custom name is "Listener1";
- Set the listening protocol port to
- The back-end port is
- Select "Weighted Round Robin" for the load balancing mode.
- Do not check Session to keep.
Enable health check
- Click "finish" to complete the creation of Cloud Load Balancer listener.
For more information on CLB listeners, please see CLB Listener Introduction .
Bind Backend CVM
- Find the CLB instance list that you just created
clb-testClick its ID, to enter Cloud Load Balancer's details page.
- In the "bind backend Services" module of listener Management, click "bind".
- In the pop-up box, select the Cloud Virtual Machine instance under CLB Intra-region
rs-2The weights are set to the default value of "10"
- Click OK to complete the binding.
- Show more listener [Listener1] can check the Health check status of the backend CVM. If the status is "healthy", it means that the CVM can process Cloud Load Balancer and repost's request normally.
Verify Cloud Load Balancer's service
- Enter Cloud Load Balancer's service address and port in the browser
http://vip:80To test Cloud Load Balancer's service, as shown in the following figure, indicates that the request was sent to the CVM of rs-1 by CLB repost, and CVM normally processes the request and returns.
- The polling algorithm of this listener is "polling by weight", and the weight of both CVM is "10". Refresh the browser and send the request again. You can see that this request has been sent to the CVM of rs-2 by CLB repost.
- If the user disables the session persistence feature and selects "Weighted Round Robin" for scheduling, the requests will be allocated to multiple backend CVMs in sequence.
- If the user enables the session persistence feature, or disables this feature but selects "ip_hash" for scheduling, the requests will be allocated to one backend CVM all the time.