创建主备服务器组。一个主备服务器组只能包含两个后端服务器,一个为主服务器,另一个为备服务器。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
slb:CreateMasterSlaveServerGroup |
create |
Instance
*LoadBalancer
|
|
无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
传统型负载均衡实例的地域 ID。 |
cn-hangzhou |
| LoadBalancerId |
string |
是 |
传统型负载均衡实例 ID。 |
lb-bp1hv944r69al4j****** |
| MasterSlaveServerGroupName |
string |
否 |
主备服务器组名称。 |
Group1 |
| MasterSlaveBackendServers |
string |
否 |
主备服务器组列表。一个主备服务器组只能包含 2 个后端服务器。 包含以下参数:
说明
只有性能保障型实例支持添加 eni 和 eci 类型的后端服务器。
|
[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"82","ServerType":"Master","Description":"test-112" }, { "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"84","ServerType":"Slave","Description":"test-112" }] |
| Tag |
array<object> |
否 |
标签列表。 |
|
|
object |
否 |
标签列表。 |
||
| Key |
string |
否 |
资源标签键。N 的取值范围:1~20。一旦输入该值,则不允许为空字符串。 最多支持 64 个字符,不能以 |
test |
| Value |
string |
否 |
资源的标签值。N 的取值范围:1~20。一旦输入该值,可以为空字符串。
最多支持 128 个字符,不能以 |
1 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| MasterSlaveServerGroupId |
string |
主备服务器组 ID。 |
rsp-bp19au4****** |
| RequestId |
string |
请求 ID。 |
7CA4DB76-4D32-523B-822E-5C9****** |
| MasterSlaveBackendServers |
object |
||
| MasterSlaveBackendServer |
array<object> |
主备服务器组列表。 |
|
|
object |
主备服务器组列表。 |
||
| Type |
string |
后端服务器类型,取值:
|
ecs |
| Weight |
integer |
后端服务器的权重。 |
100 |
| Description |
string |
主备服务器组描述。 |
test-112 |
| Port |
integer |
后端服务器使用的端口。 |
82 |
| ServerId |
string |
要添加的后端服务器实例 ID。 |
i-bp1fq61enf4loa5i**** |
| ServerType |
string |
服务器类型。 取值:Master 或 Slave。 |
Master |
示例
正常返回示例
JSON格式
{
"MasterSlaveServerGroupId": "rsp-bp19au4******",
"RequestId": "7CA4DB76-4D32-523B-822E-5C9******",
"MasterSlaveBackendServers": {
"MasterSlaveBackendServer": [
{
"Type": "ecs",
"Weight": 100,
"Description": "test-112",
"Port": 82,
"ServerId": "i-bp1fq61enf4loa5i****",
"ServerType": "Master"
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | BACKEND_SERVERS_NUM_MUST_BE_TWO | Backend servers num must be 2. | 后端服务器数量必须是2。 |
| 400 | Mismatched.ZoneId | The zone of the server is not matched with the cloud box loadbalancer. | 当前服务器的可用区与云盒实例可用区不匹配。 |
| 400 | BACKEND_SERVERS_HAVE_SAME_PORT_AND_SERVERID | Backend servers have same port and serverId. | 后端服务器组中已存在具有相同的端口和服务器ID的虚拟服务器。 |
| 400 | BACKEND_SERVERS_CAN_ONLY_CONTAIN_ONE_MASTER_AND_ONE_SLAVE | Backend servers can only contain one master and one slave. | 主备虚拟服务器组只能包含一个主服务器和一个备服务器。 |
| 400 | BACKEND_SERVER_ID_CAN_NOT_EMPTY | Backend server id can not empty. | 后端服务器ID不能为空。 |
| 400 | INVALID_SERVER_TYPE | Invalid server type. | |
| 400 | BACKEND_SERVER_PORT_CAN_NOT_EMPTY | Backend server port can not empty. | 后端服务器端口不允许为空。 |
| 400 | RealServerPortNotSupport | Real server port not support. | 后端服务器端口不支持。 |
| 400 | OperationUnsupported.CreateMasterSlaveServerGroup | This type of backend server is not allowed to attached to singleTunnel or anyTunnel lb. | 这种类型的后端服务器不允许附加到 singleTunnel 或 anyTunnel lb。 |
| 400 | IncorrectStatus.RSByPassToas | %s. | 指定后端服务器的BypassToa配置无效。 |
| 400 | OperationFailed.ActionNotSupport | The loadbalancer does not support such action. | 当前实例不支持该操作。 |
| 400 | RsTunnelIp2VmNameConflict | %s. | |
| 400 | NetworkConflict | %s. | 虚拟服务器组和ECS配置信息不一致。 |
| 400 | InvalidParam.TagValue | %s. | |
| 400 | InvalidParam.TagKey | %s. | |
| 400 | SizeLimitExceeded.Tag | %s. | |
| 400 | MissingParam.TagKey | The param MissingParam.TagKey is missing. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。