Tags are used to label clusters. You can use tags to identify and manage your cluster resources. You can add tags when you create a cluster. You can also add tags on the Cluster Overview page of a created cluster. You can add up to 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

An E-MapReduce (EMR) cluster contains multiple Elastic Compute Service (ECS) instances. When you create an EMR cluster, two system tags are automatically added to each ECS instance in the cluster. To identify the cluster to which an ECS instance belongs and to identify the role of the ECS instance in the cluster, perform the following steps: Log on to the Alibaba Cloud ECS console and move the pointer over the tag icon of an ECS instance on the Instances page. View system tags
For example, an ECS instance has the following system tags:
  • acs:emr:clusterId=c-59efc7546480****
  • acs:emr:nodeGroupType=CORE
In this example, the ECS instance is a core node of an EMR cluster whose ID is c-59efc7546480****.

Precautions

  • If you update the tags of an EMR cluster, the tags of the ECS instances in the cluster are also updated in the ECS console.
  • If you update the tags of ECS instances in the ECS console, the tags of the EMR cluster to which the ECS instances belong are not updated. To make sure that the tags of ECS instances are consistent with the tags of the EMR cluster, we recommend that you do not update 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 that are created in the China (Hangzhou) region are invisible in the China (Shanghai) region.

  • You can add up to 20 tags to a cluster. If the number of tags that are added to a cluster exceeds the upper limit, you must remove some of the tags before you add new tags.

Add a new tag or an existing tag when you create a cluster

The following content describes how to add a new tag or an existing tag when you create a cluster.

  1. Log on to the EMR on ECS 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 Create Cluster. In the Advanced Settings section of the Basic Configuration step, find Tags and click + Add Tag.
    For more information about how to create a cluster, see Create a cluster.
  4. Select the key-value pair of an existing tag or add the key-value pair of a new tag.
    If you select an existing key-value pair, it indicates that you want to add an existing tag. If you enter a new key-value pair, it indicates that you want to create a tag and add it.
    Note Each tag consists of a key-value pair. Tag keys and tag values have the following limits:
    • A tag key cannot be empty and can be up to 128 characters in length. A tag value can be empty and can be up to 128 characters in length.
    • 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.

Manage the tags of an existing cluster

This section describes how to create tags for and bind tags to or unbind tags from an existing cluster.

  1. Log on to the EMR on ECS 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. Find the cluster for which you want to manage the tags, click the label icon, and click Edit Tag.
  4. In the Edit Tag dialog box, manage the tags for the cluster.
    • Add a new tag.
      1. Click Add New Tag in the upper part of the dialog box.
      2. Specify Key and Value, and click OK.
      3. Click OK.
    • Add an existing tag.
      1. Click Add Existing Tag in the upper part of the dialog box.
      2. Select an existing tag key and the tag value.
      3. Click OK.
    • Remove a tag.
      Click the Delete 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.

Use tags to search for clusters

This section describes how to search for clusters by key-value pairs of tags on the EMR on ECS page.

  1. Log on to the EMR on ECS 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. Select a key-value pair from the Search by tag drop-down list.
    All the clusters that meet the search condition are displayed.
    Note If you do not select a tag value, all clusters to which the tag key is added are displayed.