alibabacloud-elasticsearch-instance-manage

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Elasticsearch Instance Management

Elasticsearch实例管理

Manage Alibaba Cloud Elasticsearch instances: create, describe, list, restart, and query node information.
管理阿里云Elasticsearch实例:创建、查询详情、列举实例、重启实例以及查询节点信息。

Architecture

架构

Alibaba Cloud Elasticsearch Instance Management
├── createInstance     (Create Instance)
├── DescribeInstance   (Query Instance Details)
├── ListInstance       (List Instances)
├── ListAllNode        (Query Cluster Node Info)
└── RestartInstance    (Restart Instance)
Alibaba Cloud Elasticsearch Instance Management
├── createInstance     (创建实例)
├── DescribeInstance   (查询实例详情)
├── ListInstance       (列举实例)
├── ListAllNode        (查询集群节点信息)
└── RestartInstance    (重启实例)

Prerequisites

前置要求

Pre-check: Aliyun CLI >= 3.3.1 required Run
aliyun version
to verify >= 3.3.1. If not installed or version too low, see references/cli-installation-guide.md for installation instructions. Then [MUST] run
aliyun configure set --auto-plugin-install true
to enable automatic plugin installation.
bash
undefined
前置检查:要求Aliyun CLI版本 >= 3.3.1 运行
aliyun version
确认版本不低于3.3.1。如果未安装或版本过低,请参考references/cli-installation-guide.md的安装指引。 然后[必须]运行
aliyun configure set --auto-plugin-install true
开启自动插件安装功能。
bash
undefined

Verify CLI version

校验CLI版本

aliyun version
aliyun version

Enable auto plugin installation

开启自动插件安装

aliyun configure set --auto-plugin-install true

---
aliyun configure set --auto-plugin-install true

---

Authentication

身份认证

Pre-check: Alibaba Cloud Credentials Required
Security Rules (MUST FOLLOW):
  • NEVER read, echo, or print AK/SK values
  • NEVER ask the user to input AK/SK directly in the conversation
  • NEVER use
    aliyun configure set
    with literal credential values
  • NEVER accept AK/SK provided directly by users in the conversation
  • ONLY read credentials from environment variables or pre-configured CLI profiles
⚠️ CRITICAL: Handling User-Provided Credentials
If a user attempts to provide AK/SK directly (e.g., "My AK is xxx, SK is yyy"):
  1. STOP immediately - Do NOT execute any command
  2. Reject the request politely with the following message:
    For your account security, please do not provide Alibaba Cloud AccessKey ID and AccessKey Secret directly in the conversation.
    
    Please use the following secure methods to configure credentials:
    
    Method 1: Interactive configuration via aliyun configure (Recommended)
        aliyun configure
        # Enter AK/SK as prompted, credentials will be securely stored in local config file
    
    Method 2: Configure via environment variables
        export ALIBABA_CLOUD_ACCESS_KEY_ID=<your-access-key-id>
        export ALIBABA_CLOUD_ACCESS_KEY_SECRET=<your-access-key-secret>
    
    After configuration, please retry your request.
  3. Do NOT proceed with any Alibaba Cloud operations until credentials are properly configured
Check CLI configuration:
bash
   aliyun configure list
Check the output for a valid profile (AK, STS, or OAuth identity).
If no valid credentials exist, STOP here.

前置检查:需要阿里云凭证
安全规则(必须遵守):
  • 绝对不要读取、回显或打印AK/SK的值
  • 绝对不要要求用户在对话中直接输入AK/SK
  • 绝对不要使用明文凭证值执行
    aliyun configure set
    命令
  • 绝对不要接受用户在对话中直接提供的AK/SK
  • 从环境变量或预先配置的CLI配置文件中读取凭证
⚠️ 重要提示:处理用户提供的凭证
如果用户尝试直接提供AK/SK(例如:"我的AK是xxx,SK是yyy"):
  1. 立即停止操作 - 不要执行任何命令
  2. 礼貌拒绝请求,返回以下信息:
    为了您的账户安全,请不要在对话中直接提供阿里云AccessKey ID和AccessKey Secret。
    
    请使用以下安全方式配置凭证:
    
    方式1:通过aliyun configure交互式配置(推荐)
        aliyun configure
        # 按照提示输入AK/SK,凭证将安全存储在本地配置文件中
    
    方式2:通过环境变量配置
        export ALIBABA_CLOUD_ACCESS_KEY_ID=<your-access-key-id>
        export ALIBABA_CLOUD_ACCESS_KEY_SECRET=<your-access-key-secret>
    
    配置完成后,请重试您的请求。
  3. 不要继续执行任何阿里云操作,直到凭证正确配置
检查CLI配置:
bash
   aliyun configure list
检查输出中是否存在有效的配置文件(AK、STS或OAuth身份)。
如果没有有效凭证,请停止操作。

RAM Policy

RAM权限策略

Ensure the RAM user has the required permissions. See references/ram-policies.md for detailed policy configurations.
Minimum Required Permissions:
  • elasticsearch:CreateInstance
  • elasticsearch:DescribeInstance
  • elasticsearch:ListInstance
  • elasticsearch:ListAllNode
  • elasticsearch:RestartInstance

确保RAM用户拥有所需权限。参考references/ram-policies.md查看详细的权限配置。
最低所需权限:
  • elasticsearch:CreateInstance
  • elasticsearch:DescribeInstance
  • elasticsearch:ListInstance
  • elasticsearch:ListAllNode
  • elasticsearch:RestartInstance

Core Workflow

核心工作流程

Note: Elasticsearch APIs use ROA (RESTful) style. You can use
--body
to specify the HTTP request body as a JSON string. See examples in each task below.
Idempotency: For write operations (create, restart, delete, etc.), you MUST use the
--client-token
parameter to ensure idempotency.
  • Use a UUID format unique identifier as clientToken
  • When a request times out or fails, you can safely retry with the same clientToken. When retrying after timeout, it is recommended to wait 10 seconds before retrying
  • Duplicate requests with the same clientToken will not execute the operation repeatedly
  • Generation method: Prefer using uuidgen or PowerShell GUID; if the environment doesn't support it, generate a UUID format string directly; if strict randomness is not required, use idem-timestamp-semantic-identifier as a fallback. Do not interrupt the process due to unavailable commands.
注意: Elasticsearch API使用ROA (RESTful) 风格。您可以使用
--body
参数指定JSON格式的HTTP请求体,参考下方每个任务的示例。
幂等性: 对于写操作(创建、重启、删除等),您必须使用
--client-token
参数保证幂等性。
  • 使用UUID格式的唯一标识作为clientToken
  • 当请求超时或失败时,您可以使用相同的clientToken安全重试。超时后重试建议等待10秒再执行
  • 使用相同clientToken的重复请求不会重复执行操作
  • 生成方式:优先使用uuidgen或PowerShell GUID;如果环境不支持,直接生成UUID格式字符串;如果不需要严格随机性,可以使用idem-timestamp-semantic-identifier作为备用。不要因为命令不可用中断流程。

Task 1: Create Elasticsearch Instance

任务1:创建Elasticsearch实例

node-specifications-by-region.md Different roles in different regions support different specifications when creating instances, refer to this document.
⚠️ CRITICAL: Required Parameters and Region Validation
When creating an ES instance, parameters such as
--region
,
esAdminPassword
,
vpcId
,
vswitchId
,
vsArea
,
paymentType
MUST be explicitly provided by the user.
Important Notes:
  • The
    --region
    parameter MUST NOT be guessed or use default values
  • If the user does not provide a region or provides an invalid region, you MUST clearly prompt the user to provide a valid region
For detailed validation rules, refer to related-apis.md - createInstance Required Parameters and Region Validation
Method 2: Using --body to specify HTTP request body (RESTful style)
bash
undefined
node-specifications-by-region.md 创建实例时不同地域的不同角色支持不同规格,参考该文档。
⚠️ 重要提示:必填参数和地域校验
创建ES实例时,
--region
esAdminPassword
vpcId
vswitchId
vsArea
paymentType
等参数必须由用户明确提供
重要注意事项:
  • --region
    参数绝对不能猜测或使用默认值
  • 如果用户未提供地域或提供的地域无效,您必须明确提示用户提供有效的地域
详细的校验规则参考related-apis.md - createInstance必填参数和地域校验
方式2:使用--body指定HTTP请求体(RESTful风格)
bash
undefined

Generate idempotency token first

首先生成幂等性token

CLIENT_TOKEN=$(uuidgen)
aliyun elasticsearch create-instance
--region <RegionId>
--client-token $CLIENT_TOKEN
--body '{ "esAdminPassword": "<Password>", "esVersion": "7.10_with_X-Pack", "nodeAmount": 2, "nodeSpec": { "disk": 20, "diskType": "cloud_ssd", "spec": "elasticsearch.sn2ne.large.new" }, "networkConfig": { "vpcId": "<VpcId>", "vswitchId": "<VswitchId>", "vsArea": "<ZoneId>", "type": "vpc" }, "paymentType": "postpaid", "description": "<InstanceName>" }'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
**Example: Create Single Availability Zone Instance**
```bash
CLIENT_TOKEN=$(uuidgen)
aliyun elasticsearch create-instance
--region <RegionId>
--client-token $CLIENT_TOKEN
--body '{ "esAdminPassword": "<Password>", "esVersion": "7.10_with_X-Pack", "nodeAmount": 2, "nodeSpec": { "disk": 20, "diskType": "cloud_ssd", "spec": "elasticsearch.sn2ne.large.new" }, "networkConfig": { "vpcId": "<VpcId>", "vswitchId": "<VswitchId>", "vsArea": "<ZoneId>", "type": "vpc" }, "paymentType": "postpaid", "description": "<InstanceName>" }'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
**示例:创建单可用区实例**
```bash

Generate idempotency token (use the same token when retrying after timeout)

生成幂等性token(超时重试时使用相同token)

CLIENT_TOKEN=$(uuidgen)
aliyun elasticsearch create-instance
--region cn-hangzhou
--client-token $CLIENT_TOKEN
--body '{ "esAdminPassword": "YourPassword123!", "esVersion": "7.10_with_X-Pack", "nodeAmount": 2, "nodeSpec": { "disk": 20, "diskType": "cloud_ssd", "spec": "elasticsearch.sn2ne.large.new" }, "networkConfig": { "vpcId": "vpc-bp1xxx", "vswitchId": "vsw-bp1xxx", "vsArea": "cn-hangzhou-i", "type": "vpc" }, "paymentType": "postpaid", "description": "my-es-instance", "kibanaConfiguration": { "spec": "elasticsearch.sn1ne.large", "amount": 1, "disk": 0 } }'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

**Example: Create Multi-Availability Zone Instance**

1. For multi-AZ instances, networkConfig.vswitchId only supports the primary availability zone vSwitch, and networkConfig.vsArea only supports the primary availability zone name. Nodes will be automatically distributed to different availability zones. Do not specify availability zones and vSwitches through zoneInfos when creating, let the cloud provider allocate automatically.
2. Specify the number of availability zones through zoneCount. For multi-AZ instances, you must create master nodes.

```bash
CLIENT_TOKEN=$(uuidgen)
aliyun elasticsearch create-instance
--region cn-hangzhou
--client-token $CLIENT_TOKEN
--body '{ "esAdminPassword": "YourPassword123!", "esVersion": "7.10_with_X-Pack", "nodeAmount": 2, "nodeSpec": { "disk": 20, "diskType": "cloud_ssd", "spec": "elasticsearch.sn2ne.large.new" }, "networkConfig": { "vpcId": "vpc-bp1xxx", "vswitchId": "vsw-bp1xxx", "vsArea": "cn-hangzhou-i", "type": "vpc" }, "paymentType": "postpaid", "description": "my-es-instance", "kibanaConfiguration": { "spec": "elasticsearch.sn1ne.large", "amount": 1, "disk": 0 } }'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

**示例:创建多可用区实例**

1. 对于多可用区实例,networkConfig.vswitchId仅支持主可用区vSwitch,networkConfig.vsArea仅支持主可用区名称。节点将自动分配到不同可用区。创建时不要通过zoneInfos指定可用区和vSwitch,由云服务商自动分配。
2. 通过zoneCount指定可用区数量。多可用区实例必须创建主节点。

```bash

Generate idempotency token

生成幂等性token

CLIENT_TOKEN=$(uuidgen)
aliyun elasticsearch create-instance
--region cn-hangzhou
--client-token $CLIENT_TOKEN
--body '{ "esAdminPassword": "YourPassword123!", "esVersion": "7.10_with_X-Pack", "nodeAmount": 2, "nodeSpec": { "disk": 20, "diskType": "cloud_ssd", "spec": "elasticsearch.sn2ne.large.new" }, "networkConfig": { "vpcId": "vpc-bp1xxx", "vswitchId": "vsw-bp1xxx", "vsArea": "cn-hangzhou-i", "type": "vpc" }, "paymentType": "postpaid", "description": "my-es-instance", "zoneCount": "2", "kibanaConfiguration": { "spec": "elasticsearch.sn1ne.large", "amount": 1, "disk": 0 }, "masterConfiguration": { "amount": 3, "disk": 20, "diskType": "cloud_essd", "spec": "elasticsearch.sn2ne.xlarge" } }'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

**Error Handling**
1. When an error occurs indicating that order parameters do not meet validation conditions, it may be due to incorrect data node specifications. You should prompt the user to use the correct specifications and not guess on your own. Refer to the specifications document [node-specifications-by-region.md](references/node-specifications-by-region.md)
CLIENT_TOKEN=$(uuidgen)
aliyun elasticsearch create-instance
--region cn-hangzhou
--client-token $CLIENT_TOKEN
--body '{ "esAdminPassword": "YourPassword123!", "esVersion": "7.10_with_X-Pack", "nodeAmount": 2, "nodeSpec": { "disk": 20, "diskType": "cloud_ssd", "spec": "elasticsearch.sn2ne.large.new" }, "networkConfig": { "vpcId": "vpc-bp1xxx", "vswitchId": "vsw-bp1xxx", "vsArea": "cn-hangzhou-i", "type": "vpc" }, "paymentType": "postpaid", "description": "my-es-instance", "zoneCount": "2", "kibanaConfiguration": { "spec": "elasticsearch.sn1ne.large", "amount": 1, "disk": 0 }, "masterConfiguration": { "amount": 3, "disk": 20, "diskType": "cloud_essd", "spec": "elasticsearch.sn2ne.xlarge" } }'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

**错误处理**
1. 当出现订单参数不符合校验条件的错误时,可能是数据节点规格不正确。您应该提示用户使用正确的规格,不要自行猜测。参考规格文档[node-specifications-by-region.md](references/node-specifications-by-region.md)

Task 2: Describe Instance Details

任务2:查询实例详情

⚠️ Important: Required Parameters Must Be Provided by User When querying instance details,
--region
and
--instance-id
must be explicitly provided by the user. Do not guess the region. For detailed instructions, refer to related-apis.md - DescribeInstance Required Parameters
bash
aliyun elasticsearch describe-instance \
  --region <RegionId> \
  --instance-id <InstanceId> \
  --connect-timeout 3 \
  --read-timeout 10 \
  --user-agent AlibabaCloud-Agent-Skills
Example:
bash
aliyun elasticsearch describe-instance \
  --region cn-hangzhou \
  --instance-id es-cn-xxx**** \
  --connect-timeout 3 \
  --read-timeout 10 \
  --user-agent AlibabaCloud-Agent-Skills
⚠️ 重要提示:必填参数必须由用户提供 查询实例详情时,
--region
--instance-id
必须由用户明确提供。不要猜测地域。 详细说明参考related-apis.md - DescribeInstance必填参数
bash
aliyun elasticsearch describe-instance \
  --region <RegionId> \
  --instance-id <InstanceId> \
  --connect-timeout 3 \
  --read-timeout 10 \
  --user-agent AlibabaCloud-Agent-Skills
示例:
bash
aliyun elasticsearch describe-instance \
  --region cn-hangzhou \
  --instance-id es-cn-xxx**** \
  --connect-timeout 3 \
  --read-timeout 10 \
  --user-agent AlibabaCloud-Agent-Skills

Task 3: List Instances

任务3:列举实例

⚠️ Important: Required Parameters and Parameter Validation
  • The
    --region
    parameter must be explicitly provided by the user. Do not guess or use default values.
  • The
    --status
    parameter only supports valid values:
    activating
    ,
    active
    ,
    inactive
    ,
    invalid
    (case-sensitive)
  • For detailed instructions, refer to related-apis.md - ListInstance Required Parameters and Parameter Validation
bash
aliyun elasticsearch list-instance \
  --region <RegionId> \
  --page 1 \
  --size 10 \
  --connect-timeout 3 \
  --read-timeout 10 \
  --user-agent AlibabaCloud-Agent-Skills
Example with filters:
bash
undefined
⚠️ 重要提示:必填参数和参数校验
  • --region
    参数必须由用户明确提供。不要猜测或使用默认值。
  • --status
    参数仅支持有效值:
    activating
    active
    inactive
    invalid
    (区分大小写)
  • 详细说明参考related-apis.md - ListInstance必填参数和参数校验
bash
aliyun elasticsearch list-instance \
  --region <RegionId> \
  --page 1 \
  --size 10 \
  --connect-timeout 3 \
  --read-timeout 10 \
  --user-agent AlibabaCloud-Agent-Skills
带过滤条件的示例:
bash
undefined

List all instances

列举所有实例

aliyun elasticsearch list-instance
--region cn-hangzhou
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
aliyun elasticsearch list-instance
--region cn-hangzhou
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

Filter by status

按状态过滤

aliyun elasticsearch list-instance
--region cn-hangzhou
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
aliyun elasticsearch list-instance
--region cn-hangzhou
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

Filter by name (fuzzy match)

按名称过滤(模糊匹配)

aliyun elasticsearch list-instance
--region cn-hangzhou
--description "my-es"
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
undefined
aliyun elasticsearch list-instance
--region cn-hangzhou
--description "my-es"
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
undefined

Task 4: Restart Instance

任务4:重启实例

⚠️ CRITICAL: Pre-restart Check Requirements
Before executing a restart operation, you must first query the instance status and confirm it is
active
:
Pre-check Rules:
  • Only when the instance status is
    active
    can you execute the restart operation
  • If the instance status is abnormal (such as
    activating
    ,
    inactive
    ,
    invalid
    , etc.), restart operation is prohibited
  • If the instance status is abnormal, you should inform the user that the current status is not suitable for restart and recommend waiting for the instance to recover or contacting Alibaba Cloud technical support
Using --body to specify HTTP request body (RESTful style)
bash
undefined
⚠️ 重要提示:重启前检查要求
执行重启操作前,您必须先查询实例状态,确认状态为
active
前置检查规则:
  • 仅当实例状态为
    active
    时才能执行重启操作
  • 如果实例状态异常(例如
    activating
    inactive
    invalid
    等),禁止执行重启操作
  • 如果实例状态异常,您应该告知用户当前状态不适合重启,建议等待实例恢复或联系阿里云技术支持
使用--body指定HTTP请求体(RESTful风格)
bash
undefined

Generate idempotency token

生成幂等性token

CLIENT_TOKEN=$(uuidgen)
aliyun elasticsearch restart-instance
--region <RegionId>
--instance-id <InstanceId>
--client-token $CLIENT_TOKEN
--body '<JSON_BODY>'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

**Example (using --body):**
```bash
CLIENT_TOKEN=$(uuidgen)
aliyun elasticsearch restart-instance
--region <RegionId>
--instance-id <InstanceId>
--client-token $CLIENT_TOKEN
--body '<JSON_BODY>'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

**示例(使用--body):**
```bash

Generate idempotency token

生成幂等性token

CLIENT_TOKEN=$(uuidgen)
CLIENT_TOKEN=$(uuidgen)

Normal restart

正常重启

aliyun elasticsearch restart-instance
--region cn-hangzhou
--instance-id es-cn-xxx****
--client-token $CLIENT_TOKEN
--body '{"restartType":"instance"}'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
aliyun elasticsearch restart-instance
--region cn-hangzhou
--instance-id es-cn-xxx****
--client-token $CLIENT_TOKEN
--body '{"restartType":"instance"}'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

Force restart

强制重启

aliyun elasticsearch restart-instance
--region cn-hangzhou
--instance-id es-cn-xxx****
--client-token $CLIENT_TOKEN
--body '{"restartType":"instance","force":true}'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
aliyun elasticsearch restart-instance
--region cn-hangzhou
--instance-id es-cn-xxx****
--client-token $CLIENT_TOKEN
--body '{"restartType":"instance","force":true}'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

Restart specific nodes

重启指定节点

aliyun elasticsearch restart-instance
--region cn-hangzhou
--instance-id es-cn-xxx****
--client-token $CLIENT_TOKEN
--body '{"restartType":"nodeIp","nodes":["10.0.XX.XX","10.0.XX.XX"]}'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
undefined
aliyun elasticsearch restart-instance
--region cn-hangzhou
--instance-id es-cn-xxx****
--client-token $CLIENT_TOKEN
--body '{"restartType":"nodeIp","nodes":["10.0.XX.XX","10.0.XX.XX"]}'
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
undefined

Task 5: List All Nodes (Query Cluster Node Information)

任务5:列举所有节点(查询集群节点信息)

bash
aliyun elasticsearch list-all-node \
  --region <RegionId> \
  --instance-id <InstanceId> \
  --connect-timeout 3 \
  --read-timeout 10 \
  --user-agent AlibabaCloud-Agent-Skills
Parameters:
ParameterRequiredDescription
--instance-id
YesInstance ID
--extended
NoWhether to return node monitoring information, default true
Example:
bash
undefined
bash
aliyun elasticsearch list-all-node \
  --region <RegionId> \
  --instance-id <InstanceId> \
  --connect-timeout 3 \
  --read-timeout 10 \
  --user-agent AlibabaCloud-Agent-Skills
参数:
参数是否必填说明
--instance-id
实例ID
--extended
是否返回节点监控信息,默认true
示例:
bash
undefined

List all nodes with monitoring info

列举所有节点并返回监控信息

aliyun elasticsearch list-all-node
--region cn-hangzhou
--instance-id es-cn-xxx****
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills
aliyun elasticsearch list-all-node
--region cn-hangzhou
--instance-id es-cn-xxx****
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

Query specific fields

查询指定字段

aliyun elasticsearch list-all-node
--region cn-hangzhou
--instance-id es-cn-xxx****
--cli-query "Result[].{Host:host,Type:nodeType,Health:health,CPU:cpuPercent,Heap:heapPercent,Disk:diskUsedPercent}"
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

**Response Fields:**

| Field | Description |
|-------|-------------|
| `host` | Node IP address |
| `nodeType` | Node type: MASTER/WORKER/WORKER_WARM/COORDINATING/KIBANA |
| `health` | Node health status: GREEN/YELLOW/RED/GRAY |
| `cpuPercent` | CPU usage rate |
| `heapPercent` | JVM memory usage rate |
| `diskUsedPercent` | Disk usage rate |
| `loadOneM` | One minute load |
| `zoneId` | Availability zone where the node is located |
| `port` | Node access port |

---
aliyun elasticsearch list-all-node
--region cn-hangzhou
--instance-id es-cn-xxx****
--cli-query "Result[].{Host:host,Type:nodeType,Health:health,CPU:cpuPercent,Heap:heapPercent,Disk:diskUsedPercent}"
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

**响应字段:**

| 字段 | 说明 |
|-------|-------------|
| `host` | 节点IP地址 |
| `nodeType` | 节点类型:MASTER/WORKER/WORKER_WARM/COORDINATING/KIBANA |
| `health` | 节点健康状态:GREEN/YELLOW/RED/GRAY |
| `cpuPercent` | CPU使用率 |
| `heapPercent` | JVM内存使用率 |
| `diskUsedPercent` | 磁盘使用率 |
| `loadOneM` | 一分钟负载 |
| `zoneId` | 节点所在可用区 |
| `port` | 节点访问端口 |

---

Success Verification

成功验证

See references/verification-method.md for detailed verification steps.
Quick Verification:
bash
undefined
参考references/verification-method.md查看详细验证步骤。
快速验证:
bash
undefined

Check instance status

检查实例状态

aliyun elasticsearch describe-instance
--region cn-hangzhou
--instance-id es-cn-xxx****
--cli-query "Result.status"
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

Expected status: `active`

---
aliyun elasticsearch describe-instance
--region cn-hangzhou
--instance-id es-cn-xxx****
--cli-query "Result.status"
--connect-timeout 3
--read-timeout 10
--user-agent AlibabaCloud-Agent-Skills

预期状态:`active`

---

Best Practices

最佳实践

  1. Always confirm parameters before executing create commands
  2. Use
    --cli-query
    to filter JSON output for specific fields
  3. Monitor instance status after create/restart operations
  4. Set meaningful instance names using
    --description
    for easy identification
  5. Use appropriate node specifications based on your workload requirements
  6. Configure Kibana for visualization and management
  7. Enable master nodes for production environments with 3+ data nodes
  8. Use idempotency tokens (
    --client-token
    ) for all write operations to enable safe retries on timeout
  1. 执行创建命令前始终确认参数
  2. **使用
    --cli-query
    **过滤JSON输出,获取指定字段
  3. 创建/重启操作后监控实例状态
  4. 使用
    --description
    设置有意义的实例名称,方便识别
  5. 根据工作负载需求使用合适的节点规格
  6. 配置Kibana用于可视化和管理
  7. 3个及以上数据节点的生产环境开启主节点
  8. 所有写操作使用幂等性token
    --client-token
    ),支持超时后安全重试

Idempotency Best Practices

幂等性最佳实践

For write operations (create, restart, delete), be sure to follow these idempotency best practices:
  1. Generate unique Token before each operation: Use
    uuidgen
    to generate UUID
  2. Reuse Token when retrying after timeout: If the request times out, retry with the same clientToken. When the user requests a retry, use the same clientToken
  3. Use different Tokens for different operations: Each independent operation requires a new clientToken, but if the user requests a retry, use the same clientToken
  4. Token validity: clientToken is typically valid for 24 hours
bash
undefined
对于写操作(创建、重启、删除),请务必遵守以下幂等性最佳实践:
  1. 每次操作前生成唯一Token:使用
    uuidgen
    生成UUID
  2. 超时重试时复用Token:如果请求超时,使用相同的clientToken重试。用户请求重试时,使用相同的clientToken
  3. 不同操作使用不同Token:每个独立操作需要新的clientToken,但用户请求重试时使用相同的clientToken
  4. Token有效期:clientToken通常有效期为24小时
bash
undefined

Example: Safe retry pattern

示例:安全重试模式

CLIENT_TOKEN=$(uuidgen) echo "Using clientToken: $CLIENT_TOKEN"
CLIENT_TOKEN=$(uuidgen) echo "Using clientToken: $CLIENT_TOKEN"

First attempt

首次尝试

aliyun elasticsearch create-instance --client-token $CLIENT_TOKEN ...
aliyun elasticsearch create-instance --client-token $CLIENT_TOKEN ...

If timeout, retry with the same Token

如果超时,使用相同Token重试

aliyun elasticsearch create-instance --client-token $CLIENT_TOKEN ...

---
aliyun elasticsearch create-instance --client-token $CLIENT_TOKEN ...

---

Reference Links

参考链接

ReferenceDescription
related-apis.mdAPI and CLI command details
ram-policies.mdRAM permission policies
verification-method.mdVerification steps
acceptance-criteria.mdCorrect/incorrect patterns
cli-installation-guide.mdCLI installation guide
node-specifications-by-region.mdNode specifications by region and role

参考文档说明
related-apis.mdAPI和CLI命令详情
ram-policies.mdRAM权限策略
verification-method.md验证步骤
acceptance-criteria.md正确/错误模式
cli-installation-guide.mdCLI安装指引
node-specifications-by-region.md不同地域和角色的节点规格

Official Documentation

官方文档