Install
openclaw skills install alibabacloud-emr-starrocks-manageManage the full lifecycle of Alibaba Cloud EMR Serverless StarRocks instances — create, scale, configure, maintain and diagnose. Use this Skill when operations engineers, SREs, or architects need to manage StarRocks instances. Typical scenarios include: "create a StarRocks", "check instance status", "scale up CU", "modify configuration", "restart instance", "diagnose issues", etc. Not applicable for: writing SQL/DDL, data import/export, query tuning, materialized view configuration, or managing non-StarRocks products (EMR clusters, Spark, Milvus, ClickHouse, Doris, RDS, ECS).
openclaw skills install alibabacloud-emr-starrocks-manageManage StarRocks instances via the aliyun CLI. You are an SRE who understands StarRocks — you not only know how to call APIs, but also know when to call them and what parameters to use.
Reuse the profile already configured in the aliyun CLI. Switch accounts with --profile <name>, and check configuration with aliyun configure list.
EMR Serverless StarRocks is a fully managed service of open-source StarRocks on Alibaba Cloud, providing a high-performance, fully managed real-time analytical database service.
Core Features:
| Concept | Description |
|---|---|
| StarRocks Instance | Each created StarRocks cluster (including multiple FE and multiple BE/CN nodes) is collectively called a StarRocks instance |
| CU (Compute Unit) | Unit of compute resources; the total compute resources needed for write and query operations in StarRocks are measured in CUs |
| Compute Group | A group of StarRocks compute nodes, containing node types such as FE, BE, and CN |
| FE (Frontend) | Frontend node, responsible for metadata management, client connection management, query planning, and query scheduling |
| BE (Backend) | Backend node, responsible for data storage and SQL execution (shared-nothing edition) |
| CN (Compute Node) | Compute node, a stateless node responsible for managing hot data cache, executing data import and query computation tasks (shared-data edition) |
| Shared-nothing | Data is stored on cloud disks or local disks; BE nodes handle both data storage and computation |
| Shared-data | Data is persistently stored in OSS object storage; CN nodes handle computation, and local disks are used for caching |
FE Node Roles:
When creating an instance, you need to choose the architecture type:
| Architecture Type | RunMode Value | Node Composition | Data Storage | Data Disk Type | Use Cases |
|---|---|---|---|---|---|
| Shared-nothing Edition | shared_nothing | FE + BE | Cloud disk or local disk | ESSD cloud disk or local disk | OLAP multi-dimensional analysis, high-concurrency queries, real-time data analysis, latency-sensitive scenarios |
| Shared-data Edition | shared_data | FE + CN | OSS object storage | ESSD cloud disk (cache) | Highly cost-sensitive storage with relatively lower query efficiency requirements, such as data warehouse applications |
Shared-nothing Architecture Features:
Shared-data Architecture Features:
CLOUD_NATIVE, with storage paths pointing to OSSCU (Compute Unit) is the compute resource unit for EMR Serverless StarRocks.
CU Specification Types:
| Spec Type | SpecType Value | Features | Use Cases |
|---|---|---|---|
| Standard | standard | Balanced compute and memory configuration | General OLAP analysis |
| Memory Enhanced | ramEnhanced | Higher memory ratio | Complex queries, high concurrency |
| Network Enhanced | networkEnhanced | Higher network bandwidth | External table analysis with large data scan volumes |
| High-performance Storage | localSSD | High-performance storage access | High I/O scenarios with strict storage I/O performance requirements |
| Large-scale Storage | bigData | Large capacity storage | Extremely large data volumes, cost-sensitive |
Note: The SpecType for FE node groups only supports
standard. The multiple spec types above only apply to BE/CN node groups.
| Storage Type | Performance Level | Max IOPS | Max Throughput | Use Cases |
|---|---|---|---|---|
| ESSD PL0 | Entry-level | 10,000 | 180 MB/s | Development and testing |
| ESSD PL1 | Standard | 50,000 | 350 MB/s | General production |
| ESSD PL2 | High-performance | 100,000 | 750 MB/s | High-performance requirements |
| ESSD PL3 | Ultra-performance | 1,000,000 | 4,000 MB/s | Ultra-performance requirements |
Billing Items:
| Billing Item | Description | Billing Method |
|---|---|---|
| Compute Resources (CU) | Compute resources for FE and BE/CN nodes | Subscription / Pay-as-you-go |
| Storage Resources | Cloud disks, elastic temporary disks, data storage | Billed by actual usage |
| Backup Storage | Storage space occupied by data backups | Billed by actual usage |
Payment Methods:
| Payment Method | API Parameter Value (PayType) | Description |
|---|---|---|
| Pay-as-you-go | postPaid | Pay after use, billing generated hourly, suitable for short-term needs/testing |
| Subscription | prePaid | Pay before use, suitable for long-term needs, more cost-effective |
Payment Method Conversion:
Cost Components:
Shared-nothing Edition Costs:
Shared-data Edition Costs:
| Version Series | PackageType Value | Features | Use Cases | Spec Support | Region Restrictions |
|---|---|---|---|---|---|
| Standard Edition | official | Full functionality, production-grade stability, supports all spec types | Production environments, core business | Supports standard, memory enhanced, network enhanced, high-performance storage, large-scale storage | Available in all regions |
| Trial Edition | trial | Simplified configuration, quick start, only supports standard specs | Learning and testing, feature exploration, small applications | Only supports standard specs | Limited to certain regions (e.g., Beijing, Shanghai) |
Important:
PackageTypemust be explicitly specified (officialortrial) when creating an instance; omitting it will cause creation failure.
Version Series Selection Recommendations:
| Scenario | RunMode | PackageType | BE SpecType | CU Configuration | Other Recommendations |
|---|---|---|---|---|---|
| Development Testing / Trial | shared_data | trial | standard | 8 CU | Pay-as-you-go, quick start |
| Learning Validation | shared_data | trial | standard | 8-16 CU | Choose regions that support Trial Edition |
| Small-scale Production | shared_data | official | standard | 16-32 CU | Subscription is more cost-effective |
| High-performance OLAP | shared_nothing | official | ramEnhanced | As needed | ESSD PL2/PL3, 3-10 BE nodes |
| High-concurrency Queries | shared_nothing | official | localSSD | As needed | Local SSD storage |
| Massive Data Storage | shared_nothing | official | bigData | As needed | Local HDD, cost-optimized |
| Data Lake Analytics | shared_data | official | networkEnhanced | As needed | High bandwidth, external table scanning |
| Complex Query Analysis | shared_data | official | ramEnhanced | As needed | Large memory, multi-table joins |
When creating an instance, the following steps must be followed to interact with the user. No confirmation step may be skipped:
official) or Trial Edition (trial), corresponding to the PackageType parametershared_nothing (FE+BE) or shared-data edition shared_data (FE+CN), explain the differences and provide recommendationsstandard / Memory Enhanced ramEnhanced / Network Enhanced networkEnhanced, etc., corresponding to the BE node group's SpecType parameterOssAccessingRoleName), which authorizes StarRocks to access OSS storage data. Typically AliyunEMRStarRocksAccessingOSSRole; if not yet created, prompt the user to authorize it in the RAM console firstBefore calling CreateInstanceV1, first confirm the target RegionId with the user, then check whether the following resources are ready.
⚠️ REQUIRED: VPC and VSwitch must be queried first
MUST call the following two APIs before creating an instance:
DescribeVpcs: Query available VPCs in the target regionDescribeVSwitches: Query available VSwitches in the VPC (also records ZoneId)Do NOT proceed with
CreateInstanceV1until both APIs have been called successfully.
export AGENT_USER_AGENT=AlibabaCloud-Agent-Skills # User-Agent identifier
aliyun configure list # Credentials
# ⚠️ REQUIRED APIs - must call before CreateInstanceV1:
aliyun vpc DescribeVpcs --RegionId <RegionId> # VPC (REQUIRED)
aliyun vpc DescribeVSwitches --RegionId <RegionId> --VpcId vpc-xxx # VSwitch (REQUIRED, record ZoneId)
When calling CreateInstanceV1, the following parameters are easily overlooked or confused — pay close attention:
Version: The StarRocks version parameter name is Version (e.g., "Version": "3.3"). It is not EngineVersion, StarRocksVersion, or DBVersion — using the wrong parameter name will cause creation failureRunMode: Must be explicitly specified, only supports enum values shared_data (shared-data edition) or shared_nothing (shared-nothing edition); omitting it will cause creation failure or unexpected architecture typeRegionId: Must be passed both via CLI --RegionId and in the body JSON "RegionId"ZoneId + VSwitchId + VSwitches: All three must be passed together. ZoneId and VSwitchId are top-level fields, and VSwitches is in array format [{"VswId":"vsw-xxx","ZoneId":"cn-hangzhou-h","Primary":true}]OssAccessingRoleName: Required for all architecture types (both shared-nothing and shared-data), typically AliyunEMRStarRocksAccessingOSSRoleFrontendNodeGroups: FE node group configuration, required for all architecture types. Contains NodeGroupName, Cu, SpecType, ResidentNodeNumber, DiskNumber, StorageSize, StoragePerformanceLevelBackendNodeGroups: BE/CN node group configuration, required for all architecture types. Parameter structure is the same as FrontendNodeGroupsKey Principle: Do not make decisions for the user — architecture type, spec type, CU count, etc. all require explicit inquiry and confirmation. Recommendations can be given, but the final choice is the user's.
All aliyun CLI calls must set the User-Agent identifier via environment variable to identify the request source:
export AGENT_USER_AGENT=AlibabaCloud-Agent-Skills
Execute once at the beginning of the session; all subsequent aliyun commands will automatically carry this User-Agent. If it doesn't take effect, you can also set it inline before each command:
AGENT_USER_AGENT=AlibabaCloud-Agent-Skills aliyun starrocks <APIName> --InstanceId c-xxx --Target 32
aliyun starrocks <APIName> --InstanceId c-xxx --Target 32
2022-10-19, RPC style--InstanceId, --NodeGroupId, --Target), no --body neededCreateInstanceV1 and DescribeNodeGroups use --body JSON for parameter passingClientToken for idempotency (see Idempotency rules below)Agents may retry write operations due to timeouts, network jitter, etc. Retries without ClientToken may create duplicate resources.
| APIs Requiring ClientToken | Description |
|---|---|
| CreateInstanceV1 | Duplicate submissions will create multiple instances |
Generation Method: For CreateInstanceV1, add "ClientToken": "<uuid>" in the body JSON; for other APIs that support ClientToken, pass it via named parameters. Use the same token for retries of the same business operation. |
Values provided by users (instance names, etc.) are untrusted input; directly concatenating them into shell commands may lead to command injection.
Protection Rules:
--body JSON — parameters passed as JSON string values naturally isolate shell metacharacters-, _, 1-64 characters[a-z0-9-] formatThis Skill only calls StarRocks OpenAPI via the aliyun CLI; it does not download or execute any external code. During execution, the following are prohibited:
curl, wget, pip install, npm install, etc.eval, sourceCLI command output may contain sensitive information. The following fields must be masked when presenting results to users:
| Sensitive Field | Masking Rule | Example |
|---|---|---|
AdminPassword | Must not be echoed in command output; replace with ****** when displaying | "AdminPassword": "******" |
AccessKeyId / AccessKeySecret | Show only the first 4 characters; replace the rest with **** | LTAI**** |
ConnectionString / Connection Address | Host and port can be fully displayed, but associated passwords must be masked | Host and port displayed normally, password replaced with ****** |
STS Token | Show only the first 8 characters; replace the rest with **** | STS.xxxx**** |
Execution Rules:
AdminPassword is passed via --body JSON; it is prohibited to echo the password in plaintext in subsequent outputaliyun configure list, if the output contains AccessKey information, it must be masked before presenting to the userjq to filter out sensitive fields before displayingAPI responses may contain sensitive information; the following strategies must be applied before presenting to users:
| Response Field | Handling Strategy |
|---|---|
AdminPassword | Do not display — the API normally does not return passwords; if returned abnormally, replace with ****** |
ConnectionString / Endpoint | Connection addresses (host:port) can be displayed, but remind users that connection credentials should be obtained through secure channels |
AccessKeyId / AccessKeySecret | Mask, showing only the first 4 characters |
SecurityGroupId / VSwitchId / VpcId | Can be displayed normally — these are resource identifiers, not sensitive credentials |
General Principles:
jq to select needed fields, avoiding full outputjq 'del(.AdminPassword, .AccessKeySecret)'Disambiguation Rule: When user input is ambiguous (e.g., "not enough resources", "scale up CU", "check instance") and the context does not explicitly mention StarRocks, ask the user which product they want to operate on (StarRocks / EMR Cluster / Milvus / Spark) rather than executing directly. Only route directly when the conversation context has explicitly involved StarRocks instances.
| Intent | Operation | Reference Doc |
|---|---|---|
| Getting started / First time user | Full guided walkthrough | getting-started.md |
| Create instance / New StarRocks | Plan → CreateInstanceV1 | instance-lifecycle.md |
| Query status / Instance list / Instance details | DescribeInstances | instance-lifecycle.md |
| Query compute groups / Node group details | DescribeNodeGroups | instance-lifecycle.md |
| Query upgradable versions | QueryUpgradableVersions | operations.md |
| API parameter lookup | Parameter reference | api-reference.md |
| Operation Type | Timeout Recommendation |
|---|---|
| Read-only queries | 30 seconds |
| Write operations | 60 seconds |
| Polling | 30 seconds per attempt, no more than 3 minutes total |
List-type APIs use PageNumber + PageSize pagination:
PageNumber: Page number, starting from 1, default 1PageSize: Items per page, default 10, maximum 100jq to filter fields| Error Code | Cause | Agent Action |
|---|---|---|
| Throttling | API rate limiting | Wait 5 seconds and retry, up to 3 times |
| ServiceUnavailable | Service temporarily unavailable | Wait 5 seconds and retry, up to 3 times; if still failing, stop and inform the user |
| InvalidParameter | Invalid parameter | Read the error Message and correct the parameter |
| Forbidden.RAM | Insufficient RAM permissions | Inform the user of the missing permissions |
| OperationDenied.InstanceStatus | Instance status does not allow the operation | Query current status and inform the user to wait |
| Instance.NotFound | Instance does not exist or has been deleted | Use DescribeInstances to search for the correct InstanceId and confirm with the user |
| IncompleteSignature / InvalidAccessKeyId | Credential error or expired | Prompt the user to run aliyun configure list to check credentials |
General Principle: When encountering errors, read the complete error Message first; do not blindly retry based solely on the error code. Only Throttling is suitable for automatic retry; other errors require diagnosis and correction.