After creating a CLB instance, you need to configure a listener to it. The listener listens to requests on the instance and routes traffic to real servers based on the load balancing policy.
You need to configure a CLB listener with the following items:
A CLB listener can listen to layer-4 and layer-7 requests on a CLB instance and route them to real servers for processing. The main difference between layer-4 CLB and layer-7 CLB is whether layer-4 or layer-7 protocol is used to forward traffic for load balancing of user requests.
If you use a layer-4 listener (i.e., layer-4 protocol forwarding), the CLB instance will establish a TCP connection with the real server on the listening port, and directly forward requests to the real server. This process does not modify any data packets (in pass-through mode) and has high forwarding efficiency.
Tencent Cloud CLB supports request forwarding over the following protocols:
TCP SSL listeners currently support public network CLB instances but not private network or classic CLB instances.
|Protocol Type||Protocol||Description||Use Case|
|Layer-4 protocol||TCP||Connection-oriented and reliable transport layer protocol:
||It is suitable for scenarios that have high requirements for reliability and data accuracy but relatively low requirements for transfer speed, such as file transfer, receiving and sending emails, and remote login.
For more information, please see Configuring a TCP Listener.
|UDP||Connection-less transport layer protocol:
||It is suitable for scenarios that have high requirements for transfer efficiency but relatively low requirements for accuracy, such as instant messaging and online videos.
For more information, please see Configuring a UDP Listener.
|TCP SSL||Secure TCP:
||It is suitable for scenarios that have high requirements for security when TCP is used and supports TCP-based custom protocols.
For more information, please see Configuring a TCP SSL Listener.
|Layer-7 protocol||HTTP||Application layer protocol:
||It is suitable for applications where request contents need to be identified, such as web applications, mobile apps, and so on.
For more information, please see Configuring an HTTP Listener.
|HTTPS||Encrypted application layer protocol:
||It is suitable for HTTP applications requiring encrypted transmission.
For more information, please see Configuring an HTTPS Listener.
|Listening port (frontend port)||Listening ports are used by CLB instances to receive and forward requests to real servers
You can configure CLB instances for ports 1 to 65535, such as port 21 (FTP), 25 (SMTP), 80 (HTTP), and 443 (HTTPS), etc.
|Service port (backend port)||Service ports are used by CVM instances to provide services, receive and process traffic from CLB instances.
On one CLB instance, one listening port can forward traffic to ports of multiple CVM instances.