After you divide the computing resources of a cluster into resource groups, you can manage the resource groups and better utilize the computing resources. This topic describes how to create and modify resource groups and bind users to or unbind users from resource groups.

Background information

You can divide the computing resources of an elastic cluster into multiple resource groups and bind different users to each resource group to implement isolation. This way, you can schedule computing tasks based on priorities to protect core business from being affected by complex computing and emergencies. You can also classify queries and allocate resources to maximize cluster performance. For more information, see Resource pool overview.

For example, User A and User B need to perform simple queries, and User C needs to perform complex queries and analysis on large amounts of data. In this case, you can bind User A and User B to the resource group named source_a whose query type is Interactive, and bind User C to the resource group named source_b whose query type is Batch. This way, when User C performs large-scale computing and queries, the performance of simple queries is unaffected.

Create a resource group

  1. Log on to the AnalyticDB for MySQL console.
  2. In the upper-left corner of the page, select the region where the cluster resides.
  3. In the left-side navigation pane, click Clusters.
  4. On the Data Warehouse Edition (V3.0) tab, find the cluster and click its Cluster ID.
  5. In the left-side navigation pane, click Resource Groups.
  6. On the Resource Groups page, click Create Resource Group in the upper-right corner.
  7. Configure the resource group.
    Parameter Description
    Resource Group Name The name of the resource group. The name must be 2 to 30 characters in length and can contain only letters, digits, and underscores (_). The name must start with a letter.
    Query Type The type of SQL queries used in the resource group. For more information, see Query execution types. Default value: Default_Type. Valid values:
    • Default_Type.
    • Batch: the batch query type. This type is ideal for complex queries on a large amount of data, such as extract, transform, and load (ETL) queries. Intermediate query results can be written to disks. If you query large amounts of data, the query performance is degraded, but the computing nodes do not fail.
    • Interactive: the interactive query type. This type is ideal for real-time queries that require low latency. The quick interactive query type is based only on memory, which delivers high query performance. However, if the data amount exceeds the processing capacity of the server, the queries may fail.
    Resources The amount of resources allocated to the resource group.
  8. Click OK to create the resource group.

Modify a resource group

After you create a resource group, you can modify its query type and amount of resources.
Note For the default resource group, only the query type can be modified. The amount of resources in the default resource group cannot be modified. The amount of resources in the default resource group is calculated based on the following formula: Amount of resources in the default resource group = Total amount of resources in a cluster - Amount of resources occupied by other resource groups in the cluster.
  1. On the Resource Groups page, find the resource group that you want to modify and click Modify in the Actions column.
  2. Modify the Query Type or Resources parameter.
  3. Click OK.

Bind or unbind a user

You can bind different users to different resource groups to meet multi-tenancy and hybrid load requirements within clusters. For more information, see Binding between users and resource pools.

Note A resource group can be bound to multiple users. Each user can be bound to only one resource group.
  1. On the Resource Groups page, find the resource group to which you want to bind a user and click Bind User in the Actions column.
  2. On the Bind User page, select a user that you want to bind from the Username drop-down list and click Bind User. In the Bind User message, click OK.
  3. To bind more users, repeat Step 2.
  4. To unbind a user, click Unbind in the Actions column corresponding to the user in the username list. In the Unbind User message, click OK.

Related SQL statements