集群公测版
集群是一组用于运行您的向量数据库工作负载的计算资源。Zilliz Cloud 提供两种类型的集群:Serving 集群和 On-demand 集群。其中,Serving 集群始终保持运行,适用于需要始终在线、低延迟访问的生产工作负载;On-demand 集群仅在请求到达时启动,并在空闲时缩容至 0 CU。
本主题说明如何创建 On-demand 集群。
此功能仅适用于企业版项目。
目前,您只能在阿里云华北2(北京)和阿里云华东2(上海)创建 On-demand 集群。如需其他地域,请联系我们。
使用限制
-
如需管理 On-demand 集群,您需要具备项目管理员权限。
-
每个项目中最多只能创建 20 个 On-demand 集群。
-
每 8 个 Query CU 的 On-demand 集群最多可查询 3 TB 原始数据。超过此限制的查询将报错。
创建 On-demand 集群
-
通过 RESTful API
curl --request POST \--url "${BASE_URL}/v2/clusters/createOnDemandCluster" \--header "Authorization: Bearer ${TOKEN}" \--header "Request-Timeout: 5" \--header "Content-Type: application/json" \-d '{"projectId": "proj-xxxxxxxxxxxxxxxxxxx","regionId": "ali-cn-hangzhou","clusterName": "my-on-demand","cuSize": 8,"autoSuspend": 60,"description": "A cluster for vector search workloads."}'下表为参数说明。
参数
说明
projectId待创建的 On-demand 集群所属项目的 ID。
regionId集群部署地域。必须与项目地域一致。
cuSize要分配的 Query CU 数量。集群会根据工作负载在 0 和该值之间自动伸缩:当收到请求时,扩容到指定的 Query CU 大小;空闲时缩容至 0。
最小值为 8 CU,最大值为 256 CU,并且必须以 8 为梯度递增(例如 8、16、24)。超过 8 CU 的集群需要添加支付方式。
将此值设置为 8 可支持对最多 3 TB 数据的查询;若要提升可查询的数据量,请增加 Query CU 大小。该值在创建后固定,无法更改。
clusterName要创建的集群名称。
autoSuspend集群自动挂起前的空闲超时时间。如果在此期间未收到任何请求,集群将自动挂起,以停止产生计算费用。
字段类型:整数
单位:秒
最小值:60
默认值:60
description(可选)要创建的集群描述。最多 255 字符。
以下为输出示例。
{"code": 0,"data": {"clusterId": "inxx-xxxxxxxxxxxxxxx","prompt": "Successfully submitted. The on-demand cluster is being created. Use the Describe On-Demand Cluster API to check its creation progress and status. Once the cluster status is RUNNING, use your API key to access the on-demand cluster."}} -
通过 Web 控制台
以下 Demo 展示了如何在 Web 控制台中创建 On-demand 集群。
1点击按需计算 > 集群。
2点击 + 集群。
3配置集群。
下表为参数说明。
参数
说明
集群名称
要创建的集群名称。
集群描述(可选)
要创建的集群描述。最多 255 字符。
Query CU
要分配的 Query CU 数量。集群会根据工作负载在 0 和该值之间自动伸缩:当收到请求时,扩容到指定的 Query CU 大小;空闲时缩容至 0。
最小值为 8 CU,最大值为 256 CU,并且必须以 8 为梯度递增(例如 8、16、24)。超过 8 CU 的集群需要添加支付方式。
将此值设置为 8 可支持对最多 3 TB 数据的查询;若要提升可查询的数据量,请增加 Query CU 大小。该值在创建后固定,无法更改。
自动挂起
集群自动挂起前的空闲时间(以秒为单位)。默认值为 1 分钟。如果在此期间未收到任何请求,集群将自动挂起,以停止产生计算费用。
4点击创建。
查看全部 On-demand 集群
-
通过 RESTful API
您可以按如下方式列出所有 On-demand 集群:
curl --request GET \--url "${BASE_URL}/v2/clusters/onDemandClusters?projectId=proj-xxxxxxxxxxxxxxx®ionId=ali-cn-hangzhou" \--header "Authorization: Bearer ${TOKEN}" \--header "Accept: application/json"以下是输出示例。
{"code": 0,"data": {"count": 2,"onDemandClusters": [{"projectId": "proj-xxxxxxxxxxxxxxx","clusterId": "inxx-xxxxxxxxxxxxxxx","clusterName": "Cluster-01","regionId": "ali-cn-hangzhou","cuSize": 8,"status": "RUNNING","endpoint": "https://proj-xxxxxxxxxxxxxxx.ali-cn-hangzhou.zillizcloud.com","privateLink": "","createdBy": "john.doe@zilliz.com.cn","createTime": "2024-04-21T10:15:15Z","autoSuspend": 60,"description": "An on-demand cluster for vector search workloads."},{"projectId": "proj-xxxxxxxxxxxxxxx","clusterId": "inxx-xxxxxxxxxxxxxxx","clusterName": "Cluster-02","regionId": "ali-cn-hangzhou","status": "RUNNING","cuSize": 8,"endpoint": "https://proj-xxxxxxxxxxxxxxx.ali-cn-hangzhou.zillizcloud.com","privateLink": "","createdBy": "john.doe@zilliz.com.cn","createTime": "2024-04-21T10:15:16Z","autoSuspend": 60,"description": "An on-demand cluster for vector search workloads."}]}} -
通过 Web 控制台
1前往目标项目,点击按需计算 > 集群。
2您可以查看全部现有 On-demand 集群。
查看 On-demand 集群详情
-
通过 RESTful API
您可以按如下方式查看 On-demand 集群 详情:
curl --request GET \--url "https://${BASE_URL}/v2/on-demand-compute?projectId=proj-09ee1f4b1151d5dd1edbc5®ionId=ali-cn-hangzhou" \--header "Authorization: Bearer ${API_KEY}" \--header "Accept: application/json"以下是输出示例。
{"code": 0,"data": {"projectId": "proj-09ee1f4b1151d5dd1edbc5","regionId": "ali-cn-hangzhou","status": "enabled"}} -
通过 Web 控制台
1前往目标项目,点击按需计算 > 集群。
2点击目标 On-demand 集群
3查看详情。
重命名 On-demand 集群
-
通过 RESTful API
以下示例展示如何修改集群名称。详情请参考更新按需集群信息。
curl --request PATCH \--url "${BASE_URL}/v2/clusters/onDemandClusters/${CLUSTER_ID}" \--header "Authorization: Bearer ${TOKEN}" \--header "OrgId: org-xxxxxxxxxxxxxxxxxxx" \--header "Content-Type: application/json" \-d '{"clusterName": "New Cluster Name"}'以下为输出示例。
{"code": 0,"data": {"clusterId": "inxx-xxxxxxxxxxxxxxx","prompt": "successfully submitted. Cluster is being upgraded, which is expected to take several minutes. You can access data about the creation progress and status of your cluster by DescribeCluster API. Once the cluster status is RUNNING, you may access your vector database using the SDK."}} -
通过 Web 控制台
1前往目标 On-demand 集群。
2点击操作,选择重命名。
3输入集群新名称,点击保存。

修改 On-demand 集群描述
-
通过 RESTful API
以下示例展示如何修改集群名称。详情请参考更新按需集群信息。
curl --request PATCH \--url "${BASE_URL}/v2/clusters/onDemandClusters/${CLUSTER_ID}" \--header "Authorization: Bearer ${TOKEN}" \--header "OrgId: org-xxxxxxxxxxxxxxxxxxx" \--header "Content-Type: application/json" \-d '{"description": ""}'以下为输出示例。
{"code": 0,"data": {"clusterId": "inxx-xxxxxxxxxxxxxxx","prompt": "successfully submitted. Cluster is being upgraded, which is expected to take several minutes. You can access data about the creation progress and status of your cluster by DescribeCluster API. Once the cluster status is RUNNING, you may access your vector database using the SDK."}} -
通过 Web 控制台
1前往目标按需计算集群。
2鼠标悬浮至集群描述,点击编辑按钮。
3输入集群新描述,点击保存。

删除 On-demand 集群
删除集群后,系统会立即将其移除,且无法恢复。此操作不可撤销。
-
通过 RESTful API
您可以按如下方式删除 On-demand 集群:
curl --request DELETE \--url "${BASE_URL}/v2/clusters/onDemandClusters/inxx-xxxxxxxxxxxxxxx" \--header "Authorization: Bearer ${TOKEN}" \--header "Accept: application/json"以下是输出示例。
{"code": 0,"data": {"clusterId": "inxx-xxxxxxxxxxxxxxx","status": "DELETING"}} -
通过 Web 控制台
1前往目标项目,点击按需计算 > 集群。
2点击目标 On-demand 集群。
3点击操作 > 删除。
4输入集群名称。
5点击删除。