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

负载均衡

复制全文
下载 pdf
后端服务器组
ModifyNLBServerGroupAttributes - 修改服务器组
复制全文
下载 pdf
ModifyNLBServerGroupAttributes - 修改服务器组
调用 ModifyNLBServerGroupAttributes 接口,修改服务器组的名称、描述或健康检查信息。​
使用说明​
调用一次接口最多可修改20台后端服务器。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下表中非必选参数不传入则表示保持原有配置不变。​
Action String 必选 示例值:ModifyNLBServerGroupAttributes​
要执行的操作,取值为 ModifyNLBServerGroupAttributes。​
​
Version String 必选 示例值:2020-04-01​
API版本信息,当前版本为 2020-04-01。​
​
ServerGroupId String 必选 示例值:rsp-bp1o94dp5i6ea****​
服务器组ID。​
您可以调用DescribeNLBServerGroups接口,获取服务器组ID。​
​
ServerGroupName String 可选 示例值:myservergroup​
服务器组的名称。​
  • 必须以字母、数字或中文开头,可包含以下特殊字符:点号(.)、下划线(_)和中划线(-)。​
  • 长度限制为1 ~ 128个字符。​
​
Description String 可选 示例值:This is a servergroup.​
服务器组的描述。​
  • 必须以字母、数字或中文开头,可包含以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为0~ 255个字符。​
​
Scheduler String 可选 示例值:wrr​
NLB转发流量时遵循的规则。​
  • wrr:加权轮询,权重值越高的后端服务器,被轮询到的次数(概率)越高。​
  • wlc:加权最小连接数,在最少连接数的基础上,根据后端服务器的不同处理能力,给每个服务器分配不同的权重,使其能够接受相应权值数的服务请求。​
  • sh:源地址哈希,基于源IP地址的一致性哈希,相同的源地址会调度到相同的后端服务器。​
​
ConnectionDrainEnabled Boolean 可选 示例值:true​
是否开启连接优雅中断。​
请严格按照以下枚举值的大小写输入,不要传入其他取值。​
  • true:开启。​
  • false:关闭。​
​
ConnectionDrainTimeout Integer 可选 示例值:60​
连接优雅中断超时时间,取值范围为0~900秒。​
参数ConnectionDrainEnabled由“false”改为“true”时,该参数为必填。​
​
PreserveClientIpEnabled Boolean 可选 示例值:true​
是否开启源地址保持。​
请严格按照以下枚举值的大小写输入,不要传入其他取值。​
  • true:开启。NLB转发给后端服务器的数据包中会携带客户端源IP地址。​
  • false:关闭。​
​
SessionPersistenceEnabled Boolean 可选 示例值:true​
是否开启会话保持。​
请严格按照以下枚举值的大小写输入,不要传入其他取值。​
  • true:开启,支持基于源IP地址的会话保持。​
  • false:关闭。​
​
SessionPersistenceTimeout Integer 可选 示例值:10​
会话保持的超时时间,取值范围为1~3600秒。​
​
ProxyProtocolType String 可选 示例值:off​
是否启用Proxy-Protocol协议。取值如下:​
  • off:关闭。​
  • standard:开启。NLB将通过Proxy-Protocol协议携带客户端源IP地址转发至服务器,还需要在服务器上配置Proxy-Protocol。​
​
BypassSecurityGroupEnabled Boolean 可选 示例值:true​
是否开启放通后端安全组功能。仅服务器类型服务器组,可以配置此参数。​
  • true:开启。服务器组中的后端服务器的安全组不再校验NLB的流量,默认放通。​
  • false:未开启。​
​
TimestampRemoveEnabled Boolean 可选 示例值:true​
是否开启清除TCP/HTTP/HTTPS报文的timestamp(即时间戳)的功能。​
请严格按照以下枚举值的大小写输入,不要传入其他取值。​
  • true:开启。​
  • false:不开启。​
说明​
本功能正在邀测中,如需试用,请联系客户经理。​
​
HealthCheck.Enabled Boolean 可选 示例值:true​
监听器是否开启健康检查功能。​
请严格按照以下枚举值的大小写输入,不要传入其他取值。​
  • true :开启。​
  • false:关闭。​
说明​
以下参数仅当本参数的值为“true”时有效。​
​
HealthCheck.Type String 可选 示例值:TCP​
健康检查的类型。取值如下:​
  • TCP:发送SYN握手报文,以此检测后端服务器端口的状态是否正常。​
  • HTTP:发送HEAD或GET请求模拟浏览访问行为,以此检测后端服务器应用是否正常。​
  • UDP:发送ICMP或UDP探测报文,以此检测后端服务器是否正常。​
​
HealthCheck.Port String 可选 示例值:10​
健康检查的端口,取值范围 1~65535​
  • 服务器组未开启全端口转发时,该参数默认为0,表示使用后端服务器的端口进行健康检查。​
  • 服务器组开启全端口转发时,必须指定该参数。​
​
HealthCheck.Method String 可选 示例值:GET​
健康检查的方法。取值如下:​
  • GET:服务器需支持GET方法。​
  • HEAD:服务器仅返回HEAD头部信息,可以降低后端开销,但要求服务器支持HEAD方法。​
说明​
当HealthCheck.Type取值为“HTTP”时,该参数生效。​
​
HealthCheck.URI String 可选 示例值:/​
健康检查的路径。​
  • 必须以字符“/”开头。​
  • 可包含字母、数字、中划线(-)、下划线(_)、斜划线(/)、点号(.)、百分号(%)、问号(?)、#号(#)、连接符(&)和等号(=)。​
  • 长度限制在1~128字符之间。​
说明​
当HealthCheck.Type取值为“HTTP”时,该参数生效。​
​
HealthCheck.Domain String 可选 示例值:www.test​
健康检查的域名,需配置为服务器上真实对外提供服务的地址。​
  • 需至少包含一个点号(.),且不允许以点号(.)开头或结尾。​
  • 仅支持大小写字母、数字、短划线(-)、半角句号(.),‘-’不得出现在字符串的头部或尾部。​
  • 长度限制为1-80字符。​
  • 该参数不传入,则默认使用后端服务器的私网IP地址进行健康检查。​
​
HealthCheck.HttpCode String 可选 示例值:http_2xx,http_3xx​
健康检查正常的HTTP状态码。取值如下:​
  • http_2xx​
  • http_3xx​
  • http_4xx​
  • http_5xx​
说明​
当HealthCheck.Type取值为“HTTP”时,该参数生效。多个状态码使用,分隔。​
​
HealthCheck.UdpRequest String 可选 示例值:Request123​
UDP健康检查的请求字符串。​
  • 只允许包含字母和数字,最大长度限制为64个字符。​
  • 当参数Protocol配置为UDP,且参数HealthCheck.Enabled配置为on时,该参数生效。​
  • 参数HealthCheck.UdpRequest和HealthCheck.UdpExpect的取值只能同时为空或同时不为空。​
​
HealthCheck.UdpExpect String 可选 示例值:Expect123​
UDP健康检查的预期响应字符串。​
  • 只允许包含字母和数字,最大长度限制为64个字符。​
  • 当参数Protocol配置为UDP,且参数HealthCheck.Enabled配置为on时,该参数生效。​
  • 参数HealthCheck.UdpRequest和HealthCheck.UdpExpect的取值只能同时为空或同时不为空。​
​
HealthCheck.Interval Integer 可选 示例值:2​
健康检查的时间间隔,取值范围为1 ~ 300秒。​
​
HealthCheck.Timeout Integer 可选 示例值:2​
健康检查的响应超时时间,取值范围为1 ~ 60秒。​
如果后端服务器在指定时间内没有正确响应,则判定为健康检查“异常”。​
​
HealthCheck.HealthyThreshold Integer 可选 示例值:3​
健康检查的健康阈值,取值范围为2 ~ 10次。​
连续执行指定次数的健康检查,结果均为“正常”的后端服务器将被判定为健康检查“正常”。​
​
HealthCheck.UnhealthyThreshold Integer 可选 示例值:3​
健康检查的不健康阈值,取值范围为2 ~ 10次。​
连续执行指定次数的健康检查,结果均为“异常”的后端服务器将被判定为健康检查异常。​
​
​
​
返回参数​
RequestId String 示例值:2024092952539010225146063030****​
请求ID。​
​
​
​
请求示例​
​
GET /?Action=ModifyNLBServerGroupAttributes&Version=2020-04-01&ServerGroupId=rsp-bp1o94dp5i6ea****&ServerGroupName=myservergroup&Description=This is a servergroup.&Scheduler=wrr&ConnectionDrainEnabled=true&ConnectionDrainTimeout=60&PreserveClientIpEnabled=true&SessionPersistenceEnabled=true&SessionPersistenceTimeout=10&ProxyProtocolType=off&BypassSecurityGroupEnabled=true&TimestampRemoveEnabled=true&HealthCheck.Enabled=true&HealthCheck.Type=TCP&HealthCheck.Port=10&HealthCheck.Method=GET&HealthCheck.URI=/&HealthCheck.Domain=www.test&HealthCheck.HttpCode=http_2xx,http_3xx&HealthCheck.UdpRequest=Request123&HealthCheck.UdpExpect=Expect123&HealthCheck.Interval=2&HealthCheck.Timeout=2&HealthCheck.HealthyThreshold=3&HealthCheck.UnhealthyThreshold=3 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": "ModifyNLBServerGroupAttributes",​
"Version": "2020-04-01",​
"Service": "clb",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "2024092952539010225146063030****"​
}​
}​
​
错误码​
此处仅展示当前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​
InvalidBypassSecurityGroupEnabled.Malformed​
The specified BypassSecurityGroupEnabled is malformed.​
指定的 BypassSecurityGroupEnabled 参数格式不合法。​
400​
InvalidBypassSecurityGroupEnabled.UnSupportAction​
The specified Type of ServerGroup does not support this action.​
指定的后端服务器组类型不支持当前操作。​
400​
InvalidClientToken.Malformed​
The specified ClientToken is malformed.​
指定的 ClientToken 参数格式不合法。​
400​
InvalidConnectionDrainEnabled.Malformed​
The specified ConnectionDrainEnabled is malformed.​
指定的 ConnectionDrainEnabled 参数格式不合法。​
400​
InvalidConnectionDrainTimeout.Malformed​
The specified ConnectionDrainTimeout is malformed.​
指定的 ConnectionDrainTimeout 参数格式不合法。​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
指定的 Description 参数格式不合法。​
400​
InvalidHealthCheck.Domain.Malformed​
The specified HealthCheck.Domain is malformed.​
指定的 HealthCheck.Domain 参数格式不合法。​
400​
InvalidHealthCheck.Enabled.Malformed​
The specified HealthCheck.Enabled is malformed.​
指定的 HealthCheck.Enabled 参数格式不合法。​
400​
InvalidHealthCheck.HealthyThreshold.Malformed​
The specified HealthCheck.HealthyThreshold is malformed.​
指定的 HealthCheck.HealthyThreshold 参数格式不合法。​
400​
InvalidHealthCheck.HttpCode.Malformed​
The specified HealthCheck.HttpCode is malformed.​
指定的 HealthCheck.HttpCode 参数格式不合法。​
400​
InvalidHealthCheck.Interval.Malformed​
The specified HealthCheck.Interval is malformed.​
指定的 HealthCheck.Interval 参数格式不合法。​
400​
InvalidHealthCheck.Method.Malformed​
The specified HealthCheck.Method is malformed.​
指定的 HealthCheck.Method 参数格式不合法。​
400​
InvalidHealthCheck.Port.Malformed​
The specified HealthCheck.Port is malformed.​
指定的 HealthCheck.Port 参数格式不合法。​
400​
InvalidHealthCheck.Timeout.Malformed​
The specified HealthCheck.Timeout is malformed.​
指定的 HealthCheck.Timeout 参数格式不合法。​
400​
InvalidHealthCheck.Type.Malformed​
The specified HealthCheck.Type is malformed.​
指定的 HealthCheck.Type 参数格式不合法。​
400​
InvalidHealthCheck.URI.Malformed​
The specified HealthCheck.URI is malformed.​
指定的 HealthCheck.URI 参数格式不合法。​
400​
InvalidHealthCheck.UdpExpect.Malformed​
The specified HealthCheck.UdpExpect is malformed.​
指定的 HealthCheck.UdpExpect 参数格式不合法。​
400​
InvalidHealthCheck.UdpRequest.Malformed​
The specified HealthCheck.UdpRequest is malformed.​
指定的 HealthCheck.UdpRequest 参数格式不合法。​
400​
InvalidHealthCheck.UdpRequestAndExpectMismatch​
The HealthCheck UdpRequest is not matched with HealthCheck UdpExpect.​
指定服务器组的 UdpRequest 与 UdpExpect 不匹配。​
400​
InvalidHealthCheck.UnhealthyThreshold.Malformed​
The specified HealthCheck.UnhealthyThreshold is malformed.​
指定的 HealthCheck.UnhealthyThreshold 参数格式不合法。​
400​
InvalidHealthCheckType.ServerGroupProtocolMismatch​
The specified HealthCheck type is not matched with ServerGroup protocol.​
指定的健康检查类型与服务器组协议不匹配。​
400​
InvalidPreserveClientIpEnabled.Malformed​
The specified PreserveClientIpEnabled is malformed.​
指定的 PreserveClientIpEnabled 参数格式不合法。​
400​
InvalidProxyProtocolType.Malformed​
The specified ProxyProtocolType is malformed.​
指定的 ProxyProtocolType 参数格式不合法。​
400​
InvalidScheduler.Malformed​
The specified Scheduler is malformed.​
指定的 Scheduler 参数格式不合法。​
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​
InvalidServerGroupName.Malformed​
The specified ServerGroupName is malformed.​
指定的 ServerGroupName 参数格式不合法。​
400​
InvalidServerGroupProxyProtocolType.UnSupportAction​
The specified ProxyProtocolType of ServerGroup does not support this action.​
指定的后端服务器组因 Proxy-Protocol 协议不支持当前操作。​
400​
InvalidSessionPersistenceEnabled.Malformed​
The specified SessionPersistenceEnabled is malformed.​
指定的 SessionPersistenceEnabled 参数格式不合法。​
400​
InvalidSessionPersistenceTimeout.Malformed​
The specified SessionPersistenceTimeout is malformed.​
指定的 SessionPersistenceTimeout 参数格式不合法。​
400​
InvalidTimestampRemoveEnabled.Malformed​
The specified TimestampRemoveEnabled is malformed.​
指定的 TimestampRemoveEnabled 参数格式不合法。​
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​
InvalidServerGroup.NotFound​
The specified ServerGroup does not exist.​
指定的后端服务器组不存在。​
409​
InvalidOperation.Conflict​
The specified resource operation conflicts.​
指定的资源操作冲突。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
幂等请求处理中。​
​
​
最近更新时间:2026.03.11 14:59:12
这个页面对您有帮助吗?
有用
有用
无用
无用