Managing multiple Elastic Compute Service (ECS) instances in an Enterprise Distributed Application Service (EDAS) environment often requires running maintenance commands on each instance. Batch operations let you run commands across multiple instances at once from the EDAS console. You can target an entire cluster, all instances of an application, or a specific set of instances.
Prerequisites
Before you begin, make sure that you have:
An EDAS cluster with EDAS Agent installed on the ECS instances
Access to the EDAS console
Scenarios
You can perform batch operations in the following scenarios:
Perform the same operation on multiple instances or across multiple clusters.
Run multiple commands at the same time.
Query command execution results.
Run a batch command
Batch commands support three levels: by cluster, by application, or by instance. The following steps use cluster-level operations as an example. Application-level and instance-level operations follow the same workflow.
Log on to the EDAS console.
In the left-side navigation pane, choose System Management > Batch Operations.
On the Batch Operations page, select the region and the namespace.
Click the By Cluster, By Application, or By Instance tab to set the scope.
Click Create next to Select Cluster. In the Select Cluster dialog box:
In the Unselected section on the left, select one or more clusters. Use the search box to filter by cluster name.
Click > to move the selected clusters to the Selected section on the right.
Click OK.
Enter your command in the Command code editor.
(Optional) If your selected clusters include mixed types (ECS-based and Docker-based), select the execution scope:
Note If all selected clusters are the same type, you do not need to select the execution scope.Scope Description On ECS instances Run the command only on ECS instances In Docker containers Run the command only inside Docker containers On ECS instances and In Docker containers Run the command on both Click Execute. The system uses the admin account to log on to instances and run the command.
View execution results
After you click Execute, a confirmation dialog box appears. Click OK to proceed.
The console generates the Execution Result tab with the following details for each ECS or Dockerized instance:
| Column | Description |
|---|---|
| Application Type | The type of application deployed on the instance |
| IP Address | The IP address of the instance |
| VPC ID | The VPC that the instance belongs to |
| Status | Whether the command succeeded or failed |
The execution details section shows the detailed command running processes on instances. If a command fails, the error message indicating the cause is included in the output.
View operation records
The Execution Records section at the bottom of the page logs all past batch operations. Each record includes the following details:
| Field | Description |
|---|---|
| Operator | The account that ran the command |
| Creation time | When the batch operation was created |
| End time | When the batch operation finished |
| Executed command | The command that was run |
| Status | The execution result |
Record visibility by account type
| Account type | Visible records |
|---|---|
| Alibaba Cloud account | All batch operations run by this account and its RAM users |
| RAM user | Only batch operations run by this RAM user |
Records are sorted by time in descending order (newest first). You can also sort by operator name, creation time, or end time.
To view the full details of a past operation, click View in the Details column.