CreateLoadBalancerTCPListener

Last Updated: Nov 07, 2017

Description

  • Create Listeners based on the TCP protocol for the Server Load Balancer instance.
  • The newly created Listener is in the Stopped status, and StartLoadBalancerListener must be called to make it work. For more information, see Server Load Balancer Listener Status Transition Chart.
  • The health check about the TCP Listener is always on, and users can set various parameter configurations of health checks.

Request parameter

Name Type Required Description
Action String Yes Name of the operating interface, which is specified in the system. Value: CreateLoadBalancerTCPListener.
RegionId String Yes Region ID.
LoadBalancerId String Yes The unique ID of a Server Load Balancer instance.
ListenerPort Integer Yes Port used by the Server Load Balancer instance frontend. Value: 1-65535.
BackendServerPort Integer Yes Port used by the Server Load Balancer instance frontend. Value: 1-65535.
Bandwidth Integer Yes Bandwidth peak of Listener

Value: -1 | 1-1000 Mbps

For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited.

Scheduler String No Scheduling algorithm

Value: wrr | wlc

Default: wrr.

PersistenceTimeout Integer No Timeout of connection persistence

Value: 0-3600(in seconds)

Default: 0 The value 0 indicates to close it.

HealthCheckType String No Type of health check

Value: tcp | http

Default: tcp

TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.

HealthCheckDomain String No Domain name used for health check. When TCP listener need to use HTTP health check, this parameter will be configured; and when TCP health check is used, the parameter will be ignored.

Value: $_ip | custom string

Rules of the custom string: its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When the parameter is set to $_ip by the user, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.

HealthCheckURI String As appropriate URI used for health check.

URI used for health check. When TCP listener need to use HTTP health check, this parameter will be configured; and when TCP health check is used, the parameter will be ignored.

Value: Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.

HealthCheckConnectPort Integer No Port used for health check.

When HealthCheck is on, the parameter is required; and when HealthCheck is off, the parameter will be ignored.

Value: 1-65535 or ’-520’.

When the parameter is set to -520, it means the backend server port (Backen dServerPort) is used.

HealthyThreshold Integer As appropriate Threshold determining the result of the health check is success. Namely, after how many successive successful health checks.Value: 1-10Default: 3.
UnhealthyThreshold Integer As appropriate Threshold determining the result of the health check is fail. Namely, after how many successive failed health checks, the health check result of the backend server is changed from success to fail.

Value: 1-10

Default: 3.

HealthCheckTimeout Integer No Timeout of the health check connectionValue; 1-50(in seconds)

Default: 5.

HealthCheckInterval Integer No Time interval of health checks

Value: 1-5(in seconds)

Default: 2.

HealthCheckHttpCode String As appropriate Regular health check HTTP status code. Multiple codes are segmented by “,”.

When HealthCheck is on, the parameter is required; and when HealthCheck is off, the parameter will be ignored.

Value: http_2xx | http_3xx | http_4xx | http_5xx

Default: http_2xx.

VServerGroupId String No Virtual server group ID. Virtual server group ID and master-slave server group ID cannot be both used at the same time.
MasterSlaveServerGroupId String No Master-slave server group. Virtual server group ID and master-slave server group ID cannot be both used at the same time.
EstablishedTimeout Integer No Silent timeout period for layer-4 TCP listener. Default: 900s. Range: [10, 900].

Return parameter

They are all common response parameters. For more information, see Common parameters.

Example

Request example

  1. https://slb.aliyuncs.com/
  2. &Action=CreateLoadBalancerTCPListener
  3. &LoadBalancerId=139a00604ad-cn-east-hangzhou-01
  4. &ListenerPort=443
  5. &BackendServerPort=443
  6. &Bandwidth=-1
  7. &VServerGroupId=rsp-cige6j5e7p
  8. &<common request parameter>

Return example

  • XML format
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <CreateLoadBalancerTCPListenerResponse>
    3. <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
    4. </CreateLoadBalancerTCPListenerResponse>
  • JSON format
    1. {"RequestId":" CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
    2. }
Thank you! We've received your feedback.