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

负载均衡

复制全文
下载 pdf
服务器组
ModifyServerGroupAttributes - 修改指定服务器组详细信息
复制全文
下载 pdf
ModifyServerGroupAttributes - 修改指定服务器组详细信息
调用 ModifyServerGroupAttributes 接口,修改指定服务器组信息。​
使用说明​
每秒最多提交 5 个 API 请求。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:ModifyServerGroupAttributes​
要执行的操作,取值:ModifyServerGroupAttributes。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
StickySessionConfig.CookieTimeout integer 可选 示例值:1000​
会话保持 Cookie 超时时间。仅在开启会话保持功能并选择植入 Cookie 时有效。 单位:秒。具体规则如下:​
  • 超时时间的取值范围:1~86400。 默认值为:1000。​
  • 当 StickySessionConfig.StickySessionEnabled 值为 on,且 StickySessionType 为 insert 时,此参数必填。​
  • 当 StickySessionConfig.StickySessionEnabled 值为 on,且 StickySessionType 为 server 时,此参数无效。​
​
StickySessionConfig.Cookie string 可选 示例值:MY_COOKIE​
服务配置的会话保持 Cookie 名称。仅在开启会话保持功能并选择重写 Cookie 时有效。 具体规则如下:​
  • Cookie 名称长度为1~200个字符。​
  • 名称只能包含 ASCII 英文字母和数字字符,不能包含半角逗号(,)、半角分号(;)或空格,也不能以美元符号($)开头。​
  • 当 StickySessionConfig.StickySessionEnabled 值为 on,且 StickySessionConfig.StickySessionType 为 server时,此参数必填。​
  • 当 StickySessionConfig.StickySessionEnabled 值为 on,且 StickySessionConfig.StickySessionType 为 insert 时,该参数无效。​
​
StickySessionConfig.StickySessionType string 可选 示例值:insert​
对 Cookie 的处理方式。当 StickySessionConfig.StickySessionEnabled 值为 on 时,此字段参数必填。取值如下:​
  • insert:植入 Cookie;​
  • ALB 会记录客户端请求第一次转发到的后端服务器。ALB 在返回请求中植入 Cookie ,后续客户端请求携带此 Cookie,ALB 会将请求转发到之前记录的后端服务器上。​
  • server:重写 Cookie;​
  • 开启重写 Cookie 的会话保持后,在客户端请求第一次转发到后端服务器后,ALB 在返回请求中发现您自定义的 Cookie 时,会对原来的 Cookie 进行重写。后续客户端请求携带改写后的 Cookie,ALB 会将请求转发到之前记录的后端服务器上。​
​
StickySessionConfig.StickySessionEnabled string 可选 示例值:off​
是否开启会话保持。取值如下:​
  • on:开启。​
  • off:关闭。​
​
HealthCheck.UnhealthyThreshold integer 可选 示例值:3​
健康检查的不健康阈值。​
  • 表示连续执行指定次数的健康检查,结果均为异常的后端服务器将判定为健康检查异常。​
  • 单位:次,取值:2~10,默认值为 3。​
​
HealthCheck.HealthyThreshold integer 可选 示例值:3​
健康检查的健康阈值。​
  • 表示连续执行指定次数的健康检查,结果均为正常的后端服务器将判定为健康检查正常。​
  • 单位:次,取值:2~10,默认值为 3。​
​
HealthCheck.Timeout integer 可选 示例值:2​
健康检查的响应超时时间。​
  • 表示如果后端服务器在指定的时间内没有正确响应,则判定为健康检查异常。​
  • 单位:秒,取值:1~60,默认值为 2。​
​
HealthCheck.Method string 可选 示例值:HEAD​
健康检查的方法。只有 HealthCheck.Protocol 设置为 HTTP 时该参数生效。取值如下:​
  • GET:服务器需支持GET方法。​
  • HEAD:服务器仅返回HEAD头部信息,可以降低后端性能消耗,服务器需要支持HEAD方法。​
​
HealthCheck.Domain string 可选 示例值:www.test.com​
健康检查的域名,需配置为后端服务器上真实对外提供服务的地址。只有 HealthCheck.Protocol 设置为 HTTP 时该参数生效。​
​
HealthCheck.URI string 可选 示例值:health​
健康检查的路径,需配置为后端服务器上真实对外提供的路径。默认值为 "/"。只有 HealthCheck.Protocol 设置为 HTTP 时该参数生效。​
​
HealthCheck.HttpCode string 可选 示例值:http_2xx,http_3xx​
健康检查正常的HTTP状态码,多个状态码间用半角逗号","分隔。只有 HealthCheck.Protocol 设置为 HTTP 时该参数生效。取值如下:​
  • http_2xx。​
  • http_3xx。​
  • http_4xx 。​
  • http_5xx 。​
​
HealthCheck.HttpVersion string 可选 示例值:HTTP1.0​
健康检查HTTP协议版本,只有 HealthCheck.Protocol 设置为 HTTP 时该参数生效。取值如下:​
  • HTTP1.0(使用API时,HTTP协议版本默认值)。​
  • HTTP1.1。​
​
HealthCheck.Protocol string 可选 示例值:HTTP​
健康检查协议。​
  • HTTP​
  • TCP​
​
Description string 可选 示例值:This is the default servergroup​
后端服务器组的描述。​
  • 不能以 http:// 或 https:// 开头。​
  • 必须以字母或中文开头,可包含数字、英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为1 ~ 255个字符。​
​
HealthCheck.Interval integer 可选 示例值:2​
执行健康检查的时间间隔。 单位:秒,取值:1~300s,默认值为 2。​
​
HealthCheck.Enabled string 可选 示例值:on​
监听器是否开启健康检查功能。取值如下:​
  • on:开启。​
  • off:不开启。​
​
Scheduler string 可选 示例值:wrr​
调度算法。取值如下:​
  • wrr:加权轮询。​
  • wlc:加权最小连接数。​
  • sh:源地址哈希。​
​
ServerGroupName string 可选 示例值:default_servergroup​
后端服务器组的名称。​
  • 必须以字母或中文开头,可包含数字、点号(.)、下划线(_)和短横线(-)。​
  • 限制为1 ~ 128个字符。​
  • 不传入该参数或该参数不传入数值时,默认为后端服务器组ID。​
​
HealthCheck.Port integer 可选 示例值:80​
健康检查端口。取值如下:​
  • 0:使用后端服务器端口进行健康检查。​
  • 1-65535:使用您指定的端口进行健康检查。​
​
CrossZoneEnabled string 可选 示例值:on​
是否开启服务器组的跨可用区负载均衡功能。​
  • 取值如下:​
  • on:开启。​
  • off:不开启。​
  • 如果您不开启该功能,服务器组只能关联标准版 ALB 实例。​
​
SlowStartConfig.SlowStartEnabled string 可选 示例值:off​
是否开启慢启动功能。取值如下:​
  • on:开启。开启后,新加入的健康后端服务器在设定时间内权重从 0 逐步上升到设定值,实现平滑预热。约束如下:​
  • 仅当调度算法为wrr(加权轮询)时,支持开启慢启动。​
  • 仅组内已有健康后端服务器时,新加入的健康服务器才会进入慢启动。​
  • off:不开启。​
说明​
慢启动功能正在邀测中,如需试用,请联系客户经理。​
​
SlowStartConfig.SlowStartDuration integer 可选 示例值:30​
慢启动持续时间。 单位:秒。取值范围:30~900。​
​
ServerGroupId string 必选 示例值:rsp-bp1o94dp5i6ea****​
后端服务器组ID。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId string 示例值:20210811152539010225146063030****​
请求ID。​
​
​
​
请求示例​
​
GET /?Action=ModifyServerGroupAttributes&ServerGroupId=rsp-1g1f1g8rwii****uxxxn4h9n&ServerGroupName=test&HealthCheck.HttpCode="http2_xx,http_3xx"&Version=2020-04-01 HTTP/1.1​
Host: alb.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/alb/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20210816110638****2514606306AF947C",​
"Action": "ModifyServerGroupAttributes",​
"Version": "2020-04-01",​
"Service": "alb",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "202108161106****22514606306AF947C"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
Invalid%s.Malformed​
MismatchThe specified %s is malformed.​
指定的 %s 参数格式不合法。​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, '%s'.​
该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如: %s。​
400​
InvalidParameter​
Data unmarshal failed.​
请求解析失败。​
400​
InvalidServerGroupName.Malformed​
The specified ServerGroupName is malformed.​
指定的 ServerGroupName 参数格式不合法。​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, 'HealthCheck.Domain'.​
该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如: HealthCheck.Domain。​
400​
InvalidHealthCheck.HttpVersion.Malformed​
The specified HealthCheck.HttpVersion is malformed.​
指定的 HealthCheck.HttpVersion 参数格式不合法。​
400​
InvalidServerGroup.InvalidStatus​
The specified ServerGroup is not in the correct status for the request.​
指定的服务器组所处状态无法响应该请求。​
400​
InvalidLoadBalancer.InvalidStatus​
The related LoadBalancer is not in the correct status for the request.​
关联的 ALB 实例所处状态无法响应该请求。​
400​
InvalidHealthCheck.Domain.Malformed​
The specified HealthCheck.Domain is malformed.​
指定的 HealthCheck.Domain 参数格式不合法。​
400​
InvalidHealthCheck.HttpCode.Malformed​
The specified HealthCheck.HttpCode is malformed.​
指定的 HealthCheck.HttpCode 参数格式不合法。​
400​
InvalidHealthCheck.URI.Malformed​
The specified HealthCheck.URI is malformed.​
指定的 HealthCheck.URI 参数格式不合法。​
400​
InvalidHealthCheck.Method.Malformed​
The specified HealthCheck.Method is malformed.​
指定的 HealthCheck.Method 参数格式不合法。​
400​
InvalidHealthCheck.Protocol.Malformed​
The specified HealthCheck.Protocol is malformed.​
指定的 HealthCheck.Protocol 参数格式不合法。​
400​
InvalidHealthCheck.UnhealthyThreshold.Malformed​
The specified HealthCheck.UnhealthyThreshold is malformed.​
指定的 HealthCheck.UnhealthyThreshold 参数格式不合法。​
400​
InvalidHealthCheck.Timeout.Malformed​
The specified HealthCheck.Timeout is malformed.​
指定的 HealthCheck.Timeout 参数格式不合法。​
400​
OperationDenied.AccountArrears​
The request on the specified resource is denied due to the account being in arrears status.​
因账号处于欠费状态,对于该资源的操作请求被拒绝。​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
指定的 Description 参数格式不合法。​
400​
InvalidScheduler.Malformed​
The specified Scheduler is malformed.​
指定的 Scheduler 参数格式不合法。​
400​
InvalidStickySessionConfig.StickySessionEnabled.Malformed​
The specified StickySessionConfig.StickySessionEnabled is malformed.​
指定的 StickySessionConfig.StickySessionEnabled 参数格式不合法。​
400​
InvalidStickySessionConfig.StickySessionType.Malformed​
The specified StickySessionConfig.StickySessionType is malformed.​
指定的 StickySessionConfig.StickySessionType 参数格式不合法。​
400​
InvalidStickySessionConfig.Cookie.Malformed​
The specified StickySessionConfig.Cookie is malformed.​
指定的 StickySessionConfig.Cookie 参数格式不合法。​
400​
InvalidStickySessionConfig.CookieTimeout.Malformed​
The specified StickySessionConfig.CookieTimeout is malformed.​
指定的 StickySessionConfig.CookieTimeout 参数格式不合法。​
400​
InvalidHealthCheck.Enabled.Malformed​
The specified HealthCheck.Enabled is malformed.​
指定的 HealthCheck.Enabled 参数格式不合法。​
400​
InvalidHealthCheck.Interval.Malformed​
The specified HealthCheck.Interval is malformed.​
指定的 HealthCheck.Interval 参数格式不合法。​
400​
InvalidHealthCheck.HealthyThreshold.Malformed​
The specified HealthCheck.HealthyThreshold is malformed.​
指定的 HealthCheck.HealthyThreshold 参数格式不合法。​
400​
InvalidHealthCheckPort.Malformed​
The specified HealthCheck.Port is malformed.​
指定的HealthCheck.Port参数格式不合法。​
400​
InvalidProtocol.CrossZoneEnabled​
The specified CrossZoneEnabled is malformed.​
指定的 CrossZoneEnabled 参数格式不合法。​
400​
OperationDenied.BackendServerRemoteOnNotSupport​
The request on the specified BackendServer is denied due to enabling Remote is prohibited when cross-zone forwarding disabled.​
因关闭跨 AZ 转发时,不支持开启远端模式,对于该后端服务器的操作请求被拒绝。​
400​
OperationDenied.StickySessionConfigEnabledUnsupported​
The request on the specified ServerGroup is denied due to enabling StickySessionConfig is prohibited when cross-zone forwarding disabled.​
因服务器组关闭跨 AZ 转发时不可开启会话保持,对于该服务器组的操作请求被拒绝。​
400​
InvalidSlowStartConfig.SlowStartEnabled.Malformed​
The specified SlowStartConfig.SlowStartEnabled is malformed.​
指定的 SlowStartConfig.SlowStartEnabled 参数格式不合法。​
400​
InvalidSlowStartConfig.SlowStartDuration.Malformed​
The specified SlowStartConfig.SlowStartDuration is malformed.​
指定的 SlowStartConfig.SlowStartDuration 参数格式不合法。​
400​
InvalidScheduler.SlowStartEnabledMismatch​
he specified Scheduler and SlowStartEnabled of ServerGroup do not match. Slow start only supports the WRR scheduling algorithm.​
指定的调度算法和慢启动开关不匹配。慢启动仅支持 wrr 调度算法。​
403​
Forbidden​
You are not authorized to configure the ServerGroup with cross-zone forwarding disabled.​
您无权限关闭服务器组的跨 AZ 转发。​
403​
Forbidden​
You are not authorized to configure the ServerGroup with slow start config.​
您无权限为服务器组开启慢启动配置。​
404​
InvalidServerGroup.NotFound​
The specified ServerGroup does not exist.​
指定的服务器组不存在。​
500​
InternalError​
An internal error has occurred.​
发生内部错误。请稍后重试或联系工程师进一步咨询。​
​
​
最近更新时间:2026.05.19 08:35:35
这个页面对您有帮助吗?
有用
有用
无用
无用