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

负载均衡

复制全文
下载 pdf
后端服务器组
AddNLBBackendServers - 添加后端服务器
复制全文
下载 pdf
AddNLBBackendServers - 添加后端服务器
调用 AddNLBBackendServers 接口,为指定服务器组添加后端服务器。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下表中,Servers.N.a类型参数中的“N”表示后端服务器的序号,取值范围为1 ~ 20。多个后端服务器之间使用&分隔。​
Action String 必选 示例值:AddNLBBackendServers​
要执行的操作,取值为 AddNLBBackendServers。​
​
Version String 必选 示例值:2020-04-01​
API版本信息,当前版本为 2020-04-01。​
​
ServerGroupId String 必选 示例值:rsp-bp1o94dp5i6ea****​
服务器组ID。您可以调用DescribeNLBServerGroups接口获取服务器组ID。​
​
Servers.N.Type String 必选 示例值:ecs​
后端服务器的类型。取值如下:​
  • ecs:云服务器实例。​
  • eni:网卡。​
  • ip:IP地址。​
说明​
  • 服务器组为“instance”类型且待添加的后端服务器为云服务器实例的主网卡时,服务器类型设置为“ecs”。​
  • 待添加的后端服务器为云服务器绑定的辅助网卡时,服务器类型设置为“eni”。​
  • 服务器组为“ip”类型时,服务器类型设置为“ip”。​
​
Servers.N.InstanceId String 必选 示例值:i-3tkuehz8oa3vj0wz****​
服务器实例的ID或IP地址。​
  • 服务器类型为“ecs”时,传入云服务器实例的ID。您可以调用DescribeInstances接口云服务器实例ID。​
  • 服务器类型为“eni”时,传入已绑定云服务器实例的网卡ID。您可以调用DescribeNetworkInterfaces接口获取网卡ID。​
  • 服务器类型为“ip”时,传入后端服务器的IP地址。​
​
Servers.N.ZoneId String 可选 示例值:cn-beijing-a​
指定后端服务器关联的NLB实例可用区。当参数Servers.N.Type为ip时,此参数必填。​
  • NLB实例开启跨可用区转发功能时,该后端服务器可以接收来自NLB实例所有可用区的流量。​
  • NLB实例关闭跨可用区转发功能时,则该后端服务器仅接收来自指定可用区的流量。​
​
Servers.N.Weight Integer 可选 示例值:100​
后端服务器的权重,取值范围为0 ~ 100。​
  • 权重为0,表示不会将请求转发给该服务器。​
  • 该参数不传入,则默认为0。​
​
Servers.N.Ip String 必选 示例值:192.168.1.2​
后端服务器的私网IP地址。​
  • 您可以调用DescribeInstances接口获取“ecs”类型后端服务器的私网IP地址。​
​
Servers.N.Port Integer 必选 示例值:88​
后端服务器接收请求的端口号,取值范围为 1~65535。​
  • 参数AnyPortEnabled为“false”,即服务器组未开启全端口转发时,该参数为必填。​
  • 参数AnyPortEnabled为“true”,即服务器组开启全端口转发时,该参数默认为0。​
​
Servers.N.Description String 可选 示例值:ecs1​
后端服务器的描述,默认值为空字符串。​
  • 必须以字母、数字或中文开头,可包含以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)​
  • 长度限制为0 ~ 255个字符。​
  • 该参数不传入,则默认为空字符串。​
​
​
​
返回参数​
RequestId String 示例值:2024092952539010225146063030****​
请求ID。​
​
ServerIds String[] 示例值:["rs-3cig8e5o0kxs06c6rrsqn****", "rs-3cig8e7n1ozr46c6rrsfn****"]​
服务器组中所有后端服务器的ID。​
​
​
​
请求示例​
​
GET /?Action=AddNLBBackendServers&Version=2020-04-01&ServerGroupId=rsp-bp1o94dp5i6ea****&Servers.1.Type=ecs&Servers.1.InstanceId=i-3tkuehz8oa3vj0wz****&Servers.1.ZoneId=cn-beijing-a&Servers.1.Weight=100&Servers.1.Ip=192.168.1.2&Servers.1.Port=88&Servers.1.Description=ecs1 HTTP/1.1​
Host: clb.cn-beijing.volcengineapi.com​
Date: 20260310T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/clb/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "AddNLBBackendServers",​
"Version": "2020-04-01",​
"Service": "clb",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "2024092952539010225146063030****",​
"ServerIds": [​
"rs-3cig8e5o0kxs06c6rrsqn****",​
"rs-3cig8e7n1ozr46c6rrsfn****"​
]​
}​
}​
​
错误码​
此处仅展示当前API的错误码,更多错误码请参见公共错误码。​
​
状态码​
错误码​
错误信息​
说明​
400​
DryRunOperation​
Exception raised to indicate a successfully authorized action when the DryRun flag is set to true.​
该请求设置为DryRun操作,操作授权已获得许可,但未被实际执行。​
400​
IdempotentParameterMismatch​
Arguments on this idempotent request are inconsistent with arguments used in previous request(s).​
此幂等请求的参数与前一个请求中使用的参数不一致。​
400​
InvalidBackendServer.ServerVpcMismatch​
The specified BackendServer and Vpc are not matched.​
指定的后端服务器与 VPC 不匹配。​
400​
InvalidClientToken.Malformed​
The specified ClientToken is malformed.​
指定的 ClientToken 参数格式不合法。​
400​
InvalidEni.UnSupportAction​
The specified Eni does not support this action.​
指定的网卡不支持当前操作。​
400​
InvalidIncorrectOrder.Malformed​
The specified index order is malformed.​
指定的索引顺序参数格式不合法。​
400​
InvalidQuotaCode.Malformed​
The specified QuotaCode is malformed.​
指定的 QuotaCode 参数格式不合法。​
400​
InvalidServer.Type​
The specified Server type not match with ServerGroup.​
指定的后端服务器类型与服务器组类型不一致。​
400​
InvalidServerGroup.InvalidLoadBalancerBillingStatus​
The related LoadBalancers of the specified ServerGroup are not in the correct billing status for the request.​
指定的服务器组关联的负载均衡计费状态所处状态无法响应该请求。​
400​
InvalidServerGroup.InvalidStatus​
The specified ServerGroup is not in the correct status for the request.​
指定的服务器组所处状态无法响应该请求。​
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​
InvalidServers.ZoneId.Malformed​
The specified Servers.ZoneId is malformed.​
指定的 Servers.ZoneId 参数格式不合法。​
400​
LimitExceeded.ServerNumber​
You've reached the limit on the number of add servers that you can operate​
已达到单次可操作的后端服务器的数量上限。​
400​
QuotaExceed.ServerNumberEachInstance​
You've reached the limit on the number of servers that you can mount on instance.​
已达到单实例可挂载后端服务器的数量的配额上限。​
400​
QuotaExceed.ServerNumberEachServerGroup​
You've reached the limit on the number of servers that you can create.​
已达到单服务器组可以创建后端服务器的数量的配额上限。​
403​
Forbidden​
You are not authorized to perform operations on the specified service.​
无权限对指定服务进行操作。​
403​
InvalidResourceType.ServiceManaged​
The specified ResourceType is managed by a service.​
指定的资源是服务托管资源。​
404​
InvalidServer.NotFound​
The specified Server does not exist.​
指定的后端服务器不存在。​
404​
InvalidServerGroup.NotFound​
The specified ServerGroup does not exist.​
指定的后端服务器组不存在。​
404​
InvalidVPC.NotFound​
The specified VPC does not exist.​
指定的 VPC 不存在。​
404​
ServiceRoleForLoadBalancer.NotFound​
ServiceRoleForLoadBalancer does not exist.​
负载均衡服务关联角色不存在。​
409​
InvalidOperation.Conflict​
The specified resource operation conflicts.​
指定的资源操作冲突。​
409​
InvalidServer.Conflict​
The specified Server already exists.​
指定的后端服务器已存在。​
409​
InvalidServerPort.Conflict​
The specified Server Port already exists.​
指定的后端服务器端口已存在。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
幂等请求处理中。​
​
​
最近更新时间:2026.03.11 14:59:13
这个页面对您有帮助吗?
有用
有用
无用
无用