RestartInstance
Restarts an Elasticsearch cluster.
Operation description
After a restart, the instance enters the activating state. After the restart succeeds, the instance status changes to active. Alibaba Cloud Elasticsearch supports single-node restarts. Node restarts are classified into normal restarts and blue-green restarts.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
elasticsearch:RestartInstance |
none |
*Instance
|
None | None |
Request syntax
POST /openapi/instances/{InstanceId}/actions/restart HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID. |
es-cn-nif1q8auz0003**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| force |
boolean |
No |
Specifies whether to ignore the cluster state and force a restart. Valid values:
|
false |
| clientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can generate the value of this parameter on the client side. Ensure that the value is unique across different requests and contains a maximum of 64 ASCII characters. |
5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
| body |
string |
No |
The restart parameters. |
1. restart nodes example: { "restartType": "nodeIp", "nodes": [ "es-cn-xx-data-j-0" ], "blueGreenDep": false } 2. restart instance example: { "restartType": "instance", "blueGreenDep": false } |
Request body
You must also specify the following parameters in the request body to configure the restart parameters.
| Name | Type | Required | Example | Description |
| restartType | String | No | instance | The restart type. Valid values: instance: restarts the instance. This is the default value. nodeIp: restarts a node. You must specify the IP address of the node. nodeEcsId: restarts a node. You must specify the ID of the ECS instance in the cluster. |
| nodes | List | No | ["127.0.."] | The IP addresses or names of the nodes to be restarted. This parameter is required when you restart nodes. |
| blueGreenDep | Boolean | No | false | Specifies whether to enable blue-green deployment when you restart a node. Default value: false. |
| batchCount | Double | No | 25.0 | The concurrency level for a forced instance restart. |
| batchUnit | String | No | percent | The unit of batchCount. Default value: percent. |
| replaceNodes | Boolean | No | false | Specifies whether to replace the node with a new ECS instance. This parameter takes effect only when you restart a node in a cloud-native architecture. |
- If you do not specify restartType or specify an empty string, the default value instance is used. When restartType is set to instance, the blueGreenDep parameter is ignored by default, and the following conditions must be met:
If force is set to true, batchCount must be greater than 0 and less than or equal to 100. Otherwise, the RestartBatchValueError error is reported.
If force is set to false, the default value of batchCount is 0. If you set it to another value, the NormalRestartNotSupportBatch error is reported.
- When restartType is set to nodeIp, the batchCount parameter is ignored by default, and the following conditions must be met:
nodes cannot be empty. Otherwise, a parameter error is reported.
If blueGreenDep is set to true, blue-green deployment is enabled when the node is restarted. If it is set to false, blue-green deployment is not enabled, and a normal restart is performed.
Example:
{
"restartType":"nodeIp",
"nodes": ["172.16.xx.xx"],
"blueGreenDep":true
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
F99407AB-2FA9-489E-A259-40CF6DC**** |
| Result |
object |
The returned result. |
|
| nodeAmount |
integer |
The number of data nodes in the instance. |
2 |
| publicDomain |
string |
The public network access address. |
es-cn-n6w1o1x0w001c****.public.elasticsearch.aliyuncs.com |
| createdAt |
string |
The time when the instance was created. The time is displayed in UTC and formatted in accordance with ISO 8601. |
2020-07-06T10:18:48.662Z |
| status |
string |
The state of the instance. Valid values:
|
active |
| kibanaPort |
integer |
The public port of Kibana. |
5601 |
| publicPort |
integer |
The public port. |
9200 |
| paymentType |
string |
The billing method of the instance. Valid values: prepaid (subscription) and postpaid (pay-as-you-go). |
postpaid |
| domain |
string |
The internal endpoint of the instance. |
es-cn-nif1q8auz0003****.elasticsearch.aliyuncs.com |
| description |
string |
The instance name. |
es-cn-abc |
| esVersion |
string |
The Elasticsearch version of the instance. |
6.7.0_with_X-Pack |
| kibanaDomain |
string |
The Kibana public network access address. |
es-cn-nif1q8auz0003****.kibana.elasticsearch.aliyuncs.com |
| updatedAt |
string |
The time when the instance was last updated. The time is displayed in UTC and formatted in accordance with ISO 8601. |
2018-07-18T10:10:04.484Z |
| instanceId |
string |
The instance ID. |
es-cn-n6w1o1x0w001c**** |
| dictList |
array<object> |
The IK dictionary configurations. |
|
|
object |
|||
| fileSize |
integer |
The size of the dictionary file. Unit: bytes. |
2782602 |
| type |
string |
The dictionary type. Valid values:
|
MAIN |
| name |
string |
The name of the dictionary file. |
SYSTEM_MAIN.dic |
| sourceType |
string |
The source type. Valid values:
|
ORIGIN |
| synonymsDicts |
array<object> |
The synonym dictionary configurations. |
|
|
object |
|||
| fileSize |
integer |
The size of the dictionary file. Unit: bytes. |
2782602 |
| type |
string |
The dictionary type. Valid values:
|
STOP |
| name |
string |
The name of the dictionary file. |
SYSTEM_MAIN.dic |
| sourceType |
string |
The source type. Valid values:
|
ORIGIN |
| kibanaConfiguration |
object |
The Kibana node configurations. |
|
| spec |
string |
The node specifications. |
elasticsearch.n4.small |
| amount |
integer |
The number of nodes. |
1 |
| disk |
integer |
The storage space of the node. Unit: GB. |
20 |
| diskType |
string |
The storage type of the node. |
cloud_ssd |
| masterConfiguration |
object |
The dedicated master node configurations. |
|
| spec |
string |
The node specifications. |
elasticsearch.sn2ne.large |
| amount |
integer |
The number of nodes. |
3 |
| disk |
integer |
The storage space of the node. Unit: GB. |
20 |
| diskType |
string |
The storage type of the node. Only cloud_ssd (standard SSD) is supported. |
cloud_ssd |
| networkConfig |
object |
The network configurations. |
|
| vpcId |
string |
The VPC ID. |
vpc-bp16k1dvzxtmagcva**** |
| vsArea |
string |
The zone where the instance resides. |
cn-hangzhou-i |
| type |
string |
The network type. Only VPC is supported. |
vpc |
| vswitchId |
string |
The vSwitch ID. |
vsw-bp1k4ec6s7sjdbudw**** |
| nodeSpec |
object |
The data node configurations. |
|
| spec |
string |
The node specifications. |
elasticsearch.n4.small |
| disk |
integer |
The storage space of the node. Unit: GB. |
50 |
| diskType |
string |
The storage type of the node. |
cloud_ssd |
The following response example only guarantees the inclusion of the parameters listed in the response data. Other parameters are for reference only and must not be strictly relied upon in your code.
Examples
Success response
JSON format
{
"RequestId": "F99407AB-2FA9-489E-A259-40CF6DC****",
"Result": {
"nodeAmount": 2,
"publicDomain": "es-cn-n6w1o1x0w001c****.public.elasticsearch.aliyuncs.com",
"createdAt": "2020-07-06T10:18:48.662Z",
"status": "active",
"kibanaPort": 5601,
"publicPort": 9200,
"paymentType": "postpaid",
"domain": "es-cn-nif1q8auz0003****.elasticsearch.aliyuncs.com",
"description": "es-cn-abc",
"esVersion": "6.7.0_with_X-Pack",
"kibanaDomain": "es-cn-nif1q8auz0003****.kibana.elasticsearch.aliyuncs.com",
"updatedAt": "2018-07-18T10:10:04.484Z",
"instanceId": "es-cn-n6w1o1x0w001c****",
"dictList": [
{
"fileSize": 2782602,
"type": "MAIN",
"name": "SYSTEM_MAIN.dic",
"sourceType": "ORIGIN"
}
],
"synonymsDicts": [
{
"fileSize": 2782602,
"type": "STOP",
"name": "SYSTEM_MAIN.dic",
"sourceType": "ORIGIN"
}
],
"kibanaConfiguration": {
"spec": "elasticsearch.n4.small",
"amount": 1,
"disk": 20,
"diskType": "cloud_ssd"
},
"masterConfiguration": {
"spec": "elasticsearch.sn2ne.large",
"amount": 3,
"disk": 20,
"diskType": "cloud_ssd"
},
"networkConfig": {
"vpcId": "vpc-bp16k1dvzxtmagcva****",
"vsArea": "cn-hangzhou-i",
"type": "vpc",
"vswitchId": "vsw-bp1k4ec6s7sjdbudw****"
},
"nodeSpec": {
"spec": "elasticsearch.n4.small",
"disk": 50,
"diskType": "cloud_ssd"
}
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InstanceActivating | Instance is activating | |
| 400 | InstanceNotFound | The instanceId provided does not exist |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.