UpdateInstance
Upgrades the configuration of an Elasticsearch cluster by increasing the number of nodes, roles, specifications, and disk configurations.
Operation description
When you call this operation, take note of the following items:
You cannot change the configuration when the instance status is activating, invalid, or frozen (inactive).
If the cluster load is high, indexes have no replicas, and a large number of write or query operations are performed during the procedure to upgrade or decrease the quota, intermittent access timeouts may occur. Configure a retry mechanism on the client side before you change the cluster configuration to minimize the impact on your business.
You can change the configuration of only one type of node at a time. The node types include data nodes, dedicated master nodes, warm data nodes, client nodes, Kibana nodes, and elastic nodes.
- To ensure the health and stability of your cluster, Alibaba Cloud Elasticsearch has stopped selling 1-core 2 GB instances, 2-core 2 GB dedicated master nodes, and version 7.4 instances since May 2021. If you confirm that your purchased specifications are no longer available, you must perform the following operations:
For 1-core 2 GB and 2-core 2 GB specifications, upgrade them to stable specifications available on the buy page. For more information about the available specifications, see Parameters on the buy page (Commercial Edition) or Parameters on the buy page (Advanced Edition).
For version 7.4, purchase a version 7.10 instance and then migrate data. For more information about data migration, see Select a migration solution.
For more information, see Upgrade a cluster and Downgrade a cluster.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
elasticsearch:UpdateInstance |
update |
*Instance
|
None | None |
Request syntax
PUT /openapi/instances/{InstanceId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID. |
es-cn-n6w1ptcb30009**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| clientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. |
5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
| orderActionType |
string |
No |
The configuration change type. Valid values:
|
upgrade |
| body |
object |
No |
The request body parameters. |
{ "nodeSpec": { "spec": "elasticsearch.r5.xlarge" } } |
| clientNodeConfiguration | ClientNodeConfiguration |
No |
The client node configuration. |
|
| elasticDataNodeConfiguration | ElasticDataNodeConfiguration |
No |
The elastic node configuration. |
|
| indexNodeConfiguration | IndexNodeConfiguration |
No |
The index node configuration. This configuration is supported only by AI engine instances. |
|
| instanceCategory |
string |
No |
The edition. Valid values:
Note
To create an Advanced Edition instance with OpenStore enabled, you must also enable Indexing Service. |
advanced |
| kibanaConfiguration | KibanaNodeConfiguration |
No |
The Kibana node configuration. |
|
| masterConfiguration | MasterNodeConfiguration |
No |
The dedicated master node configuration. |
|
| nodeAmount |
integer |
No |
The number of nodes. |
3 |
| nodeSpec | NodeSpec |
No |
The data node configuration. |
|
| searchNodeConfiguration | SearchNodeConfiguration |
No |
The search node configuration. This configuration is supported only by AI engine instances. |
|
| updateType |
string |
No |
The update type. Valid values:
|
blue_green |
| warmNodeConfiguration | WarmNodeConfiguration |
No |
The warm data node configuration. |
|
| force |
boolean |
No |
Specifies whether to forcibly restart the cluster. Valid values:
|
false |
For more information about the node specifications supported by Elasticsearch, see Specifications.
Examples of request body parameters: Upgrade
When you upgrade a cluster, you cannot reduce the storage capacity, downgrade the storage type, reduce the number of nodes, or reduce the number of CPU cores or memory size of the specifications.
-
Upgrade storage capacity You can only upgrade the storage capacity of data nodes, warm nodes, and elastic nodes.
Upgrade the storage capacity of a warm data node to 1,000 GiB.
{
"warmNodeConfiguration": {
"disk": 1000
}
}
-
Upgrade storage type You can only upgrade the storage type of data nodes, elastic nodes, and dedicated master nodes.
Upgrades the storage type of dedicated master nodes to ESSD.
{
"masterConfiguration": {
"diskType": "cloud_essd"
}
}
When the storage type of dedicated master nodes is ESSD, upgrades the storage performance level (PL) of the nodes to PL3. If you specify performanceLevel, diskType is automatically set to cloud_essd. If you specify cloud_essd for diskType, performanceLevel defaults to PL1.
{
"masterConfiguration": {
"performanceLevel": "PL3"
}
}
-
Increase the number of nodes Currently, you can only increase the number of data nodes, warm nodes, elastic nodes, and client nodes. The method to increase the number of data nodes is different from that of other nodes. For more information, see the following examples.
Increase the number of data nodes to 12.
{
"nodeAmount": 12
}
Increase the number of other types of nodes (using warm data nodes as an example) to 12.
{
"warmNodeConfiguration": {
"amount": 12
}
}
Upgrade node specifications Upgrade the specifications of data nodes to 4 vCPUs and 32 GB of memory.
{
"nodeSpec": {
"spec": "elasticsearch.r5.xlarge"
}
}
-
Upgrade multiple configurations of the same node type at the same time To upgrade multiple configurations of the same node type at the same time, you must include all the upgrade configurations in the request body.
Increase the number of client nodes to 8 and upgrade their specifications to 4 vCPUs and 8 GB of memory.
{
"clientNodeConfiguration": {
"amount": 8,
"spec": "elasticsearch.sn1ne.xlarge"
}
}
Increase the number of data nodes to 12 and upgrade their storage type to ESSD.
{
"nodeAmount": 12,
"nodeSpec": {
"diskType": "cloud_essd"
}
}
-
Enable nodes You can refer to the createInstance operation for the complete node resource settings.
Enable client nodes and configure their settings.
{
"clientNodeConfiguration": {
"amount": 5,
"disk": 20,
"spec": "elasticsearch.sn1ne.xlarge"
}
}
Enable elastic data nodes and configure their settings. This configuration applies only to the China site.
{
"elasticNodeConfiguration": {
"disk": 200,
"amount": 5,
"diskType": "cloud_essd",
"spec": "elasticsearch.sn1ne.xlarge"
}
}
Enable warm data nodes and configure their settings.
{
"warmNodeConfiguration": {
"disk": 1000,
"amount": 3,
"spec": "elasticsearch.sn1ne.xlarge"
}
}
-
Upgrade an instance to enable OpenStore (this configuration applies only to the China site) Instances with warm data nodes enabled and instances whose data nodes use ESSD do not support upgrading to enable OpenStore. If the instance is of the Standard Edition, after you upgrade the instance to enable OpenStore, the instance edition is also upgraded to the Advanced Edition with Indexing Service enabled.
Enable OpenStore for warm data nodes.
{
"warmNodeConfiguration": {
"amount": 5,
"spec": "openstore.i2g.4xlarge"
}
}
Change the node specifications of data nodes to OpenStore.
{
"nodeAmount": 6,
"nodeSpec": {
"spec": "openstore.i2g.4xlarge",
"diskType": "cloud_ssd",
"disk": 100
}
}
- Specify the change mode
By default, the change mode is intelligent change. You can specify it as blue-green change (blue_green) or in-place change (normal).
{
"nodeSpec": {
"spec": "elasticsearch.r5.xlarge"
},
"updateType": "blue_green" ## Set to normal for in-place change.
}
Enable forced change.
{
"nodeSpec": {
"spec": "elasticsearch.r5.xlarge"
},
"force": true
}
Use the dryRun parameter to perform a pre-check for the upgrade Add the dryRun field to the request body.
{
"nodeSpec": {
"spec": "elasticsearch.r5.xlarge"
},
"dryRun": true
}
Downgrade
When you downgrade an instance, you cannot increase the storage capacity, upgrade the storage type, increase the number of nodes, or increase the number of vCPUs or memory size of the specifications.
The UpdateInstance operation cannot decrease the number of nodes. To decrease the number of nodes, call the ShrinkNode operation.
You cannot decrease the storage capacity of nodes or disable enabled nodes.
You cannot select forced change or specify a change type. Intelligent change is used by default.
When you downgrade an instance, you must set the orderActionType parameter to Downgrade.
You can downgrade multiple resource configurations at the same time and perform a dryRun pre-check.
Downgrade the storage type When you downgrade an instance, you cannot change the storage type of warm data nodes (without changing the instance type), client nodes, or Kibana nodes.
Change the storage type of dedicated master nodes to standard SSD.
{
"masterConfiguration": {
"diskType": "cloud_ssd"
}
}
Downgrade specifications Downgrade the specifications of data nodes to 4 vCPUs and 32 GB of memory.
{
"nodeSpec": {
"spec": "elasticsearch.r5.xlarge"
}
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The error code. Returned only when an error occurs. |
InstanceNotFound |
| Message |
string |
The error message. Returned only when an error occurs. |
The specified cluster does not exist. Check the cluster status and try again. |
| RequestId |
string |
The request ID. |
5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1**** |
| Result |
object |
The returned result. |
|
| createdAt |
string |
The time when the instance was created. The time is in UTC and formatted in accordance with the ISO 8601 standard. |
2018-07-13T03:58:07.253Z |
| description |
string |
The instance name. |
test |
| domain |
string |
The domain name for internal-facing access to the instance over a private network. |
es-cn-abc.elasticsearch.aliyuncs.com |
| esVersion |
string |
The version of the instance. |
5.5.3_with_X-Pack |
| indexNodeConfiguration |
object |
The index node configuration. This configuration is supported only by AI engine instances. |
|
| amount |
integer |
The number of nodes. |
3 |
| disk |
integer |
The disk size. |
500 |
| diskType |
string |
The cloud disk type, such as cloud_essd. |
cloud_essd |
| performanceLevel |
string |
The cloud disk performance level (PL), such as PL0. |
PL0 |
| spec |
string |
The node specifications. |
elasticsearch.turbo1.ci.xlarge |
| instanceId |
string |
The instance ID. |
es-cn-abc |
| kibanaConfiguration |
object |
The Kibana node configuration. |
|
| amount |
integer |
The number of nodes. |
1 |
| disk |
integer |
The storage capacity of the node. |
20 |
| diskType |
string |
The storage type of the node. You can ignore this parameter. |
cloud_ssd |
| spec |
string |
The node specifications. |
elasticsearch.n4.small |
| masterConfiguration |
object |
The dedicated master node configuration. |
|
| amount |
integer |
The number of nodes. |
3 |
| disk |
integer |
The storage capacity of the node. Unit: GB. |
20 |
| diskType |
string |
The storage type of the node. Only cloud_ssd (standard SSD) is supported. |
cloud_ssd |
| spec |
string |
The node specifications. |
elasticsearch.sn2ne.large |
| nodeAmount |
integer |
The number of data nodes. |
2 |
| nodeSpec |
object |
The data node configuration. |
|
| disk |
integer |
The storage capacity of the node. Unit: GB. |
40 |
| diskType |
string |
The storage type of the node. Valid values:
|
cloud_ssd |
| spec |
string |
The node specifications. |
elasticsearch.sn2ne.xlarge |
| paymentType |
string |
The billing method of the instance. Valid values:
|
postpaid |
| searchNodeConfiguration |
object |
The search node configuration. This configuration is supported only by AI engine instances. |
|
| amount |
integer |
The number of nodes. |
3 |
| disk |
integer |
The disk size. |
500 |
| diskType |
string |
The cloud disk type, such as cloud_essd. |
cloud_essd |
| performanceLevel |
string |
The cloud disk performance level (PL), such as PL0. |
PL0 |
| spec |
string |
The node specifications. |
elasticsearch.turbo1.ci.xlarge |
| status |
string |
The instance status. Valid values:
|
active |
Examples
Success response
JSON format
{
"Code": "InstanceNotFound",
"Message": "The specified cluster does not exist. Check the cluster status and try again.",
"RequestId": "5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****",
"Result": {
"createdAt": "2018-07-13T03:58:07.253Z",
"description": "test",
"domain": "es-cn-abc.elasticsearch.aliyuncs.com",
"esVersion": "5.5.3_with_X-Pack",
"indexNodeConfiguration": {
"amount": 3,
"disk": 500,
"diskType": "cloud_essd",
"performanceLevel": "PL0",
"spec": "elasticsearch.turbo1.ci.xlarge"
},
"instanceId": "es-cn-abc",
"kibanaConfiguration": {
"amount": 1,
"disk": 20,
"diskType": "cloud_ssd",
"spec": "elasticsearch.n4.small"
},
"masterConfiguration": {
"amount": 3,
"disk": 20,
"diskType": "cloud_ssd",
"spec": "elasticsearch.sn2ne.large"
},
"nodeAmount": 2,
"nodeSpec": {
"disk": 40,
"diskType": "cloud_ssd",
"spec": "elasticsearch.sn2ne.xlarge"
},
"paymentType": "postpaid",
"searchNodeConfiguration": {
"amount": 3,
"disk": 500,
"diskType": "cloud_essd",
"performanceLevel": "PL0",
"spec": "elasticsearch.turbo1.ci.xlarge"
},
"status": "active"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.