Resizing a Cluster
Function
This API is used to manually scale out or scale in Core or Task nodes in a cluster that has been created. After an MRS cluster is created, the number of Master nodes cannot be adjusted. That is, Master nodes cannot be scaled in or out. This API is incompatible with Sahara.
Only clusters in the Running state can be scaled out or in.
The APIs described in this section support only streaming, analysis, and hybrid clusters.
URI
- Format
- Parameter description
Table 1 URI parameters Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.
cluster_id
Yes
String
Cluster ID For details about how to obtain the cluster ID, see Obtaining the MRS Cluster Information.
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
service_id |
No |
String |
Service ID. This parameter is reserved for extension. You do not need to set this parameter. |
plan_id |
No |
String |
Plan ID. This parameter is reserved for extension. You do not need to set this parameter. |
parameters |
Yes |
Object |
Core parameters. For details, see Table 3. |
previous_values |
No |
Map<String,String> |
This parameter is an extended API and needs to be reserved. You do not need to set this parameter. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
order_id |
No |
String |
Order ID obtained by the system during scale-out or scale-in. You do not need to set the parameter. |
scale_type |
Yes |
String |
|
node_id |
Yes |
String |
ID of the newly added or removed node. The parameter value is fixed to node_orderadd. |
node_group |
No |
String |
Node group to be scaled out or in
If it is left blank, the default value core_node_default_group is used. |
task_node_info |
No |
Object |
Task node specifications. For more parameter description, see Table 4.
|
instances |
Yes |
Integer |
Number of nodes to be added or removed
|
skip_bootstrap_scripts |
No |
String |
This parameter is valid only when a bootstrap action is configured during cluster creation and takes effect during scale-out. It indicates whether the bootstrap action specified during cluster creation is performed on nodes added during scale-out. The default value is false, indicating that the bootstrap action is performed. |
scale_without_start |
No |
Boolean |
Whether to start components on the added nodes after cluster scale-out
|
server_ids |
No |
Array of strings |
ID list of Task nodes to be deleted during task node scale-in.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
node_size |
Yes |
String |
Instance specifications of a Task node, Example: |
data_volume_type |
Yes |
String |
Data disk storage type of the Task node, supporting SATA, SAS, and SSD currently.
|
data_volume_count |
Yes |
Integer |
Number of data disks of a Task node Value range: 0 to 10 |
data_volume_size |
Yes |
Integer |
Data disk storage space of a Task node Value range: 100 GB to 32,000 GB. When assigning a value to this parameter, you only need to pass a number, without the unit. |
Response Parameters
Response parameters
Parameter |
Type |
Description |
---|---|---|
result |
String |
Operation result
|
Example
- Example request
PUT /v1.1/{project_id}/cluster_infos/{cluster_id} { "service_id": "", "plan_id": "", "parameters": { "order_id": "", "scale_type": "scale_out", "node_id": "node_orderadd", "node_group": "core_node_default_group", "instances": "1", "skip_bootstrap_scripts":false, "scale_without_start":false }, "previous_values": { } }
Example of adding task nodes when the number of existing task nodes is greater than zero
PUT /v1.1/{project_id}/cluster_infos/{cluster_id} { "service_id": "", "plan_id": "", "parameters": { "order_id": "", "scale_type": "scale_out", "node_id": "node_orderadd", "node_group": "task_node_default_group", "instances": "1", "skip_bootstrap_scripts":false, "scale_without_start":false }, "previous_values": { } }
Example of adding task nodes when the number of existing task nodes is zero
PUT /v1.1/{project_id}/cluster_infos/{cluster_id} { "service_id": "", "plan_id": "", "parameters": { "order_id": "", "scale_type": "scale_out", "node_id": "node_orderadd", "node_group": "task_node_default_group", "task_node_info": { "node_size": "", "data_volume_type":"SATA", "data_volume_count":2, "data_volume_size":600 }, "instances": "1", "scale_without_start":false }, "previous_values": { } }
Example of adding core nodes
PUT /v1.1/{project_id}/cluster_infos/{cluster_id} { "service_id": "", "plan_id": "", "parameters": { "order_id": "", "scale_type": "scale_in", "node_id": "node_orderadd", "node_group": "core_node_default_group", "instances": "1" }, "previous_values": { } }
Example of removing task nodes
PUT /v1.1/{project_id}/cluster_infos/{cluster_id} { "service_id": "", "plan_id": "", "parameters": { "order_id": "", "scale_type": "scale_in", "node_id": "node_orderadd", "node_group": "task_node_default_group", "instances": "1" }, "previous_values": { } }
Example of removing specified task nodesPUT /v1.1/{project_id}/cluster_infos/{cluster_id} { "service_id": "", "plan_id": "", "parameters": { "order_id": "", "scale_type": "scale_in", "node_id": "node_orderadd", "node_group": "task_node_default_group", "instances": "2", "server_ids": ["c9573435-7814-4b2c-9131-ad78b814414c", "a4951009-6a0f-4e7b-9c81-9d4bd1f8c537"] }, "previous_values": { } }
- Example response
{ "result": "succeeded" }
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot