You need to enable JavaScript to run this app.
文档中心
负载均衡

负载均衡

复制全文
下载 pdf
后端服务器组
CreateServerGroup - 创建后端服务器组
复制全文
下载 pdf
CreateServerGroup - 创建后端服务器组
调用 CreateServerGroup 接口,创建一个后端服务器组。​
使用说明​
  • 每个CLB实例默认最多可创建200个后端服务器组。​
  • 调用一次接口最多可添加20台后端服务器。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
Action String 必选 示例值:CreateServerGroup​
要执行的操作,取值:CreateServerGroup。​
​
Version String 必选 示例值:2020-04-01​
API的版本信息,当前版本为 2020-04-01。​
​
LoadBalancerId String 必选 示例值:clb-bp1b6c719dfa08ex****​
负载均衡实例的ID。​
您可以调用DescribeLoadBalancers接口,查询负载均衡实例ID。​
​
ServerGroupName String 可选 示例值:myservergroup​
后端服务器组名称。​
  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:点号(.)、下划线(_)和中划线(-)。​
  • 限制为1 ~ 128个字符。​
  • 不填默认为后端服务器组ID。​
​
Description String 可选 示例值:This is a servergroup.​
后端服务器组的描述。​
  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为0 ~ 255个字符。​
  • 不填则默认为空字符串。​
​
AddressIpVersion String 可选 示例值:ipv4​
后端服务器组的IP地址类型。取值如下:​
  • ipv4(默认值):表示该后端服务器组IPv4类型。​
  • ipv6:表示该后端服务器组为IPv6类型。​
说明​
支持IPv6后端的功能正在邀测中,如需试用,请联系客户经理。​
​
Type String 可选 示例值:instance​
后端服务器组的类型。取值如下:​
  • instance(默认值):云服务器实例。​
  • ip:IP地址。​
IP地址作为后端服务器的功能正在邀测中,如需试用,请联系客户经理。​
​
Servers.N.Type String 必选 示例值:ecs​
后端服务器的类型。​
  • 当参数Type取instance时,取值如下:​
  • ecs:云服务器实例。​
  • eni:网卡。​
  • 当参数Type取ip时,本参数取值为ip。​
  • 参数 - N:表示后端服务器的序号。取值范围:1 ~ 20。​
​
Servers.N.InstanceId String 必选 示例值:i-3tkuehz8oa3vj0wz****​
后端服务器。​
  • 取值情况如下:​
  • 当Servers.N.Type 取ecs时,传云服务器实例的ID。您可以调用DescribeInstances接口,查询云服务器实例ID。​
  • 当Servers.N.Type 取eni时,传已挂载至云服务器的辅助网卡的ID。您可以调用DescribeNetworkInterfaces接口,查询网卡ID。​
  • 当Servers.N.Type 取ip时,传IP地址作为后端服务器。​
  • 参数 - N:表示后端服务器的序号。取值范围:1 ~ 20。​
  • 多个后端服务器ID间使用“&”分隔。​
​
Servers.N.Weight Integer 可选 示例值:100​
后端服务器的权重,取值范围为0 ~ 100。​
  • 不填则默认为0。0表示不会将请求转发给该后端服务器。​
  • 参数 - N:表示后端服务器的序号。取值范围:1 ~ 20。​
​
Servers.N.Ip String 必选 示例值:192.XX.XX.2​
后端服务器的私网IP地址。​
  • 参数 - N:表示后端服务器的序号。取值范围:1 ~ 20。​
  • 多个后端服务器IP之间使用“&”分隔。​
​
AnyPortEnabled String 可选 示例值:on​
后端服务器组是否开启全端口转发。​
  • on:开启。​
  • off(默认值):关闭。​
说明​
该参数正在邀测中,如需试用,请联系客户经理。​
​
Servers.N.Port Integer 必选 示例值:88​
后端服务器接收请求的端口号,取值范围为1~65535。​
参数 - N:表示后端服务器的序号。取值范围:1 ~ 20。​
说明​
  • 参数AnyPortEnabled为“off”,且需要同时添加后端服务器时,该参数必须传入;参数AnyPortEnabled为“on”时,该参数默认为0。​
  • 如果您不希望在创建后端服务器组的同时添加后端服务器,那么可以不传入该参数。​
  • 多个后端服务器IP之间使用“&”分隔。​
​
Servers.N.Description String 可选 示例值:ecs1​
后端服务器的描述。​
  • 参数 - N:表示后端服务器的序号。取值范围:1 ~ 20。​
  • 必须以字母、数字或中文开头,可包含字母、数字、中文和以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为0 ~ 255个字符。​
  • 不填则默认为空字符串。​
​
Tags.N.Key String 可选 示例值:key1​
用户标签的标签键。​
  • 参数 - N:表示标签键的序号,取值范围:1~20。​
  • 多个标签键之间用&分隔。​
  • 不能以 volc:或sys:开头,包括任意大小写形式。​
  • 长度取值范围为1~128字符,允许输入各国语言文字、数字、空格( )、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、中划线(-)和@(@)。​
  • 若标签键开头或结尾存在空格,系统会自动为其去除。​
说明​
同一资源的标签键不允许重复。​
​
Tags.N.Value String 可选 示例值:value1​
用户标签的标签值。​
  • 参数 - N:表示标签值的序号,取值范围:1~20。​
  • 多个标签值之间用&分隔。​
  • 长度取值范围为0~256字符,不填默认为空。​
  • 允许输入各国语言文字、数字、空格( )、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、中划线(-)和@(@)。​
  • 大小写敏感。​
  • 若标签值开头或结尾存在空格,系统会自动为其去除。​
说明​
若传入该参数,则必须先传入Tags.N.Key。​
​
​
​
返回参数​
RequestId String 示例值:20210811152539010225146063030****​
请求ID。​
​
ServerGroupId String 示例值:rsp-bp1o94dp5i6ea****​
后端服务器组ID。​
​
​
​
请求示例​
​
GET /?Action=CreateServerGroup&Version=2020-04-01&LoadBalancerId=clb-bp1b6c719dfa08ex****&Servers.1.Type=ecs&Servers.1.InstanceId=i-3tkuehz8oa3vj0wz****&Servers.1.Ip=192.XX.XX.2&Servers.1.Port=88​
Host: clb.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/clb/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "CreateServerGroup",​
"Version": "2020-04-01",​
"Service": "clb",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "20210811152539010225146063030****",​
"ServerGroupId": "rsp-bp1o94dp5i6ea****"​
}​
}​
​
错误码​
此处仅展示当前API的错误码,更多错误码请参见公共错误码。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidAddressIpVersion.LoadBalancerMismatch​
The specified AddressIpVersion and LoadBalancer are not matched.​
指定的 IP 类型与负载均衡不匹配。​
400​
InvalidAddressIpVersion.Malformed​
The specified AddressIpVersion is malformed.​
指定的 AddressIpVersion 参数格式不合法。​
400​
InvalidAddressIpVersion.TypeMismatch​
The specified AddressIpVersion and Type are not matched.​
指定的 IP 类型与服务器组类型不匹配。​
400​
InvalidAddressIpVersion.VpcMismatch​
The specified AddressIpVersion and Vpc are not matched.​
指定的 IP 类型与 VPC 不匹配。​
400​
InvalidAnyPortEnabled.Malformed​
The specified AnyPortEnabled is malformed.​
指定的 AnyPortEnabled 参数格式不合法。​
400​
InvalidBackendServer.ServerVpcMismatch​
The specified BackendServer and Vpc are not matched.​
指定的后端服务器与 VPC 不匹配。​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
指定的 Description 参数格式不合法。​
400​
InvalidEni.UnSupportAction​
The specified Eni does not support this action.​
指定的网卡不支持当前操作。​
400​
InvalidIncorrectOrder.Malformed​
The specified index order is malformed.​
指定的索引顺序参数格式不合法。​
400​
InvalidLoadBalancer.InvalidStatus​
The specified LoadBalancer is not in the correct status for the request.​
指定的负载均衡所处状态无法响应该请求。​
400​
InvalidLoadBalancer.UnSupportAction​
The specified LoadBalancer does not support this action.​
指定的负载均衡不支持当前操作。​
400​
InvalidName.Malformed​
The specified Name is malformed.​
指定的 Name 参数格式不合法。​
400​
InvalidProject.Malformed​
The specified Project is malformed.​
指定的 Project 参数格式不合法。​
400​
InvalidQuotaCode.Malformed​
The specified QuotaCode is malformed.​
指定的 QuotaCode 参数格式不合法。​
400​
InvalidServer.Type​
The specified Server type not match with ServerGroup.​
指定的后端服务器类型与服务器组类型不一致。​
400​
InvalidServerId.ServerIPMismatch​
The specified serverIP and InstanceId are not matched.​
指定的后端服务器 ID 与 IP 不匹配。​
400​
InvalidServerIp.UnSupportAction​
The specified Server Ip does not support this action.​
指定的后端服务器 IP 不支持当前操作。​
400​
InvalidServers.Description.Malformed​
The specified Servers.Description is malformed.​
指定的 Servers.Description 参数格式不合法。​
400​
InvalidServers.Ip.Malformed​
The specified Servers.Ip is malformed.​
指定的 Servers.Ip 参数格式不合法。​
400​
InvalidServers.Port.Malformed​
The specified Servers.Port is malformed.​
指定的 Servers.Port 参数格式不合法。​
400​
InvalidServers.Type.Malformed​
The specified Servers.Type is malformed.​
指定的 Servers.Type 参数格式不合法。​
400​
InvalidServers.Weight.Malformed​
The specified Servers.Weight is malformed.​
指定的 Servers.Weight 参数格式不合法。​
400​
InvalidTagKey.Malformed​
The specified TagKey is malformed.​
指定的 TagKey 参数格式不合法。​
400​
InvalidTagValue.Malformed​
The specified TagValue is malformed.​
指定的 TagValue 参数格式不合法。​
400​
InvalidType.Malformed​
The specified Type is malformed.​
指定的 Type 参数格式不合法。​
400​
LimitExceeded.ServerNumber​
You've reached the limit on the number of add servers that you can operate​
已达到单次可操作的后端服务器的数量上限。​
400​
LimitExceeded.ServiceManagedTag​
You've reached the limit on the number of service managed tags that you can create.​
已达到单次可创建受管资源标签键值数量的上限。​
400​
LimitExceeded.TagOperation​
You've reached the limit on the number of tags that you can operate at a time.​
已达到单次可操作的标签条目数量上限。​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, the ''.​
该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如 。​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, the 'InstanceId'.​
该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如 InstanceId。​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, the 'LoadBalancerId'.​
该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如 LoadBalancerId。​
400​
QuotaExceed.ServerGroupNumberEachInstance​
You've reached the limit on the number of ServerGroups that you can create.​
已达到可创建后端服务器组的数量的配额上限。​
400​
QuotaExceed.ServerNumberEachInstance​
You've reached the limit on the number of Servers that you can create.​
已达到可创建后端服务器的数量的配额上限。​
400​
UnsupportedOperation.AccountArrears​
The request on the specified instance is denied due to the account in arrears status.​
因账户处于欠费状态,对于该实例的操作请求被拒绝。​
403​
Forbidden​
You are not authorized to perform operations on the service managed tag.​
无权限对指定资源打上受管标签。​
403​
Forbidden​
You are not authorized to perform operations on the system tag.​
无权限对指定资源打上系统标签。​
403​
Forbidden​
You are not authorized to perform operations on the specified service.​
无权限对指定服务进行操作。​
403​
InvalidResourceType.ServcieManaged​
The specified ResourceType is managed by a service.​
指定的资源是服务托管资源。​
404​
InvalidExclusiveCluster.NotFound​
The specified ExclusiveCluster does not exist.​
指定的独占集群不存在。​
404​
InvalidLoadBalancer.NotFound​
The specified LoadBalancer does not exist.​
指定的负载均衡不存在。​
404​
InvalidProject.NotFound​
The specified Project does not exist.​
指定的项目不存在。​
404​
InvalidServer.NotFound​
The specified Server does not exist.​
指定的后端服务器不存在。​
404​
InvalidVPC.NotFound​
The specified VPC does not exist.​
指定的 VPC 不存在。​
409​
InvalidServer.Conflict​
The specified Server already exists.​
指定的后端服务器已存在。​
412​
InvalidExclusiveCluster.Expired​
The specified ExclusiveCluster has expired.​
指定的独占集群已过期。​
412​
InvalidExclusiveCluster.UnPurchased​
The specified ExclusiveCluster is not purchased.​
指定的独占集群未购买。​
412​
InvalidLoadBalancer.Expired​
The specified LoadBalancer has expired.​
指定的负载均衡已过期。​
500​
InternalError​
An internal error has occurred.​
发生内部错误。​
​
​
最近更新时间:2026.02.13 10:32:59
这个页面对您有帮助吗?
有用
有用
无用
无用