Help Center> MapReduce Service> User Guide> Configuring a Cluster> Adding a Tag to a Cluster/Node
Updated on 2024-01-17 GMT+08:00

Adding a Tag to a Cluster/Node

Tags are used to identify clusters/nodes. Adding tags to clusters/nodes can help you identify and manage your resources.

  • Cluster tags: You can add up to 10 tags to a cluster during cluster creation or add them on the details page of a created cluster. Updating a cluster tag will synchronize the tag to all nodes in the cluster.
  • Node tags: You can use the default tag or add tags to nodes in an MRS cluster when you configure an auto scaling policy. Node tags take the tag quotas. You can view the tags of a node in the Nodes tab on MRS console.
  • Default tags: An MRS cluster contains multiple nodes, and each node is an ECS and contains EVS disks. After the default tag is enabled, the system automatically creates a cluster tag and a tag for each node. The default tag is automatically synchronized to the corresponding ECS or EVS instances.

    To view node tags, go to the Nodes tab on the MRS console, and move the cursor to the tag icon of a node in the node list.

    • MRS tag updates are synchronized to the ECSs or EVS disks in the cluster. However, if you modify MRS cluster tags on the ECS or EVS console, the modification will not be synchronized to MRS. To ensure tag consistency, do not modify MRS cluster tags on the ECS or EVS console.
    • You can add a maximum of 10 tags to a cluster. If the number of tags of a node in the cluster reaches the upper limit, no more tags can be added to the cluster.
    • If default tags are enabled, a default tag is added to the cluster and each node, which takes two quotas. That is, a maximum of 10 tags can be added by default. In this case, a maximum of eight more tags can still be added.

If your organization has configured tag strategies for MRS, add tags to clusters/nodes based on the strategies. If a tag does not comply with the tag strategies, the cluster/node may be failed to be created. Contact the organization administrator to learn more about the tag strategies.

A tag consists of a tag key and a tag value. Table 1 provides tag key and value requirements.

Table 1 Tag key and value requirements

Parameter

Requirement

Example

Key

A tag key cannot be left blank.

A tag key must be unique in a cluster.

A tag key contains a maximum of 36 characters.

A tag value cannot contain special characters (=*<>\,|/) or start or end with spaces.

Organization

Value

A tag value contains a maximum of 43 characters.

A tag value cannot contain special characters (=*<>\,|/) or start or end with spaces. This parameter can be left blank.

Apache

Adding Tags to a Cluster

  • Adding cluster tags during cluster creation
    1. Log in to the MRS console.
    2. Click Buy Cluster. The page for buying a cluster is displayed.
    3. Click the Custom Config tab.
    4. Configure the cluster software and hardware by referring to Buying a Custom Cluster.
    5. Select Configure on the right of Set Advanced Options and enter the key and value of a new tag.
      Figure 1 Adding a tag to a cluster
  • Adding tags to an existing cluster
    1. Log in to the MRS management console.
    2. In the navigation pane on the left, choose Clusters > Active Clusters. Click the name of a running cluster. The basic information page of the cluster is displayed.
    3. Click the Tags tab.
    4. Click Add/Edit Tag. If this is your first time adding a tag, click Add Tag. In the displayed dialog box, enter the key and value of a tag, and click Add.

      You can also add cluster tags by enabling default tags. All nodes will be tagged with the cluster ID and node IDs, which takes two quotas.

    5. Click OK.

Adding Tags to a Node

  • Node tags are automatically added when a default tag is added to a cluster. For details, see Adding tags to an existing cluster.
  • Adding node tags for auto scaling

    If you add a tag when configuring an auto scaling policy, MRS automatically adds the tag to the new nodes and synchronizes the tag to the ECSs and EVS disks.

    1. Log in to the MRS management console.
    2. In the navigation pane on the left, choose Clusters > Active Clusters. Click the name of a running cluster. The basic information page of the cluster is displayed.
    3. On the page that is displayed, click the Auto Scaling tab.
    4. Click Edit on the right of an existing auto scaling policy. In the displayed dialog box, enter the key and value of the tag you want to add, and click Add.

      • You need to enable the auto scaling policy and configure scale-out rules. Otherwise, the node tags will not take effect.
      • If tag quotas are insufficient, delete the cluster tag or modify existing a tag of the auto scaling policy, and then enable the policy.
      • Tags cannot be added to auto scaling policies of resource pools.
    5. Click OK.

Searching for Target Clusters by Tags

On the Active Clusters page, search for the target cluster by tag key or tag value.
  1. Log in to the MRS console.
  2. In the upper right corner of the Active Clusters page, click Search by Tag to access the search page.
  3. Enter the tag of the cluster to be searched.

    You can select a tag key or tag value from their drop-down lists. When the tag key or tag value is exactly matched, the system can automatically locate the target cluster. If you enter multiple tags, their intersections are used to search for the cluster.

  4. Click Search.

    The system searches for the target cluster by tag key or value.

Managing Tags

You can view, add, and delete tags on the Tags tab page of the cluster.
  1. Log in to the MRS console.
  2. On the Active Clusters page, click the name of a cluster for which you want to manage tags.

    The cluster details page is displayed.

  3. Click the Tags tab and view, add, and delete tags on the tab page.
    • View

      On the Tags tab page, you can view details about tags of the cluster, including the number of tags and the key and value of each tag.

    • Add

      Click Add/Edit Tag in the upper left corner. In the displayed Add/Edit Tag dialog box, enter the key and value of the tag to be added, and click OK.

    • Delete

      Locate the row that contains the tag you want to delete and click Delete in the Operation column. In the displayed Delete Tag dialog box, enter DELETE, and click Yes.