创建全球集群 (V2)
本接口创建一个全球集群。全球集群由部署在不同区域的多个成员集群组成。全球集群中的成员集群共享相同的计算单元类型和计算单元大小。您可以创建全球集群以提供跨区域的灾难恢复和低延迟访问。
POST/v2/globalClusters/create
该 API 的 Base URL 格式如下:
https://api.cloud.zilliz.com
📘说明
控制面接口速率限制为单用户单接口每秒最多 20 个请求。
shell
export BASE_URL="https://api.cloud.zilliz.com"
参数
Authorizationstringheader必填项
认证令牌,应为具备适当权限的 API 密钥。
示例值:Bearer {{TOKEN}}
请求体application/json
globalClusterNamestring必填项
全球集群名称。
示例值:my-global-cluster
projectIdstring必填项
全球集群所属项目 ID。
示例值:proj-xxxxxxxxxxxxxxx
cuTypestring必填项
全球集群的计算单元类型(CU)。
示例值:Performance-optimized
cuSizeinteger必填项
全球集群的计算单元大小(CU)。
对于全球集群中的成员集群,该值取值范围为 1 到 1024,可能的值为1、2、4、8、12、16、20、24、28、32、...、64、72、80、88、...、256、272、288、...、1024。
关于 CU 大小的增量规则,请参阅 详细计划对比 中的 Deployment 部分。
示例值:4
primaryClusterobject必填项
全球集群的主集群参数。
clusterNamestring必填项
主集群名称。
示例值:my-primary-cluster
regionIdstring必填项
主集群部署的区域 ID。该区域必须是指定项目中适用的区域之一。
secondaryClustersarray必填项
全球集群的从集群参数。您可以指定一个或多个从集群。
[]secondaryClustersobject必填项
clusterNamestring必填项
从集群名称。
示例值:my-secondary-cluster-1
regionIdstring必填项
从集群部署的区域 ID。该区域必须是指定项目中适用的区域之一,并且必须与主集群部署的区域不同。
Examplebash
export TOKEN="YOUR_API_KEY"
curl --request POST \
--url "${BASE_URL}/v2/globalClusters/create" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"globalClusterName": "my-global-cluster",
"projectId": "proj-xxxxxxxxxxxxxxx",
"cuType": "Performance-optimized",
"cuSize": 4,
"primaryCluster": {
"clusterName": "my-primary-cluster",
"regionId": "ali-cn-hangzhou"
},
"secondaryClusters": [
{
"clusterName": "my-secondary-cluster-1",
"regionId": "ali-cn-beijing"
},
{
"clusterName": "my-secondary-cluster-2",
"regionId": "ali-cn-shanghai"
}
]
}'
响应200 OK - application/json
返回创建的全球集群的信息。
globalClusterIdstring
创建的全球集群 ID。
示例值:glo-xxxxxxxxxxxxxxx
usernamestring
访问全球集群的用户名。
示例值:admin
passwordstring
访问全球集群的密码。
示例值:Passw0rd!
jobIdstring
创建全球集群的任务 ID。您可以使用此 ID 查询创建任务的进度。
示例值:job-xxxxxxxxxxxxxxx
返回错误消息。
codeinteger
响应码。
messagestring
错误描述。
Successjson
{
"globalClusterId": "glo-xxxxxxxxxxxxxxx",
"username": "db_admin",
"password": "Passw0rd!",
"jobId": "job-xxxxxxxxxxxxxxx"
}