Cluster Scripts

Last updated: 2023-12-21 16:14:37

Feature Description

The cluster script feature facilitates the execution of specified scripts on multiple nodes simultaneously, thereby enhancing the efficiency of batch operations. At any given time, only one cluster script can be run within a cluster. If a cluster script is currently in operation, the execution of a new cluster script cannot be initiated. This feature is particularly useful for tasks such as the installation of third-party software and modification of the cluster operating environment.
Note
The execution of script files currently only supports the selection of cross-regional files from Cloud Object Storage (COS).
The selection of execution nodes is limited to those within the current cluster and does not extend to nodes across different clusters.
Custom parameters can be configured based on specific business requirements.
The Elastic MapReduce console does not perform any validation on the execution scripts. The operation of executing custom scripts is considered high-risk, hence it should be undertaken with utmost caution.

Preparations

Only clusters in the running state can utilize the cluster script function.
The execution script must be in the standard storage format of Object Storage Service (COS) and only shell script files are supported.
Prior authorization for EMR to access COS is required to utilize the cluster script function.

Instructions

1. Log in to the EMR Console. In the cluster list, click on the corresponding cluster ID. After entering the instance information, select Cluster Scripts > Set Task.
1a361319fc4a2f500c03d4506dd0281e.png


2. When setting up a task, you need to specify the task name, select the script file to be executed, choose the execution node, and customize parameters. After the task configuration is complete, click on Run to generate the task in the task list.
5f9805e96432d2997c04fe3fb09458e7.png


3. Tasks generated in the task list, depending on the execution status, may be entirely successful, entirely failed, or partially failed. You can click on Details for further information.
9b1425a37ce28e469490943f88a476e8.png


See below:

af3c17449632829bf34373ec4414be09.png


4. Cluster scripts may run successfully on some nodes and fail on others. You can replicate the failed nodes en masse for another attempt.