Getting Started

Last updated: 2020-02-26 17:41:58

PDF

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.

Prerequisites

  1. 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-1 and rs-2 . For information about how to create an instance of Cloud Virtual Machine, see Purchase and Launch Cloud Virtual Machine example .
  2. 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-1 Apache is deployed on the and returns a "Hello Tomcat!" This is rsmuri 1! " The HTML, is in rs-2 Apache 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 .
  3. 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

  1. Log in to Tencent Cloud's official website and go to the CLB purchase page .
  2. 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".
  3. Click [Buy now] to complete the payment.
    For more information about Cloud Load Balancer's example, see Product attribute selection .
  4. 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.

  1. Log in to the Cloud Load Balancer Console .
  2. In the "CLB Instance List", find the created traditional CLB instance and click its ID to enter its details page.
  3. In the basic Information section, you can click Edit after the name to change the instance name.
  4. In Listener In "Listener Management", click CREATE To create a CLB listener.
  5. In the pop-up box, configure the following:
  • The custom name is "Listener1";
  • Set the listening protocol port to HTTP:80 .
  • The back-end port is 80 .
  • Select "Weighted Round Robin" for the load balancing mode.
  • Do not check Session to keep.
    Enable health check
  1. 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

  1. Find the CLB instance list that you just created clb-test Click its ID, to enter Cloud Load Balancer's details page.
  2. In the "bind backend Services" module of listener Management, click "bind".
  3. In the pop-up box, select the Cloud Virtual Machine instance under CLB Intra-region rs-1 and rs-2 The weights are set to the default value of "10"
  4. Click OK to complete the binding.
  5. 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

  1. Enter Cloud Load Balancer's service address and port in the browser http://vip:80 To 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.
  2. 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.