建立TCP監聽。
介面說明
建立的監聽的狀態為 stopped。建立完成後,調用 StartLoadBalancerListener 介面啟動監聽來轉寄流量。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
slb:CreateLoadBalancerTCPListener |
create |
AccessControlList
*LoadBalancer
|
|
無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
否 |
傳統型Server Load Balancer執行個體的地區 ID。 您可以從地區和可用性區域列表或通過調用 DescribeRegions 介面查詢地區 ID。 |
cn-hangzhou |
| LoadBalancerId |
string |
是 |
傳統型Server Load Balancer執行個體的 ID。 |
lb-bp1b6c719dfa08ex**** |
| ListenerPort |
integer |
是 |
傳統型Server Load Balancer執行個體前端使用的連接埠。 取值範圍:1~65535。 |
80 |
| BackendServerPort |
integer |
否 |
傳統型Server Load Balancer執行個體後端使用的連接埠。 取值範圍:1~65535。 如果不使用伺服器組(不指定 vServerGroupId),則該參數必選。 |
80 |
| Tag |
array<object> |
否 |
標籤列表。 |
|
|
object |
否 |
標籤列表。 |
||
| Key |
string |
否 |
監聽的標籤鍵。N 的取值範圍:1~20。一旦傳入該值,則不允許為空白字串。最多支援 64 個字元,不能以 |
TestKey |
| Value |
string |
否 |
監聽的標籤值。N 的取值範圍:1~20。一旦傳入該值,可以為空白字串。最多支援 128 個字元,不能以 |
TestValue |
| Bandwidth |
integer |
是 |
監聽的頻寬峰值,單位:Mbps。取值:
|
-1 |
| Scheduler |
string |
否 |
調度演算法。取值:
說明
僅效能保障型執行個體支援 sch 和 tch 一致性 hash 演算法。 |
wrr |
| PersistenceTimeout |
integer |
否 |
會話保持的逾時時間。單位:秒。 取值範圍:0~3600。 預設值:0,表示關閉會話保持。 |
0 |
| EstablishedTimeout |
integer |
否 |
連線逾時時間。單位:秒。 取值範圍:10~900。 |
500 |
| HealthyThreshold |
integer |
否 |
健全狀態檢查連續成功多少次後,將後端伺服器的健全狀態檢查狀態由 fail 判定為 success。 取值範圍: 2~10。 |
4 |
| UnhealthyThreshold |
integer |
否 |
健全狀態檢查連續失敗多少次後,將後端伺服器的健全狀態檢查狀態由 success 判定為 fail。 取值範圍:2~10。 |
4 |
| HealthCheckConnectTimeout |
integer |
否 |
每次健全狀態檢查響應的最大逾時時間。單位:秒。 取值範圍:1~300。 預設值:5。 |
100 |
| HealthCheckConnectPort |
integer |
否 |
健全狀態檢查使用的連接埠。 取值範圍:1~65535。 不設定此參數時,表示使用後端服務連接埠(BackendServerPort)。 |
80 |
| healthCheckInterval |
integer |
否 |
健全狀態檢查的時間間隔。單位:秒。 取值範圍:1~50。 |
3 |
| HealthCheckDomain |
string |
否 |
用於健全狀態檢查的網域名稱。取值:
|
172.XX.XX.6 |
| HealthCheckURI |
string |
否 |
用於健全狀態檢查的 URI。長度限制為 1~80,只能使用字母、數字、短劃線(-)、正斜線(/)、半形句號(.)、百分比符號(%)、井號(#)和 and(&)這些字元。 URI 不能只為正斜線(/),但必須以正斜線(/)開頭。 當 TCP 監聽需要使用 HTTP 健全狀態檢查時可配置此參數,如不配置則按 TCP 健全狀態檢查。 |
/test/index.html |
| HealthCheckHttpCode |
string |
否 |
健全狀態檢查正常的 HTTP 狀態代碼,多個狀態代碼用半形逗號(,)分割。取值:
|
http_2xx,http_3xx |
| HealthCheckType |
string |
否 |
健全狀態檢查類型。取值:
|
tcp |
| VServerGroupId |
string |
否 |
虛擬伺服器組 ID。 |
rsp-cige6j**** |
| MasterSlaveServerGroupId |
string |
否 |
主備伺服器組 ID。 說明
虛擬伺服器組 ID 和主備伺服器組 ID 只能選擇一個。 |
rsp-0bfucw**** |
| AclId |
string |
否 |
監聽綁定的存取原則組 ID。 說明
當 AclStatus 參數的值為 on 時,該參數必選。 |
acl-uf60jwfiv6****** |
| AclType |
string |
否 |
存取控制類型:
一旦設定白名單,就只有白名單中的 IP 可以訪問負載平衡監聽。如果開啟了白名單訪問,但存取原則組中沒有添加任何 IP,則負載平衡監聽會轉寄全部請求。
如果開啟了黑名單訪問,但存取原則組中沒有添加任何 IP,則負載平衡監聽會轉寄全部請求。 說明
當 AclStatus 參數的值為 on 時,該參數有效。 |
black |
| AclStatus |
string |
否 |
是否開啟存取控制功能。取值:
|
off |
| Description |
string |
否 |
自訂監聽名稱。 長度限制為 1~256 個字元,支援中文、字母、數字、短劃線(-)、正斜線(/)、半形句號(.)和底線(_)。 |
tcp_80 |
| ConnectionDrain |
string |
否 |
是否開啟串連優雅中斷。取值:
|
off |
| ConnectionDrainTimeout |
integer |
否 |
設定串連優雅中斷逾時時間。單位:秒。 取值範圍:10~900。 說明
當 ConnectionDrain 取值為 on 時,該選項必選。 |
300 |
| ProxyProtocolV2Enabled |
boolean |
否 |
是否支援通過 Proxy Protocol 協議攜帶用戶端源地址到後端伺服器。取值:
|
false |
| HealthCheckSwitch |
string |
否 |
是否開啟健全狀態檢查。取值:
|
on |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
CEF72CEB-54B6-4AE8-B225-F876FF7BA984 |
樣本
正常返回樣本
JSON格式
{
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidParameterValue.SpecNotSupport | The loadBalancer of shared spec does not support the parameter value, %s. | |
| 400 | OperationNotSupport.Acl | The cloud box instance does not support acl. | |
| 400 | InvalidParameterValue.RegionNotSupport | The region does not support the parameter value, %s. | |
| 400 | Abs.VServerGroupIdAndMasterSlaveServerGroupId.MissMatch | The parameters VServerGroupId or MasterSlaveServerGroupId miss match. | |
| 400 | IpVersionConflict | The ip version of this LoadBalancer and the Acl is conflict. | |
| 400 | InvalidParameterValue.ZoneNotSupport | The zone does not support the parameter value, %s. | |
| 400 | ListenerProcessing | A previous configuration of the listener is pending, please try again later. | |
| 400 | AclNotExist | Acl does not exist. | |
| 400 | InvalidParameter.ListenerPortConflict | There is conflict listener port exists. | |
| 400 | InvalidParameter.ZoneNotSupport | The zone does not support the parameter %s. | |
| 400 | InvalidParam.VServerGroupId | The specified VServerGroupId is invalid. | |
| 400 | MissingParam.HealthCheckConnectPort | The parameter HealthCheckConnectPort is required. | |
| 400 | InvalidParam.ListenerPort | The specified ListenerPort is invalid. | |
| 400 | InvalidParam.StartPort | The specified StartPort is invalid. | |
| 400 | InvalidParamSize.PortRange | The size of param PortRange is invalid. | |
| 400 | InvalidParam.EndPort | The specified EndPort is invalid. | |
| 400 | Duplicated.AclEntry | %s. | |
| 400 | OperationUnsupported.SetAccessControl | The singleTunnel/anyTunnel loadbalancer does not support config AccessControlList. | |
| 400 | InvalidParam.PortRange | The specified PortRange is invalid. | |
| 400 | InvalidParameter.RegionNotSupport | The region does not support the parameter: %s. | |
| 400 | LbNotSupportTcpssl | You cannot create a TCP SSL type listener for the specified load balancer. | |
| 400 | LbSupportTcpsslOnly | The specified load balancer supports TCP SSL type listener only. | |
| 400 | ListenerNotSupportRule | You cannot create a rule for the specified listener. | |
| 400 | ListenerPortConflict | The specified ListenerPort is conflict with other listener. | |
| 400 | ResourceNotFound.VServerGroup | %s. | |
| 400 | IllegalParam.FailoverThreshold | The parameter FailoverThreshold is illegal. | |
| 400 | IllegalParam.FailoverStrategy | The parameter FailoverStrategy is illegal. | |
| 400 | MasterSlaveServerConflict | The servers are conflict for MasterSlaveGroup. | |
| 400 | OperationDenied.HealthCheckClosedForMasterSlaveMode | The operation is denied because of HealthCheckClosedForMasterSlaveMode. | |
| 400 | IllegalParam.HealthCheck | The param of HelathCheck is illegal. | |
| 400 | Mismatch.SlbSpecTypeAndListenerProtocol | The SlbSpecType and ListenerProtocol are mismatched. | |
| 400 | OperationDenied.FullNatModeNotAllowed | The operation is not allowed because of FullNatModeNotAllowed. | |
| 400 | OperationDenied.OnlyIpv4SlbSupport | The operation is not allowed because of OnlyIpv4SlbSupport. | |
| 400 | SpecNotSupportParameter | The instance with share spec does not support FullNatEnabled parameter. | |
| 400 | InvalidParam.TagValue | %s. | |
| 400 | InvalidParam.TagKey | %s. | |
| 400 | SizeLimitExceeded.Tag | %s. | |
| 400 | MissingParam.TagKey | The param MissingParam.TagKey is missing. | |
| 400 | MissingParameter | The BackendServerPort or VServerGroupId is required at lease one. | |
| 400 | AclListenerOverLimit | This acl has reached the limit of binding to listeners. | |
| 400 | QuotaLimitExceeds.AclAttachedToListener | The number of Acl bound listeners has reached the quota limit | |
| 400 | QuotaLimitExceeds.TotalAclEntry | The number of Acl entries has reached the quota limit. | |
| 400 | QuotaLimitExceeds.AclListenerOverLimit | This acl has reached the limit of binding to listeners. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。