Contents:
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
- Log in to the CLB Console.
- Select Instance Management on the left sidebar.
- In the instance list, click the ID of the instance to be configured to enter the instance details page.
- Click the Listener Management tab or click Configure Listener in the "Operation" column.
- 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 |
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 |
Session persistence status | Enables or disables session persistence |
Enabled |
Session persistence time | Session persistence time |
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 | 2s | |
Check interval | 5s | |
Unhealthy threshold | 3 times | |
Healthy threshold | 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.