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.

URI

Request

Table 2 Request parameter description

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.

Table 3 parameters description

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

  • scale_in: cluster scale-in
  • scale_out: cluster scale-out

node_id

Yes

String

ID of the newly added or removed node. The parameter value is fixed to node_orderadd. The ID of a newly added or removed node includes node_orderadd, for example, node-orderadd-TBvSr.com.

node_group

No

String

Node group to be scaled out or in
  • If the value of node_group is core_node_default_group, the node group is a Core node group.
  • If the value of node_group is task_node_default_group, the node group is a Task node group.

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 5.

  • When the number of Task nodes is 0, this parameter is used to specify Task node specifications.
  • When the number of Task nodes is greater than 0, this parameter is unavailable.

instances

Yes

String/Integer

Number of nodes to be added or removed

  • The maximum number of nodes to be added is 500 minus the number of Core and Task nodes. For example, the current number of Core nodes is 3, the number of nodes to be added must be less than or equal to 497.

    A maximum of 500 Core and Task nodes are supported by default. If more than 500 Core and Task nodes are required, contact technical support engineers or call a background API to modify the database.

  • Nodes can be deleted for cluster scale-out when the number of Core nodes is greater than 3 or the number of Task nodes is greater than 0. For example, if there are 5 Core nodes and 5 Task nodes in a cluster, only 2 (5 minus 3) Core nodes are available for deletion and 5 or fewer than 5 Task nodes can be deleted.

skip_bootstrap_scripts

No

Boolean

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. MRS 1.7.2 or later supports this parameter.

scale_without_start

No

boolean

Whether to start components on the added nodes after cluster scale-out

  • true: Do not start components after scale-out.
  • false: Start components after scale-out.

This parameter is valid only in MRS 1.7.2 or later.

server_ids

No

List<String>

ID list of Task nodes to be deleted during task node scale-in.

  • This parameter does not take effect when scale_type is set to scale-out.
  • If scale_type is set to scale-in and cannot be left blank, the system deletes the specified Task nodes.
  • When scale_type is set to scale-in and server_ids is left blank, the system automatically deletes the Task nodes based on the system rules.

previous_values

No

Object

Extension parameter. You do not need to set this parameter. For details, see Table 4.

Table 4 Parameter description of previous_values

Parameter

Mandatory

Type

Description

plan_id

No

String

Reserve the parameter for extending APIs.

You do not need to set the parameter.

Table 5 task_node_info parameter description

Parameter

Mandatory

Type

Description

node_size

Yes

String

Instance specifications of a Task node, for example, c6.4xlarge.4linux.mrs

For details about instance specifications, see ECS Specifications Used by MRS.

data_volume_type

No

String

Data disk storage type of the Task node, supporting SATA, SAS, and SSD currently

  • SATA: Common I/O
  • SAS: High I/O
  • SSD: Ultra-high I/O

data_volume_count

No

Integer

Number of data disks of a Task node

Value range: 1 to 10

data_volume_size

No

Integer

Data disk storage space of a Task node

Value range: 100 GB to 32,000 GB

Response

Response parameters

Table 6 describes the response parameters.
Table 6 Response parameter description

Parameter

Type

Description

result

String

Operation result

  • succeeded: The operation is successful.
  • Table 8 describes the error codes returned upon operation failures.

Example

Status Code