Scaling Out a Cluster
Function
This API is used to scale out a cluster or add idle nodes. By default, scale-out is performed.
You can configure create_node_only to determine whether the current operation is to scale out a cluster or add idle nodes.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/{project_id}/clusters/{cluster_id}/resize
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| cluster_id | Yes | String | Definition Cluster ID. For details about how to obtain the value, see Obtaining the Cluster ID. Constraints N/A Range N/A Default Value N/A |
| project_id | Yes | String | Definition Project ID. To obtain the value, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| scale_out | Yes | ScaleOut object | Definition Request body for adding an idle node or scaling out a cluster. Constraints N/A Range N/A Default Value N/A |
| logical_cluster_name | No | String | Definition: Name of the logical cluster, which is required when the cluster is scaled out to a logical cluster. Constraints: None Range: None Default Value: None |
| create_node_only | No | Boolean | Definition Whether only idle nodes are added. Constraints N/A Range true: Only nodes are added. If scale-out is required, perform it separately. false: Nodes are added and the cluster is scaled out. Default Value false |
| waiting_for_killing | No | Integer | Definition Time before blocked job termination. Constraints This parameter is available only for GuestAgent 8.2.1 or later. Range 30 to 1200 Default Value 0 (not limited) |
| auto_redistribute | No | Boolean | Definition: Whether to automatically start redistribution after scale-out. The default value is Yes. If this parameter is set to false, redistribution is not performed after scale-out. In this case, the cluster task information is in the to-be-redistributed state and other operations cannot be performed. Constraints: None Range:
Default Value: true |
| mode | No | String | Definition Scale-out mode, which can be online or offline. During online scale-out, data can be added, deleted, modified, and queried, and some DDL syntaxes are supported. Errors will be reported for unsupported syntaxes. Online scale-out has less impact on services. In offline mode, services are interrupted for a short period of time and the database is unavailable. Constraints N/A Range Default Value read-only |
| redis_conf | No | RedisConfReq object | Definition Redistribution configuration. The offline mode is used by default. Constraints N/A Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| count | Yes | Integer | Definition Number of nodes to be added. Range Greater than or equal to 3 |
| subnet_id | No | String | Definition Subnet ID. Range The value is a valid subnet ID in the same VPC. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| redis_mode | Yes | String | Definition Redistribution mode. The impact on services varies depending on the mode. You are advised to contact O&M personnel for evaluation before changing the mode. Constraints The value must be a valid DWS cluster ID. Range online or "onLine": online mode offline or "offLine": offline mode Default Value offLine |
| parallel_jobs | Yes | Integer | Definition Number of concurrent jobs. The default value is 4. Constraints N/A Range 1 to 200 Default Value 4 |
Response Parameters
Status code: 200
Request for scaling out a cluster is submitted.
None
Example Requests
-
POST https://{Endpoint}/v1.0/89cd04f168b84af6be287f71730fdb4b/clusters/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba90/resize { "scale_out" : { "count" : 3, "subnet_id" : null }, "logical_cluster_name" : null, "create_node_only" : false, "waiting_for_killing" : 30, "auto_redistribute" : false, "mode" : "read-only", "redis_conf" : { "redis_mode" : "online", "parallel_jobs" : 5 } } -
Add three idle nodes to a cluster for the scale-out operation in example 3.
POST https://{Endpoint}/v1.0/89cd04f168b84af6be287f71730fdb4b/clusters/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba90/resize { "scale_out" : { "count" : 3 }, "create_node_only" : true }
Example Responses
Status code: 200
{ } Status Codes
| Status Code | Description |
|---|---|
| 200 | Request for scaling out a cluster is submitted. |
| 400 | Request error. |
| 401 | Authentication failed. |
| 403 | You do not have required permissions. |
| 404 | No resources found. |
| 500 | Internal server error. |
| 503 | Service unavailable. |