Alibaba Cloud MongoDB Instance Management
阿里云MongoDB实例管理
Create and manage Alibaba Cloud ApsaraDB for MongoDB instances: Standalone (dev/test), Replica Set (read-heavy), Sharded Cluster (high concurrency).
创建并管理阿里云ApsaraDB for MongoDB实例:单节点(开发/测试)、副本集(读密集型)、分片集群(高并发)。
Installation Requirements
安装要求
Pre-check: Aliyun CLI >= 3.3.3 required
Run
to verify >= 3.3.3. If not installed or version too low,
see
references/cli-installation-guide.md for installation instructions.
[MUST] run
aliyun configure set --auto-plugin-install true
to enable automatic plugin installation.
[MUST] run
to ensure that any existing plugins are always up-to-date.
bash
aliyun version
aliyun plugin install --names dds kms resourcemanager bssopenapi
[MUST] CLI User-Agent — Every
CLI command invocation must include:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
[MUST] Enable AI-Mode — AI-mode is required for Agent Skill execution.
Run the following commands before any CLI invocation:
bash
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage"
[MUST] Disable AI-Mode at EVERY exit point — Before delivering the final response for ANY reason, always disable AI-mode first. This applies to ALL exit paths: workflow success, workflow failure, error/exception, user cancellation, session end, or any other scenario where no further CLI commands will be executed.
bash
aliyun configure ai-mode disable
预检查:需Aliyun CLI >= 3.3.3
运行
验证版本是否≥3.3.3。若未安装或版本过低,
请查看
references/cli-installation-guide.md获取安装说明。
[必须] 运行
aliyun configure set --auto-plugin-install true
启用自动插件安装。
[必须] 运行
确保所有现有插件始终保持最新。
bash
aliyun version
aliyun plugin install --names dds kms resourcemanager bssopenapi
[必须] CLI用户代理 — 每次调用
CLI命令时必须包含:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
[必须] 启用AI模式 — Agent Skill执行需要AI模式。
在调用任何CLI命令前运行以下命令:
bash
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage"
[必须] 在所有退出点禁用AI模式 — 无论出于何种原因返回最终响应前,必须先禁用AI模式。这适用于所有退出路径:工作流成功、工作流失败、错误/异常、用户取消、会话结束,或任何不再执行CLI命令的场景。
bash
aliyun configure ai-mode disable
Information Display Standards
信息展示标准
[MUST] All information displayed to the user must comply with:
- No fabricated output: All displayed information must come from actual API query results. Speculation, fabrication, or splicing is strictly prohibited
- Truncation handling: If API response is truncated (e.g., omitted), must re-query completely before displaying
- Count validation: Displayed count must match TotalCount/actual count returned by API
- No speculative time estimates: Do not provide time estimates without official documentation basis; only confirm status via API polling
- Write operation response standard: After issuing any write operation (create, modify spec, cloud disk reconfiguration, add/delete node, etc.), only display (and / if available), then ask the user whether to poll instance status. Do NOT start polling automatically before user confirmation.
- Auto-polling rules after instance creation:
- It typically takes 10-25 minutes for a newly created instance to reach Running status
- Scenario A: User only creates an instance with no follow-up operations → ask whether to poll
- Scenario B: User has follow-up operations after creation (e.g., modify spec, configure whitelist, etc.) and has NOT explicitly stated they will check status manually → MUST auto-poll, querying
describe-db-instance-attribute
every 30 seconds until status is or timeout (30 minutes)
- Scenario C: User explicitly states "I'll check myself", "handle it later", etc. → do not auto-poll, handle as Scenario A
- Security configuration guidance after instance creation: After instance creation completes (status is Running), MUST proactively ask whether to perform security configuration (see security configuration menu in "Parameter Confirmation" section)
- Subscription instance display: Must show remaining days; instances expiring within 10 days must display a warning below the list and guide toward renewal
[必须] 展示给用户的所有信息必须符合以下要求:
- 禁止伪造输出:所有展示的信息必须来自实际API查询结果。严禁推测、伪造或拼接内容
- 截断处理:若API响应被截断(如内容省略),必须重新完整查询后再展示
- 数量验证:展示的数量必须与API返回的TotalCount/实际数量一致
- 禁止无依据的时间预估:若无官方文档依据,不得提供时间预估;仅通过API轮询确认状态
- 写入操作响应标准:执行任何写入操作(创建、修改规格、云盘重配置、添加/删除节点等)后,仅展示(若有/也可展示),然后询问用户是否要轮询实例状态。在用户确认前不得自动开始轮询。
- 实例创建后的自动轮询规则:
- 新创建的实例通常需要10-25分钟才能进入Running状态
- 场景A:用户仅创建实例无后续操作 → 询问是否轮询
- 场景B:用户创建实例后有后续操作(如修改规格、配置白名单等)且未明确说明将手动检查状态 → 必须自动轮询,每30秒调用
describe-db-instance-attribute
查询,直到状态为或超时(30分钟)
- 场景C:用户明确表示“我自己检查”、“稍后处理”等 → 不自动轮询,按场景A处理
- 实例创建后的安全配置引导:实例创建完成(状态为Running)后,必须主动询问是否执行安全配置(见“参数确认”部分的安全配置菜单)
- 包年包月实例展示:必须显示剩余天数;到期时间在10天内的实例必须在列表下方显示警告并引导续费
Instance Status Pre-check Standard
实例状态预检查标准
[MUST] Must check instance status before executing non-query operations:
- Call
describe-db-instance-attribute
to check
- Operations can only be issued when status is
| Status | Description | Can Issue |
|---|
| Running | ✅ |
| Changing spec | ❌ |
| / | Creating/Deleting node | ❌ |
| Creating | ❌ |
| Locked | ❌ Investigate cause first |
Locked status diagnosis (check
field):
- : Disk usage exceeded; auto-unlocks after expanding storage or cleaning data
- Other values: Overdue or expired; renew or recharge
bash
aliyun dds describe-db-instance-attribute --db-instance-id <id> --region <region> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage 2>&1 | grep '"DBInstanceStatus"'
[必须] 执行非查询操作前必须检查实例状态:
- 调用
describe-db-instance-attribute
检查
- 仅当状态为时才能执行操作
| 状态 | 描述 | 可执行操作 |
|---|
| 运行中 | ✅ |
| 变更规格中 | ❌ |
| / | 创建/删除节点中 | ❌ |
| 创建中 | ❌ |
| 已锁定 | ❌ 需先排查原因 |
- :磁盘用量超限;扩容存储或清理数据后自动解锁
- 其他值:欠费或过期;需续费或充值
bash
aliyun dds describe-db-instance-attribute --db-instance-id <id> --region <region> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage 2>&1 | grep '"DBInstanceStatus"'
Pre-check: Alibaba Cloud Credentials Required
- NEVER read/echo/print AK/SK values (do NOT run
echo $ALIBABA_CLOUD_ACCESS_KEY_ID
)
- ONLY use to check credential status
bash
aliyun configure list
If no valid profile exists, obtain credentials from
RAM Console and configure outside this session.
预检查:需阿里云凭证
- 严禁读取/回显/打印AK/SK值(不得运行
echo $ALIBABA_CLOUD_ACCESS_KEY_ID
)
- 仅可使用检查凭证状态
bash
aliyun configure list
若没有有效配置文件,请从
RAM控制台获取凭证并在本会话外完成配置。
This skill requires the following RAM permissions. See references/ram-policies.md § Full Permission Quick Reference for the complete list.
[MUST] Permission error handling: When detecting
/
/
/
:
- Identify the missing permission (extract Action and Resource from the error message)
- Guide the user to refer to
references/ram-policies.md
to request permissions
- Wait for user confirmation that permission has been granted before retrying; do NOT continue execution before the permission issue is resolved
本Skill需要以下RAM权限。完整权限列表请查看references/ram-policies.md § 全权限快速参考。
- 识别缺失的权限(从错误信息中提取Action和Resource)
- 引导用户参考
references/ram-policies.md
申请权限
- 等待用户确认权限已授予后再重试;权限问题解决前不得继续执行
Query Regions and Instances
查询地域与实例
[MUST] Region confirmation standard:
- When the user has not specified a region, ask for the region first; do not iterate and search directly
- Only iterate in the following order when the user explicitly states they are unsure: cn-beijing → cn-shanghai → ap-southeast-1 → us-west-1 → us-east-1 → cn-hangzhou → cn-shenzhen → cn-chengdu → cn-hongkong; if still not found, call to get remaining regions
- Query routing: Querying via cn-hangzhou may return instances from other regions; when displaying, RegionId must be based on the field returned by the API, not the query parameter
- List display: Must be categorized by instance type; Subscription instances must show remaining days; instances expiring within 10 days must display a warning below the list and guide toward renewal
[必须] 地域确认标准:
- 用户未指定地域时,先询问地域;不得直接遍历搜索
- 用户明确表示不确定时,仅按以下顺序遍历:cn-beijing → cn-shanghai → ap-southeast-1 → us-west-1 → us-east-1 → cn-hangzhou → cn-shenzhen → cn-chengdu → cn-hongkong;若仍未找到,调用获取剩余地域
- 查询路由:通过cn-hangzhou查询可能返回其他地域的实例;展示时,RegionId必须以API返回的字段为准,而非查询参数
- 列表展示:必须按实例类型分类;包年包月实例必须显示剩余天数;到期时间在10天内的实例必须在列表下方显示警告并引导续费
Query instance list
查询实例列表
If user specifies instance type, query that type only; if not specified, must query both types separately:
若用户指定实例类型,仅查询该类型;未指定时,必须分别查询两种类型:
aliyun dds describe-db-instances --biz-region-id <region> --db-instance-type replicate --page-size 50 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-db-instances --biz-region-id <region> --db-instance-type sharding --page-size 50 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-db-instances --biz-region-id <region> --db-instance-type replicate --page-size 50 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-db-instances --biz-region-id <region> --db-instance-type sharding --page-size 50 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
⚠️ Without --db-instance-type, only replicate is returned by default; sharded clusters will be missed
⚠️ 不指定--db-instance-type时,默认仅返回副本集实例;会遗漏分片集群
Query single instance details
查询单个实例详情
aliyun dds describe-db-instance-attribute --db-instance-id <id> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-db-instance-attribute --db-instance-id <id> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Query all supported regions
查询所有支持的地域
aliyun dds describe-regions --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
> Cross-region lookup scripts and full-region scan scripts: see [references/operations.md § Query Regions and Instances](references/operations.md)
aliyun dds describe-regions --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
> 跨地域查找脚本和全地域扫描脚本:请查看[references/operations.md § 查询地域与实例](references/operations.md)
Parameter Confirmation
参数确认
[MUST] Before executing any create/modify operation, must display a complete parameter list to the user and obtain Y/Yes confirmation
Workflow: Collect parameters → Display parameter list → Wait for Y confirmation → Execute → Only display RequestId/DBInstanceId → Ask whether to poll → Display security configuration guidance after completion
Security configuration guidance menu must be displayed after instance creation:
[0] Set root password - Cannot connect without password (priority)
[1] Set IP whitelist - Configure allowed access IPs
[2] Bind ECS security group - Control access via security group
[3] Associate global whitelist template - Use unified whitelist template
[4] Modify maintenance window - Set maintenance window
[5] Allocate public address - Enable public access (dev/test only)
[N] Skip
Full parameter confirmation format and required/optional parameter tables: see references/operations.md § Parameter Confirmation
[必须] 执行任何创建/修改操作前,必须向用户展示完整参数列表并获取Y/Yes确认
工作流:收集参数 → 展示参数列表 → 等待Y确认 → 执行 → 仅展示RequestId/DBInstanceId → 询问是否轮询 → 完成后展示安全配置引导
实例创建后必须展示安全配置引导菜单:
[0] 设置root密码 - 无密码无法连接(优先级最高)
[1] 设置IP白名单 - 配置允许访问的IP
[2] 绑定ECS安全组 - 通过安全组控制访问
[3] 关联全局白名单模板 - 使用统一白名单模板
[4] 修改维护窗口 - 设置维护时间段
[5] 分配公网地址 - 启用公网访问(仅用于开发/测试)
[N] 跳过
完整参数确认格式和必填/可选参数表:请查看references/operations.md § 参数确认
| Step | Name | Type | Description |
|---|
| 0 | Create resource group | Optional | Execute when resource group management is needed |
| 0.5 | Create KMS instance | Optional | Execute when cloud disk encryption is needed |
| 1 | Query VPC/VSwitch | Optional | Execute when user has not provided VPC |
| 2 | Validate VPC/VSwitch | Required | Ensure VPC/VSwitch are available |
| 3 | Validate zone | Required for standalone | Confirm target zone supports standalone |
| 4 | Parameter confirmation | Required | Must confirm before creation |
| 5 | Create instance | Required | Core operation |
| 6 | Verify creation | Required | Confirm instance creation succeeded |
| Step | Skip Condition |
|---|
| Create resource group | Using default resource group |
| Create KMS instance | Using default key or no encryption |
| Query VPC/VSwitch | User already provided VPC/VSwitch ID (but validation is still required) |
| Validate zone | Creating replica set or sharded cluster instance |
[MUST] Mandatory validation when user provides VPC/VSwitch:
Even if the user has provided VPC ID and VSwitch ID, must first call the following APIs to validate correctness and availability:
- : Validate whether VPC ID exists and is available
- : Validate whether VSwitch ID exists in the specified VPC and matches the target zone
- If any validation fails, must inform the user of the specific error and guide correction; do NOT directly use unvalidated VPC/VSwitch to create instances
[MUST] VPC/VSwitch validation must use DDS-specific APIs; generic VPC APIs (/) are prohibited:
| 步骤 | 名称 | 类型 | 描述 |
|---|
| 0 | 创建资源组 | 可选 | 需要资源组管理时执行 |
| 0.5 | 创建KMS实例 | 可选 | 需要云盘加密时执行 |
| 1 | 查询VPC/VSwitch | 可选 | 用户未提供VPC时执行 |
| 2 | 验证VPC/VSwitch | 必填 | 确保VPC/VSwitch可用 |
| 3 | 验证可用区 | 单节点必填 | 确认目标可用区支持单节点实例 |
| 4 | 参数确认 | 必填 | 创建前必须确认 |
| 5 | 创建实例 | 必填 | 核心操作 |
| 6 | 验证创建结果 | 必填 | 确认实例创建成功 |
| 步骤 | 跳过条件 |
|---|
| 创建资源组 | 使用默认资源组 |
| 创建KMS实例 | 使用默认密钥或无需加密 |
| 查询VPC/VSwitch | 用户已提供VPC/VSwitch ID(但仍需验证) |
| 验证可用区 | 创建副本集或分片集群实例 |
[必须] 用户提供VPC/VSwitch时的强制验证:
即使用户已提供VPC ID和VSwitch ID,必须先调用以下API验证其正确性和可用性:
- :验证VPC ID是否存在且可用
- :验证VSwitch ID是否存在于指定VPC且匹配目标可用区
- 若任何验证失败,必须告知用户具体错误并引导修正;不得直接使用未验证的VPC/VSwitch创建实例
[必须] VPC/VSwitch验证必须使用DDS专属API;严禁使用通用VPC API(/):
Step 1: Query available VPC list for specified zone (DDS-specific)
步骤1:查询指定可用区的可用VPC列表(DDS专属)
aliyun dds describe-rds-vpcs --zone-id <zone> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-rds-vpcs --zone-id <zone> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Step 2: Query available VSwitches under specified VPC (DDS-specific)
步骤2:查询指定VPC下的可用VSwitch(DDS专属)
aliyun dds describe-rds-vswitchs --vpc-id <vpc-id> --zone-id <zone> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
> Detailed commands and parameters: see [references/operations.md § Step 2: Query and Validate VPC and VSwitch](references/operations.md)
aliyun dds describe-rds-vswitchs --vpc-id <vpc-id> --zone-id <zone> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
> 详细命令和参数:请查看[references/operations.md § 步骤2:查询并验证VPC和VSwitch](references/operations.md)
Create Replica Set Instance
创建副本集实例
- must be queried via
describe-available-resource
(specs differ by region/zone/version/storage type)
- must match the zone of , otherwise
InvalidVpcIdRegion.NotSupported
error
- Multi-zone deployment requires and
bash
aliyun dds create-db-instance \
--biz-region-id <region> --zone-id <zone> --engine-version <ver> \
--db-instance-class <class> --db-instance-storage <GB> \
--vpc-id <vpc> --vswitch-id <vsw> --network-type VPC \
--replication-factor 3 --storage-type cloud_essd1 --charge-type PostPaid \
--db-instance-description <name> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
- 必须通过
describe-available-resource
查询(规格因地域/可用区/版本/存储类型而异)
- 必须与的可用区匹配,否则会出现
InvalidVpcIdRegion.NotSupported
错误
- 多可用区部署需要和
bash
aliyun dds create-db-instance \
--biz-region-id <region> --zone-id <zone> --engine-version <ver> \
--db-instance-class <class> --db-instance-storage <GB> \
--vpc-id <vpc> --vswitch-id <vsw> --network-type VPC \
--replication-factor 3 --storage-type cloud_essd1 --charge-type PostPaid \
--db-instance-description <name> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Optional: --secondary-zone-id --hidden-zone-id --readonly-replicas --encryption-key --resource-group-id
可选参数:--secondary-zone-id --hidden-zone-id --readonly-replicas --encryption-key --resource-group-id
Subscription: --charge-type PrePaid --period 1 --auto-renew true
包年包月:--charge-type PrePaid --period 1 --auto-renew true
Create Standalone Instance
创建单节点实例
--replication-factor 1 --db-type replicate
, storage type fixed to
- Must use standalone-specific specs (ending with like , or containing ); cannot use replica set specs
- Not supported in some regions/zones; must query
describe-available-resource --replication-factor 1
before creation
- When
InvalidDBInstanceNodeCount
error occurs, try other zones or suggest switching to replica set
bash
aliyun dds create-db-instance ... --db-type replicate --replication-factor 1 \
--db-instance-class <standalone-specific-spec> --storage-type cloud_essd1 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
- 使用
--replication-factor 1 --db-type replicate
,存储类型固定为
- 必须使用单节点专属规格(以结尾,如,或包含);不得使用副本集规格
- 部分地域/可用区不支持;创建前必须查询
describe-available-resource --replication-factor 1
- 若出现
InvalidDBInstanceNodeCount
错误,尝试其他可用区或建议切换到副本集
bash
aliyun dds create-db-instance ... --db-type replicate --replication-factor 1 \
--db-instance-class <单节点专属规格> --storage-type cloud_essd1 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Create Sharded Cluster Instance
创建分片集群实例
- Minimum 2 Mongos and 2 Shards each (max 32); each Shard is a 3-node replica set by default
- / parameters need to be repeated (specifying one node each time)
- Use to query sharded cluster specs ( is for replica sets only)
bash
aliyun dds create-sharding-db-instance \
--biz-region-id <region> --zone-id <zone> --engine MongoDB --engine-version <ver> \
--vpc-id <vpc> --vswitch-id <vsw> --network-type VPC \
--mongos Class=<class> --mongos Class=<class> \
--replica-set Class=<class> ReadonlyReplicas=0 Storage=20 \
--replica-set Class=<class> ReadonlyReplicas=0 Storage=20 \
--config-server Class=<class> Storage=20 \
--storage-type cloud_essd1 --charge-type PostPaid --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
- 最少需要2个Mongos和2个Shard(最多32个);每个Shard默认是3节点副本集
- / 参数需要重复指定(每次指定一个节点)
- 使用查询分片集群规格(仅适用于副本集)
bash
aliyun dds create-sharding-db-instance \
--biz-region-id <region> --zone-id <zone> --engine MongoDB --engine-version <ver> \
--vpc-id <vpc> --vswitch-id <vsw> --network-type VPC \
--mongos Class=<class> --mongos Class=<class> \
--replica-set Class=<class> ReadonlyReplicas=0 Storage=20 \
--replica-set Class=<class> ReadonlyReplicas=0 Storage=20 \
--config-server Class=<class> Storage=20 \
--storage-type cloud_essd1 --charge-type PostPaid --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Instance Creation Error Diagnosis
实例创建错误诊断
Error diagnosis table: see references/operations.md § Instance Creation Error Diagnosis
错误诊断表:请查看references/operations.md § 实例创建错误诊断
Modify Replica Set Instance Configuration
修改副本集实例配置
[MUST] Before modification:
- Query current configuration (
describe-db-instance-attribute
), extract /////
- Display "Current vs. New" comparison table and obtain user Y confirmation
- Do NOT execute modification command before user confirmation
Limitations: Storage downsizing, instance type change, and storage type change are not supported (for ESSD conversion, use the Cloud Disk Reconfiguration section)
Impact: Modification may cause 1-2 brief disconnections of ~30 seconds; recommended during off-peak hours
After successful modification command, only display RequestId/OrderId; do NOT auto-poll; must ask user for confirmation before starting
bash
aliyun dds modify-db-instance-spec --db-instance-id <id> \
[--db-instance-class <class>] [--db-instance-storage <GB>] \
[--replication-factor 3/5/7] [--readonly-replicas 0-5] \
[--order-type UPGRADE/DOWNGRADE] [--auto-pay true] \
--effective-time Immediately/MaintainTime --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Full parameter description: see references/operations.md § Modify Replica Set Instance
[必须] 修改前:
- 查询当前配置(
describe-db-instance-attribute
),提取/////
- 展示“当前配置 vs 新配置”对比表并获取用户Y确认
- 用户确认前不得执行修改命令
限制:不支持缩容存储、变更实例类型、变更存储类型(ESSD转换请使用云盘重配置部分)
影响:修改可能导致约30秒的短暂断开(1-2次);建议在非高峰时段执行
修改命令执行成功后,仅展示RequestId/OrderId;不得自动轮询;必须获得用户确认后再开始轮询
bash
aliyun dds modify-db-instance-spec --db-instance-id <id> \
[--db-instance-class <class>] [--db-instance-storage <GB>] \
[--replication-factor 3/5/7] [--readonly-replicas 0-5] \
[--order-type UPGRADE/DOWNGRADE] [--auto-pay true] \
--effective-time Immediately/MaintainTime --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
完整参数说明:请查看references/operations.md § 修改副本集实例
[MUST] Pre-deletion checklist:
- Confirm : → can delete; → cannot delete directly (wait expiry or console refund)
- Cloud disk instances only: query → check
BackupRetentionPolicyOnClusterDeletion
(0=delete all on release / 1=keep last backup / 2=keep all backups) → ask user if they want to change it via modify-backup-policy --backup-retention-policy-on-cluster-deletion
before deleting; see operations.md
- [MUST] Display confirmation to user: instance ID, region, billing type, irreversible data loss warning → requiring the user to reply "confirm delete {instance ID}" before executing
bash
aliyun dds delete-db-instance --db-instance-id <id> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
[必须] 删除前检查清单:
- 确认:(按量付费)→ 可删除;(包年包月)→ 无法直接删除(等待到期或控制台退款)
- 仅云盘实例:查询 → 检查
BackupRetentionPolicyOnClusterDeletion
(0=释放时删除所有备份 / 1=保留最后一份备份 / 2=保留所有备份)→ 删除前询问用户是否要通过modify-backup-policy --backup-retention-policy-on-cluster-deletion
修改该配置;请查看operations.md
- [必须] 向用户展示确认信息:实例ID、地域、计费类型、不可逆数据丢失警告 → **要求用户回复"confirm delete {instance ID}"**后再执行
bash
aliyun dds delete-db-instance --db-instance-id <id> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Sharded Cluster Node Management
分片集群节点管理
[MUST] Key limitations:
- Must retain at least 2 Mongos/Shards each, max 32
- New Shard configuration (spec + storage) must be ≥ the highest-configured existing Shard
- strictly serial: must wait for previous modification to complete () before issuing the next
- Batch modification does NOT support changing Shard readonly replica count; use individual modification instead
- When modifying multiple Shards, must confirm spec mapping and execution order with the user
- in must be a numeric type (not string), otherwise error
[必须] 关键限制:
- 必须至少保留2个Mongos/Shard;最多32个
- 新增Shard的配置(规格+存储)必须≥现有配置最高的Shard
- 严格串行执行:必须等待上一次修改完成(状态为Running)后再执行下一次
- 批量修改 不支持修改Shard只读副本数量;请使用单个修改
- 修改多个Shard时,必须与用户确认规格映射和执行顺序
- 中的必须为数值类型(不能是字符串),否则会出现错误
Query sharded cluster node details (ShardList/MongosList contain NodeId)
查询分片集群节点详情(ShardList/MongosList包含NodeId)
aliyun dds describe-db-instance-attribute --db-instance-id <id> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-db-instance-attribute --db-instance-id <id> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds create-node --db-instance-id <id> --node-type mongos/shard --node-class <class> [--node-storage <GB>] --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds create-node --db-instance-id <id> --node-type mongos/shard --node-class <class> [--node-storage <GB>] --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Batch add nodes (JSON format)
批量添加节点(JSON格式)
aliyun dds create-node-batch --db-instance-id <id> --nodes-info '{"Shards":[{"DBInstanceClass":"spec","Storage":40}],"Mongos":[{"DBInstanceClass":"spec"}]}' --auto-pay true --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds create-node-batch --db-instance-id <id> --nodes-info '{"Shards":[{"DBInstanceClass":"spec","Storage":40}],"Mongos":[{"DBInstanceClass":"spec"}]}' --auto-pay true --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Single node modification (strictly serial)
单个节点修改(严格串行)
aliyun dds modify-node-spec --db-instance-id <id> --node-id <node-id> --node-class <class> [--node-storage <GB>] [--readonly-replicas 0-5] --effective-time Immediately/MaintainTime --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds modify-node-spec --db-instance-id <id> --node-id <node-id> --node-class <class> [--node-storage <GB>] [--readonly-replicas 0-5] --effective-time Immediately/MaintainTime --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Batch modification (does not support readonly replica changes, requires DBInstanceName)
批量修改(不支持只读副本变更,需指定DBInstanceName)
aliyun dds modify-node-spec-batch --db-instance-id <id> --nodes-info '{"Shards":[{"DBInstanceClass":"spec","DBInstanceName":"d-xxx","Storage":40}]}' --auto-pay true --effective-time Immediately --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds modify-node-spec-batch --db-instance-id <id> --nodes-info '{"Shards":[{"DBInstanceClass":"spec","DBInstanceName":"d-xxx","Storage":40}]}' --auto-pay true --effective-time Immediately --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds delete-node --db-instance-id <id> --node-id <node-id> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
> Detailed command examples and NodesInfo format: see [references/operations.md § Sharded Cluster Node Management](references/operations.md)
aliyun dds delete-node --db-instance-id <id> --node-id <node-id> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
> 详细命令示例和NodesInfo格式:请查看[references/operations.md § 分片集群节点管理](references/operations.md)
Cloud Disk Reconfiguration (Disk Type Upgrade)
云盘重配置(磁盘类型升级)
[MUST] Independent from instance spec modification; used for disk type change or provisioned IOPS adjustment:
- Only supports ESSD PL1/PL2/PL3 → ESSD AutoPL (), one-way irreversible
- Prerequisite: Replica set storage > 40GB; Sharded cluster Shard storage > 40GB
- Provisioned IOPS range: 0~50000; interval between two modifications must be > 1 hour
- Before execution, must query and display //, obtain user Y confirmation
- Do NOT execute before user confirmation
bash
aliyun dds modify-db-instance-disk-type --db-instance-id <id> \
--db-instance-storage-type cloud_auto [--provisioned-iops <0~50000>] \
--region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Full parameter description: see references/operations.md § Cloud Disk Reconfiguration
[必须] 独立于实例规格修改;用于变更磁盘类型或调整预配置IOPS:
- 仅支持ESSD PL1/PL2/PL3 → ESSD AutoPL(),单向不可逆
- 前提条件:副本集存储>40GB;分片集群Shard存储>40GB
- 预配置IOPS范围:0~50000;两次修改间隔必须>1小时
- 执行前必须查询并展示//,获取用户Y确认
- 用户确认前不得执行
bash
aliyun dds modify-db-instance-disk-type --db-instance-id <id> \
--db-instance-storage-type cloud_auto [--provisioned-iops <0~50000>] \
--region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
完整参数说明:请查看references/operations.md § 云盘重配置
IOPS and Throughput Calculation Rules
IOPS和吞吐量计算规则
[MUST] Applicable only to cloud disk instances (not applicable to local disk):
- When displaying baseline IOPS/throughput, must use / fields returned by API, NOT formula-calculated values (actual values ≥ formula values)
- Formula (reference):
IOPS = min{1800+50×StorageGB, spec limit, disk type limit}
- IOPS improvement priority: Expand storage > Upgrade spec > Change disk type
Full spec limit tables and calculation examples: see references/operations.md § IOPS and Throughput Calculation Rules
[必须] 仅适用于云盘实例(不适用于本地磁盘):
- 展示基准IOPS/吞吐量时,必须使用API返回的/字段,不得使用公式计算值(实际值≥公式计算值)
- 公式(参考):
IOPS = min{1800+50×StorageGB, 规格限制, 磁盘类型限制}
- IOPS提升优先级:扩容存储 > 升级规格 > 变更磁盘类型
完整规格限制表和计算示例:请查看references/operations.md § IOPS和吞吐量计算规则
Reset root Password
重置root密码
[MUST] For sharded clusters, must ask the user before resetting password:
Which node type's password do you want to reset?
[1] db node (mongod, stores business data)
[2] cs node (configServer, stores cluster metadata)
[3] Reset both (execute twice separately)
Determine execution count based on user's answer; do NOT auto-execute twice without user confirmation
Password rules: 8-32 characters, must contain at least three of: uppercase letters/lowercase letters/digits/special characters (
)
[必须] 对于分片集群,重置密码前必须询问用户:
您要重置哪种节点类型的密码?
[1] db节点(mongod,存储业务数据)
[2] cs节点(configServer,存储集群元数据)
[3] 两者都重置(需分别执行两次)
根据用户的回答确定执行次数;不得未经用户确认自动执行两次
密码规则:8-32个字符,必须包含至少三种类型:大写字母/小写字母/数字/特殊字符(
)
Replica set / Standalone
副本集 / 单节点
aliyun dds reset-account-password --db-instance-id <id> --account-name root
--account-password <pwd> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds reset-account-password --db-instance-id <id> --account-name root
--account-password <pwd> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Sharded cluster (--character-type db or cs, required)
分片集群(必须指定--character-type db或cs)
aliyun dds reset-account-password --db-instance-id <id> --account-name root
--account-password <pwd> --character-type db --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds reset-account-password --db-instance-id <id> --account-name root
--account-password <pwd> --character-type db --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Instance Security Configuration
实例安全配置
Manage IP Whitelist
管理IP白名单
[MUST] Before modifying whitelist:
- First query current whitelist () and display to user
- Ask for modification mode: Cover (overwrite, ⚠️ deletes existing IPs) / Append (add, errors on duplicate IPs) / Extend (extend, recommended)
- Do NOT use Cover mode without asking the user
bash
aliyun dds describe-security-ips --db-instance-id <id> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds modify-security-ips --db-instance-id <id> --security-ips <IPs> --modify-mode Extend --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
[必须] 修改白名单前:
- 先查询当前白名单()并展示给用户
- 询问修改模式:覆盖(替换现有IP,⚠️会删除原有IP)/ 追加(添加新IP,重复IP会报错)/ 扩展(推荐模式)
- 未经用户询问不得使用覆盖模式
bash
aliyun dds describe-security-ips --db-instance-id <id> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds modify-security-ips --db-instance-id <id> --security-ips <IPs> --modify-mode Extend --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Specify group: add --security-ip-group-name <name>
指定分组:添加--security-ip-group-name <name>
Manage ECS Security Groups
管理ECS安全组
Note: ECS security groups bound to sharded clusters only apply to Mongos nodes.
bash
aliyun dds modify-security-group-configuration --db-instance-id <id> --security-group-id <sg-id> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-security-group-configuration --db-instance-id <id> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
注意:绑定到分片集群的ECS安全组仅对Mongos节点生效。
bash
aliyun dds modify-security-group-configuration --db-instance-id <id> --security-group-id <sg-id> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-security-group-configuration --db-instance-id <id> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Manage Global Whitelist Templates
管理全局白名单模板
[MUST] All global whitelist commands must specify both
and
(same value)
Use
(
NOT ) when associating with instances
[必须] 所有全局白名单命令必须同时指定
和
(值相同)
关联实例时使用
(
不得使用
)
aliyun dds create-global-security-ip-group --biz-region-id <region> --region <region> --global-ig-name <name> --gip-list <IPs> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds create-global-security-ip-group --biz-region-id <region> --region <region> --global-ig-name <name> --gip-list <IPs> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-global-security-ip-group --biz-region-id <region> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-global-security-ip-group --biz-region-id <region> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Associate with instance
关联实例
aliyun dds modify-global-security-ip-group-relation --db-cluster-id <id> --global-security-group-id <gid> --biz-region-id <region> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds modify-global-security-ip-group-relation --db-cluster-id <id> --global-security-group-id <gid> --biz-region-id <region> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Manage Public Network Address
管理公网地址
[MUST] Prerequisites for SRV address: (1) Cloud disk only; (2) Public SRV: allocate public address first; (3) Sharded cluster: allocate public on Mongos node (
) first; (4) Wait
between each step
Check flow for sharded cluster public SRV: describe-sharding-network-address
→ if no public →
allocate-public-network-address --node-id <mongos-s-xxx>
→ wait Running →
allocate-db-instance-srv-network-address --srv-connection-type public
→ wait Running → confirm
with
[MUST] API Selection Rule for Network Address Query:
- Replica Set: MUST use
describe-replica-set-role
- Sharded Cluster: MUST use
describe-sharding-network-address
- FORBIDDEN: DO NOT use
describe-db-instance-attribute
for network address queries — it does not return complete network info for sharded clusters. In results: =public; +=SRV address
[必须] SRV地址的前提条件:(1) 仅云盘实例;(2) 公网SRV:需先分配公网地址;(3) 分片集群:需先在Mongos节点(
)分配公网地址;(4) 每步操作后需等待状态变为Running
分片集群公网SRV检查流程:
describe-sharding-network-address
→ 若无公网地址 →
allocate-public-network-address --node-id <mongos-s-xxx>
→ 等待Running →
allocate-db-instance-srv-network-address --srv-connection-type public
→ 等待Running → 通过
describe-sharding-network-address
确认
且包含
[必须] 网络地址查询的API选择规则:
- 副本集:必须使用
describe-replica-set-role
- 分片集群:必须使用
describe-sharding-network-address
- 禁止:不得使用
describe-db-instance-attribute
查询网络地址 — 它不会返回分片集群的完整网络信息。结果中:=公网地址;+=SRV地址
Allocate public address (add --node-id <s-xxx> for sharded clusters)
分配公网地址(分片集群需添加--node-id <s-xxx>)
aliyun dds allocate-public-network-address --db-instance-id <id> [--node-id <s-xxx>] --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds allocate-public-network-address --db-instance-id <id> [--node-id <s-xxx>] --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Release non-SRV public address
释放非SRV公网地址
aliyun dds release-public-network-address --db-instance-id <id> [--node-id <s-xxx>] --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds release-public-network-address --db-instance-id <id> [--node-id <s-xxx>] --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Release SRV public address (sharded cluster MUST use --node-id <mongos-id> + --connection-type SRV; omitting either causes InvalidParameters.Format)
释放SRV公网地址(分片集群必须同时指定--node-id <mongos-id> + --connection-type SRV;缺少任一参数会导致InvalidParameters.Format错误)
aliyun dds release-public-network-address --db-instance-id <id> --node-id <s-xxx> --connection-type SRV --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds release-public-network-address --db-instance-id <id> --node-id <s-xxx> --connection-type SRV --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Allocate SRV address (vpc=private, public=public; public SRV requires public network address first)
分配SRV地址(vpc=内网,public=公网;公网SRV需先分配公网地址)
aliyun dds allocate-db-instance-srv-network-address --db-instance-id <id> --srv-connection-type vpc/public --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds allocate-db-instance-srv-network-address --db-instance-id <id> --srv-connection-type vpc/public --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Query (replica set)
查询(副本集)
aliyun dds describe-replica-set-role --db-instance-id <id> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-replica-set-role --db-instance-id <id> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Query (sharded cluster)
查询(分片集群)
aliyun dds describe-sharding-network-address --db-instance-id <id> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds describe-sharding-network-address --db-instance-id <id> --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Manage Instance Renewal
管理实例续费
Renewal only applies to Subscription instances; auto-renewal takes effect the next day; no immediate charge on the day of activation. See references/operations.md for charge retry schedules.
续费仅适用于包年包月实例;自动续费次日生效;激活当天不会立即扣费。扣费重试计划请查看references/operations.md。
Manual renewal (--period: 1~9, 12, 24, 36 months)
手动续费(--period:1~9、12、24、36个月)
aliyun dds renew-db-instance --db-instance-id <id> --period <months> --auto-pay true --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds renew-db-instance --db-instance-id <id> --period <months> --auto-pay true --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Enable auto-renewal (--duration required, in months)
启用自动续费(必须指定--duration,单位为月)
aliyun dds modify-instance-auto-renewal-attribute --db-instance-id <id> --auto-renew true --duration 1 --biz-region-id <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds modify-instance-auto-renewal-attribute --db-instance-id <id> --auto-renew true --duration 1 --biz-region-id <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Disable auto-renewal
禁用自动续费
aliyun dds modify-instance-auto-renewal-attribute --db-instance-id <id> --auto-renew false --biz-region-id <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds modify-instance-auto-renewal-attribute --db-instance-id <id> --auto-renew false --biz-region-id <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Convert Instance Billing Type
转换实例计费类型
Prerequisites: Instance status
, not a legacy spec
[MUST] Use
transform-instance-charge-type
(
NOT — that API is forbidden)
前提条件:实例状态为Running,非旧版规格
[必须] 使用
transform-instance-charge-type
(
不得使用
— 该API已被禁用)
Pay-As-You-Go → Subscription
按量付费 → 包年包月
aliyun dds transform-instance-charge-type --instance-id <id> --charge-type PrePaid --period 1 --pricing-cycle Month --auto-pay true --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds transform-instance-charge-type --instance-id <id> --charge-type PrePaid --period 1 --pricing-cycle Month --auto-pay true --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Subscription → Pay-As-You-Go (no period needed, may involve refund)
包年包月 → 按量付费(无需指定周期,可能涉及退款)
aliyun dds transform-instance-charge-type --instance-id <id> --charge-type PostPaid --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
aliyun dds transform-instance-charge-type --instance-id <id> --charge-type PostPaid --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Manage Instance Maintenance Window
管理实例维护窗口
bash
aliyun dds modify-db-instance-maintain-time --db-instance-id <id> --maintain-start-time "01:00Z" --maintain-end-time "02:00Z" --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
bash
aliyun dds modify-db-instance-maintain-time --db-instance-id <id> --maintain-start-time "01:00Z" --maintain-end-time "02:00Z" --user-agent AlibabaCloud-Agent-Skills/alibabacloud-mongodb-instances-manage
Additional Operations
其他操作
[MUST] All operations below require instance status
. Follow write operation response standard (§ Information Display Standards, item 5).
Detailed CLI commands and parameters: see
references/operations.md § Additional Operations
| Operation | CLI Command | Key Constraint |
|---|
| Restart instance | | [MUST] confirm with user before executing: instance ID, expected ~30s disconnection; off-peak recommended |
| Restart node | restart-node --node-id --role-id
| [MUST] confirm with user: instance ID + target node (RoleType/RoleId) before executing; Cloud disk only (), local disk → ; query RoleId via (includes Hidden); describe-replica-set-role
omits Hidden; sharded cluster requires both (e.g. ) AND |
| Manual backup | create-backup --backup-method
| Cloud disk: must pass ; local disk: Physical/Logical; cloud disk replica/sharded: --backup-retention-period
(7-730 or -1 permanent); response use (NOT deprecated ); poll via then query describe-backups --backup-job-id
; see operations.md |
| Query backups | describe-backups --start-time --end-time
| Time: (UTC); response: ; filter by job: |
| Query backup policy | | View retention days and window |
| Modify backup policy | | [MUST] always pass AND --preferred-backup-period
(required even when only changing other fields); query current values first via ; sharded cluster cannot disable log backup |
| Upgrade major version | upgrade-db-instance-engine-version
| One-way irreversible; query available versions first |
| Upgrade kernel version | upgrade-db-instance-kernel-version
| Replica set & sharded cluster only (not standalone) |
| HA switchover | | [MUST] query nodes via first; ask user which two nodes to swap roles (e.g. Primary↔Secondary, Secondary↔Hidden, etc.); sharded cluster: required |
| Create account | | Cloud disk sharded cluster only; name: 3-16 chars lowercase |
| Query accounts | | List database accounts |
| Bind tags | tag-resources --resource-type INSTANCE
| space-separated list; repeatable; up to 20 tags per instance; use ; see operations.md |
| Unbind tags | untag-resources --resource-type INSTANCE
| Remove specific tag keys |
| Query tags | list-tag-resources --resource-type INSTANCE
| [MUST] use as the ONLY API for tag queries; FORBIDDEN: do NOT use Tags field or as substitute |
[必须] 以下所有操作都要求实例状态为Running。遵循写入操作响应标准(§ 信息展示标准,第5条)。
详细CLI命令和参数:请查看references/operations.md § 其他操作
| 操作 | CLI命令 | 关键约束 |
|---|
| 重启实例 | | [必须] 执行前与用户确认:实例ID、预计约30秒断开连接;建议非高峰时段执行 |
| 重启节点 | restart-node --node-id --role-id
| [必须] 执行前与用户确认:实例ID + 目标节点(RoleType/RoleId);仅云盘实例()支持,本地磁盘会返回;通过查询RoleId(包含Hidden节点);describe-replica-set-role
会遗漏Hidden节点;分片集群需要同时指定(如)和 |
| 手动备份 | create-backup --backup-method
| 云盘实例:必须传入;本地磁盘:Physical/Logical;云盘副本集/分片集群:可指定--backup-retention-period
(7-730或-1永久);响应使用(不得使用已废弃的);通过轮询,再查询describe-backups --backup-job-id
;请查看operations.md |
| 查询备份 | describe-backups --start-time --end-time
| 时间格式:(UTC);响应:;可通过按任务过滤 |
| 查询备份策略 | | 查看保留天数和备份窗口 |
| 修改备份策略 | | [必须] 始终传入和--preferred-backup-period
(即使仅修改其他字段也需传入);先通过查询当前值;分片集群无法禁用日志备份 |
| 升级大版本 | upgrade-db-instance-engine-version
| 单向不可逆;先查询可用版本 |
| 升级内核版本 | upgrade-db-instance-kernel-version
| 仅支持副本集和分片集群(不支持单节点) |
| HA切换 | | [必须] 先通过查询节点;询问用户要交换哪两个节点的角色(如主节点↔从节点、从节点↔隐藏节点等);分片集群:必须指定 |
| 创建账号 | | 仅云盘分片集群支持;账号名:3-16个小写字符 |
| 查询账号 | | 列出数据库账号 |
| 绑定标签 | tag-resources --resource-type INSTANCE
| 为空格分隔的列表;可重复指定;每个实例最多绑定20个标签;需指定;请查看operations.md |
| 解绑标签 | untag-resources --resource-type INSTANCE
| 删除指定标签键 |
| 查询标签 | list-tag-resources --resource-type INSTANCE
| [必须] 使用作为唯一的标签查询API;禁止:不得使用的Tags字段或替代 |
Features Not Available via CLI
无法通过CLI实现的功能
| Feature | Description |
|---|
| KMS instance activation | After KMS instance creation, must be activated in KMS Console, configuring VPC/VSwitch |
| Free trial application | Must apply on Alibaba Cloud Free Trial page |
| 功能 | 描述 |
|---|
| KMS实例激活 | 创建KMS实例后,必须在KMS控制台激活,配置VPC/VSwitch |
| 免费试用申请 | 必须在阿里云免费试用页面申请 |
See references/verification-method.md for details.
详情请查看references/verification-method.md。
See references/operations.md § Best Practices for details.
详情请查看references/operations.md § 最佳实践。
| Reference | Description |
|---|
| references/operations.md | Detailed CLI command examples, parameter tables, IOPS calculation spec tables |
| references/related-apis.md | Complete API and CLI command list with external documentation links |
| references/ram-policies.md | RAM permission policies |
| references/verification-method.md | Verification methods |
| references/cli-installation-guide.md | CLI installation guide |
| references/acceptance-criteria.md | Test acceptance criteria |
| 参考文档 | 描述 |
|---|
| references/operations.md | 详细CLI命令示例、参数表、IOPS计算规格表 |
| references/related-apis.md | 完整API和CLI命令列表,含外部文档链接 |
| references/ram-policies.md | RAM权限策略 |
| references/verification-method.md | 验证方法 |
| references/cli-installation-guide.md | CLI安装指南 |
| references/acceptance-criteria.md | 测试验收标准 |