Tags are used to label clusters. You can use tags to identify and manage your cluster resources. You can add tags during the creation of a cluster or on the Cluster Overview page of a created cluster. You can add a maximum of 20 tags to a single cluster. This topic describes how to add, remove, and view tags and how to use tags to search for clusters.

Background information

When you create an EMR cluster, two system tags are automatically added to each Elastic Compute Service (ECS) instance of the cluster. You can perform the following operations to identify the cluster to which an ECS instance belongs and the role of the ECS instance in the cluster: Log on to the Alibaba Cloud ECS console. Click Tags in the left-side navigation pane. On the Tags page, click System Tags in the left-side navigation pane on the Tags tab.

For example, an ECS instance has the following system tags:
  • acs:emr:clusterId=C-A510C93EA117****
  • acs:emr:hostGroupType=CORE
In this example, the ECS instance is a core node of an EMR cluster whose ID is C-A510C93EA117****.

Precautions

  • The tags of ECS instances are also updated in the ECS console if you update E-MapReduce (EMR) cluster tags.
  • EMR cluster tags are not updated if you update the tags of ECS instances in the ECS console. To ensure the consistency between the tags for ECS instances and EMR clusters, we recommend that you do not modify the tags of ECS instances in the ECS console. If the number of tags of an ECS instance in a cluster reaches the upper limit, you can no longer create tags for the cluster.
  • Tag information is not shared across regions.

    For example, tags created in the China (Hangzhou) region are not visible to the China (Shanghai) region.

Add a new or existing tag when you create a cluster

  1. Log on to the Alibaba Cloud EMR console.
  2. In the top navigation bar, select the region where your cluster resides and select a resource group based on your business requirements.
  3. Click Cluster Wizard in the Clusters section. In the Advanced Settings section of the Basic Settings step, click + Add on the right side of Tag.
    For more information about how to create a cluster, see Create a cluster.
  4. In the Create/Bind Tag dialog box, select an existing tag key or enter a new one for Tag Key. Tag Value is optional. You can select an existing tag value or enter a new value.
    Create/Bind Tag
    Note If you select an existing tag key, it indicates that you want to add an existing tag. If you enter a new tag key, it indicates that you want to create a tag and add it.
    Limits on tag keys and tag values:
    • Each tag consists of a key-value pair.
    • A tag key cannot be empty and can contain a maximum of 128 characters. A tag value can be empty and can contain a maximum of 128 characters.
    • Tag keys and tag values cannot start with aliyun or acs: and cannot contain http:// or https://.
    • A tag key must be unique in a cluster. For example, the city/shanghai tag is added to a cluster. If the city/newyork tag is then added to the cluster, the city/shanghai tag is automatically removed.
  5. Click Confirm.
    Confirm the tag to be added.
  6. Click Confirm.
    The tag is added.

Use tags to search for clusters

On the Cluster Management page, search for a cluster by using a tag key or tag value.

  1. Go to the Cluster Management page.
    1. Log on to the Alibaba Cloud EMR console.
    2. In the top navigation bar, select the region where your cluster resides and select a resource group based on your business requirements.
    3. Click the Cluster Management tab.
  2. On the Cluster Management page, click Tag and select a tag key.
    If you do not select a tag value, all clusters to which the tag key is added are displayed.
  3. Click Search next to Tag.
    All the clusters that meet the search condition are displayed.

Manage the tags of an existing cluster

You can add, remove, or view the tags of an existing cluster.

  1. Go to the Cluster Overview page of your cluster.
    1. Log on to the Alibaba Cloud EMR console.
    2. In the top navigation bar, select the region where your cluster resides and select a resource group based on your business requirements.
    3. Click the Cluster Management tab.
    4. Find the cluster whose tags you want to manage and click Details in the Actions column.
  2. On the Cluster Overview page, click Edit Tag in the Cluster Info section.
  3. In the Edit Tag dialog box, perform the following operations:
    • Add a new tag.
      1. Click Add Tag in the lower-left corner.
      2. In the Edit Tag dialog box, specify Tag Key and Tag Value.
      3. Click Confirm.
      4. Click Confirm.
    • Add an existing tag.
      1. Click Existing Tags in the lower-left corner.
      2. Select an existing tag key and the tag value that matches.
      3. Click Confirm.
    • Remove a tag.
      Click the Remove icon next to a tag to remove this tag.
      Note After you remove a tag from a cluster, the system automatically deletes the tag if the tag is not added to other clusters.