If your services are sensitive to data consistency, reliability, and data integrity but can tolerate a relatively low transmission speed, such as file transmission, email services, and remote logons, you can add a TCP listener to your Edge Load Balancer (ELB) instance to forward TCP requests to backend servers.
Prerequisites
An ELB instance is created. For more information, see Create an ELB instance.
Procedure
Log on to the ENS console.
On the ELB Instance page, find the ELB instance that you want to manage and click Listener Configuration in the Actions column.
On the Listener tab, click Add Listener.
Configure the parameters. The following table describes the parameters.
Parameter
Description
Listener Name
Specify a name for the listener.
ELB Protocol
Select TCP.
Listener Port
Specify a listening port that is used by ELB to receive requests and forward the requests to backend servers. Valid values: 1 to 65535.
Advanced Settings
NoteClick Modify to configure the advanced settings.
Scheduling Algorithm
Weighted Round-Robin (WRR): Backend servers that have higher weights receive more requests than backend servers that have lower weights.
Round-Robin (RR): Requests are distributed to backend servers in sequence.
Weighted Least Connections (WLC): Requests are distributed based on the combination of the weights and active connections of backend servers. If multiple backend servers have the same weight, requests are forwarded to the backend server that has the least number of connections.
Consistent Hashing (CH): Consistent hashing based on source IP addresses is used. Requests from the same source IP address are distributed to the same backend server.
Session Persistence
Specify whether to enable session persistence.
NoteIf you enable session persistence, ELB forwards all requests from a client to the same backend server.
Session Persistence Timeout Period
Specify a timeout period for TCP session persistence.
If no new requests are received within the specified timeout period, the session is automatically disconnected.
Valid values: 1 to 3600.
Unit: seconds.
Connection Timeout Period
Specify a timeout period for idle TCP connections. Unit: seconds. Valid values: 10 to 900.
If no response is received through a connection within the specified timeout period, ELB automatically closes the connection.
Valid values: 10 to 900.
Unit: seconds.
Obtain Client IP Address
Specify whether to retrieve the IP addresses of clients. Only Layer 4 listeners support this feature. By default, this feature is enabled.
Click Next, and configure health checks. For more information, see Configure health checks.
After you configure health checks, click Next. Confirm the settings and click Create.
On the Listener tab, find the listener that you want to enable and click Enable in the Actions column.