Creates a resource group in AnalyticDB for MySQL. A resource group is a collection of compute nodes that can be assigned a query execution mode and a node count.
Prerequisites
Before you begin, ensure that your cluster meets all of the following requirements:
Cluster edition: Data Warehouse Edition
Cluster mode: Elastic Mode Cluster Edition (New)
Cluster size: 32 or more cores
Kernel version: 3.1.3.2 or later
Database account: privileged account
To view and update the minor version of an AnalyticDB for MySQL cluster, log on to the AnalyticDB for MySQL console and go to the Configuration Information section on the Cluster Information page. For details, see Update the minor version of a cluster.
For information about creating a privileged database account, see Create a database account.
Syntax
CREATE RESOURCE GROUP resource_group_name
[QUERY_TYPE = {interactive | batch | default_type}]
[NODE_NUM = N]Naming rules:
The name cannot be
user_default, which is reserved for the default resource group.Names are case-insensitive. For example,
test_groupandTest_Grouprefer to the same resource group. The name is stored and displayed in uppercase —TEST_GROUP.
Parameters
| Parameter | Description | Default value |
|---|---|---|
QUERY_TYPE | The query execution mode. Valid values: interactive, batch, default_type. For more information, see Query execution modes. | default_type |
NODE_NUM | The number of compute nodes in the resource group. | 0 |
Examples
Create a resource group with one compute node:
CREATE RESOURCE GROUP 'BATCH_RG' NODE_NUM=1;Create a resource group with the batch query execution mode:
CREATE RESOURCE GROUP 'BATCH_RG' QUERY_TYPE=batch NODE_NUM=1;View all resource groups:
SELECT * FROM INFORMATION_SCHEMA.RESOURCE_GROUPS;