Configuring a Class CLB Instance

Last updated: 2019-10-23 20:07:25

PDF

After creating a classic CLB instance, you need to configure a listener to it. The listener listens to requests on the instance and routes traffic to the real server based on the balancing policy.

Prerequisites

You need to create a CLB instance first and select "Classic CLB" as instance type.

Configuring a Listener

Step 1. Open the "Listener Management" page

  1. Log in to the CLB Console.
  2. Select Instance Management on the left sidebar.
  3. In the instance list, click the ID of the instance to be configured to enter the instance details page.
  4. Click the Listener Management tab or click Configure Listener in the "Operation" column.
  5. The "Listener Management" page is as shown below:

Step 2. Configure a listener

Click Create in Listener and configure a TCP listener in the pop-up window.

1. Basic configuration

Configuration Item Description Example
Name Listener name test-tcp-80    
Listener protocol and listening port Listener protocol and listening port
  • Listener protocol: CLB supports various protocols, including TCP, UDP, HTTP, and HTTPS. TCP is used in this example.
  • Listening port: A port used to receive requests and route them to the real server. Port range: 1-65535.
  • The listening port must be unique in the same CLB instance.
  • TCP:80
    Backend port The port through which the CVM provides services, and receives and processes the traffic from the CLB instance. 80

    The specific configuration of the created TCP listener is as shown below:

    2. Advanced configuration

    Configuration Item Description Example
    Balancing method For TCP listeners, CLB supports two scheduling algorithms: weighted round robin (WRR) and weighted least connections (WLC).
  • WRR: Requests are sequentially delivered to different real servers according to their weights. Scheduling is done based on the number of new connections, where servers with higher weights will undergo more polls (i.e., a higher probability), while servers with the same weight process the same number of connections.
  • WLC: Loads of servers are estimated according to the number of active connections to the servers. Scheduling is done based on server loads and weights. If their weights are the same, servers with fewer active connections will undergo more polls (i.e., a higher probability).
  • WRR
    Session persistence status Enables or disables session persistence
  • If session persistence is enabled, the CLB listener will deliver access requests from the same client to the same real server.
  • TCP session persistence is implemented based on client IP addresses, i.e., access requests from the same IP address are routed to the same real server.
  • Session persistence can be enabled for WRR scheduling but not WLC scheduling.
  • Enabled
    Session persistence time Session persistence time
  • If there is no new request in the connection within the session persistence time, session persistence will be interrupted automatically.
  • Value range: 30-3,600s.
  • 30s

    The specific configuration is as shown below:

    3. Health check

    Configuration Item Description Example
    Health check status Enables or disables health check. In TCP listeners, CLB instances send SYN packets to the specified server port to perform health checks. Enabled
    Response timeout period
  • Maximum response timeout period for health checks.
  • If a real server fails to respond correctly within the timeout period, it is considered abnormal.
  • Value range: 2-60s. Default value: 2s.
  • 2s
    Check interval
  • Interval between two health checks.
  • Value range: 5-300s. Default value: 5s.
  • 5s
    Unhealthy threshold
  • If the health check results received n times (n is the entered number) in a row are failures, the instance will be considered unhealthy, and the status displayed in the console will be Abnormal.
  • Value range: 2-10. Default value: 3.
  • 3 times
    Healthy threshold
  • If the health check results received n times (n is the entered number) in a row are successes, the instance will be considered healthy, and the status displayed in the console will be healthy.
  • Value range: 2-10. Default value: 3.
  • 3 times

    The specific configuration of health check is as shown below:

    Step 3. Bind a real server

    Click Bind on the "Listener Management" page and select the real server to be bound in the pop-up window, as shown below:

    Below is a screenshot after configuration:

    If you configure multiple listeners on a classic CLB instance and bind multiple real servers, each listener will route requests to all real servers according to its own configuration.

    Step 4. Security group (optional)

    You can configure a CLB security group to isolate public network traffic. For more information, see Configuring a CLB Security Group.

    Step 5. Modify/delete a listener (optional)

    If you need to modify or delete a created listener, select the listener on the "Listener Management" page and select Modify or Delete.