Manage compute resource groups

更新时间:
复制 MD 格式

When you need to efficiently manage resources for the Lindorm Compute Engine in Lindorm, this topic guides you on how to create and configure compute resource groups to implement resource isolation, optimize resource allocation, and ensure that jobs run with the expected performance.

Prerequisites

The Lindorm Compute Engine must be activated. For more information, see Activate Lindorm Compute Engine.

Create and manage resource groups

  1. Log on to the Lindorm console. In the upper-left corner of the page, select the region of the instance. On the Instances page, click the ID of the target instance or click View Instance Details in the Actions column for the instance.

  2. On the Instance Details page, go to the Configurations section. In the row for Compute Engine, click Resource Groups in the Actions column.

  3. On the Resource Group Details page, click Create Resource Group and configure the following parameters:

    • Resource Group Name: The name of the resource group. The name can contain only lowercase letters and digits and must be no more than 63 characters in length. For example, cg0.

    • Resource Group Type: The supported types are ETL resource group and OLAP resource group.

    • Other configuration items:

      ETL resource group

      An ETL resource group is designed for production workloads in data lake or data warehouse environments. It provides high-throughput computing capabilities for large datasets and features an elastic computing resource pool that scales on demand.

      Parameter

      Description

      Example

      Daily Resource Quota (DAILY_QUOTA)

      The maximum number of capacity units (CUs) that the resource group can consume per day. The unit is CU*Hour. The default value is 100000.

      Important

      Exceeding the quota immediately terminates jobs. For resource groups that require high stability, you can set this parameter to 0 for no limit.

      {
        "MAX_CPU": "2000",
        "MAX_MEM": "16000G"
      }

      The maximum number of CPU cores in the resource group. (MAX_CPU)

      The maximum number of CPU cores for the resource group. Valid values: [100, 100000].

      The maximum memory size in the resource group. Unit: GB. (MAX_MEM)

      The maximum memory size for the resource group, in GB. Valid values: [400G, 1000000G]. No default value is provided.

      Note

      When you configure the property MAX_MEM, use G as the unit. For example, 16000G.

      Authorize Users

      The access permissions for the resource group. The default value is *, which allows all users to access the resource group.

      OLAP resource group

      An OLAP resource group is optimized for analytical queries. It is ideal for low-latency queries on datasets smaller than 100 GB and can handle high concurrency.

      Parameter

      Description

      Node Specifications

      Select a node type.

      Working Nodes in Job (WORKERS)

      The number of worker nodes for a job. Each node has 8 vCPUs and 64 GB of memory. Valid values: [4, 1024]. The default value is 4.

      Example:

      {
        "WORKERS": "4"
      }
      Note
      • After you activate the Lindorm Compute Engine, a default ETL resource group named default is automatically created.

      • For the default resource group, you can only modify its properties. You cannot delete or restart it.

  4. On the Resource Group Details page, you can Edit, Delete, or Restart a resource group that you created.

Using resource groups

The following sections describe how to use ETL and OLAP resource groups.

Using an ETL resource group

To use an ETL resource group, specify its name in the compute-group parameter. The configuration method depends on your access method.

Access method

Configuration

Connect to Lindorm Compute Engine by using DMS

When you configure a job, add the parameter to the Spark system parameters (configs) in the Job configuration section. Syntax: "compute-group":"<compute_group_name>".

Connect to Lindorm Compute Engine by using DataWorks

When you publish a recurring job, add the parameter to the Spark system parameters (conf). Syntax: "compute-group":"<compute_group_name>".

Connect to Lindorm Compute Engine by using HiveJDBC

Add the parameter to the JDBC connection URL (endpoint) of Lindorm Compute Engine to specify a compute resource group. Syntax: compute-group=<compute_group_name>.

Using an OLAP resource group

You can connect to and use an OLAP resource group through Lindorm-cli or a JDBC connection. The following sections describe how to configure parameters for an OLAP resource group.

Important

Lindorm-cli

Note

Before you use Lindorm-cli to access the Lindorm Compute Engine, make sure that a Java environment with JDK 1.8 or later is installed.

Step 1: Install Lindorm-cli

  1. Download a Lindorm-cli client package based on the operating system of your client. The following table provides the download links of Lindorm-cli client packages for different operating systems.

    Operating system

    Download link

    Linux

    lindorm-cli for linux

    Mac (Intel chip)

    lindorm-cli for mac

    Mac (Arm chip)

    lindorm-cli for mac

    Windows

    lindorm-cli for windows-x64

    Linux-arm64

    lindorm-cli for linux-arm64

  2. Decompress the installation package of Lindorm-cli.

    Run the following command to decompress the downloaded Lindorm-cli client package.

    tar zxvf lindorm-cli-linux-latest.tar.gz

    The executable file lindorm-cli.exe is located in the lindorm-cli-linux-latest directory.

Step 2: Connect to wide table

Client deployed on Linux or macOS

  1. Run the following command to go to the path in which Lindorm-cli.exe is located:

    cd <Path of Lindorm-cli.exe>
  2. Run the following command to connect to Lindorm Wide Table:

    ./lindorm-cli -url <jdbc_url> -username <username> -password <password>

    Parameter description

    Parameter

    Example

    Method used to obtain the parameter value

    mysql url

    ld-bp187uwcx5f40****-proxy-lindorm-vpc.lindorm.aliyuncs.com:33060

    The LindormTable endpoint for MySQL. For more information about how to obtain the endpoint, see Connect to LindormTable. For more information about connection configurations, see Connection settings.

    Username

    user

    The username and password that are used to access LindormTable. If you forget your password, you can go to the cluster management system of LindormTable to reset the password. For more information, see Change the password of a user.

    Important

    After you reset your password, you must restart LindormTable in the Lindorm console.

    Password

    test

    To specify an OLAP resource group during connection, append ?_use_ldps_=true&compute-group=<OLAP_resource_group_name> to the JDBC URL and enclose the entire URL parameter in double quotation marks (""). Example:

    ./lindorm-cli -url "jdbc:lindorm:table:url=http://ld-bp12pt80qr38p****-proxy-lindorm-pub.lindorm.rds.aliyuncs.com:30060?_use_ldps_=true&compute-group=test" -username r*** -password t***

    A successful connection returns the following output:

    Connected to jdbc:lindorm:table:url=http://ld-bp17j28j2y7pm****-proxy-lindorm-pub.lindorm.rds.aliyuncs.com:30060
    lindorm-cli version: 1.0.xx

    In the output, 1.0.xx is the version number of Lindorm-cli.

Client deployed on Windows

  1. Run the following command in the command prompt to go to the path in which lindorm-cli.exe is located:

    cd <Path of lindorm-cli.exe>
  2. Run the following command in CMD to connect to Lindorm Wide Table:

    lindorm-cli -url <jdbc_url> -username <username> -password <password>

    Parameter description

    Parameter

    Example

    Source

    jdbc_url

    ld-bp187uwcx5f40****-proxy-lindorm-vpc.lindorm.aliyuncs.com:33060

    The MySQL-compatible address of Lindorm Wide Table. To find this address, see Connect to a Lindorm instance. For connection settings, see Connection configuration instructions.

    username

    user

    If you forget your username or password, you can change the password in the cluster management system of Lindorm Wide Table. For more information, see Change the password of a database account.

    Important

    After you change the password, restart the engine in the console.

    password

    test

    To specify an OLAP resource group during connection, append ?_use_ldps_=true&compute-group=<OLAP_resource_group_name> to the JDBC URL and enclose the entire URL parameter in double quotation marks (""). Example:

    ./lindorm-cli -url "jdbc:lindorm:table:url=http://ld-bp12pt80qr38p****-proxy-lindorm-pub.lindorm.rds.aliyuncs.com:30060?_use_ldps_=true&compute-group=test" -username r*** -password t***

    A successful connection returns the following output:

    Connected to jdbc:lindorm:table:url=http://ld-bp17j28j2y7pm****-proxy-lindorm-pub.lindorm.rds.aliyuncs.com:30060
    lindorm-cli version: 1.0.xx

    In the output, 1.0.xx is the version number of Lindorm-cli.

Step 3: Use OLAP resource group

How you use the OLAP resource group depends on whether you specified it in your connection URL. If the URL includes the ?_use_ldps_=true&compute-group=<OLAP_resource_group_name> parameter, all queries use that resource group. If not, you must specify the resource group in each query by using a HINT.

  • If an OLAP resource group is specified

    SELECT * FROM <CatalogName>.<TargetDatabaseName>.<TargetTableName>;
    Note
    • For information about supported catalogs, see Usage notes.

    • If you use the default database default, you must add backticks ` around it when you query data by using Lindorm-cli. For example: SELECT * FROM lindorm_columnar.`default`.test_table;

  • If no OLAP resource group is specified

    To specify the OLAP resource group, add a HINT to your query statement. Example:

    SELECT /*+ _use_ldps_(<OLAP_resource_group_name>), _columnar_index_ */ * FROM <TargetDatabaseName>.<TargetTableName> LIMIT 50;

    Parameter description

    Hint name

    Hint option

    Description

    _use_ldps_

    resource group name

    Specifies that the query uses the Lindorm Compute Engine and indicates the name of the resource group to use.

    _columnar_index_

    None

    Specifies whether to use a columnar index.

    Note

    If you do not include the _columnar_index_ HINT, the query reads from and writes to Lindorm Wide Table by default.

    Example

    Use the test resource group of the Lindorm Compute Engine to query a table named search_table in the searchindex_db database of Lindorm Wide Table.

    SELECT /*+ _use_ldps_(test) */ * FROM searchindex_db.search_table LIMIT 50;

JDBC

  • Connect directly to an OLAP resource group

    An OLAP resource group provides a connection endpoint that is accessible from within a VPC. You can connect to the OLAP resource group directly over the MySQL protocol and run SQL queries.

    1. On the Instance Details page, go to the Configurations section. In the row for Compute Engine, click Resource Groups in the Actions column.

    2. Hover over the name of the OLAP resource group to view its VPC endpoint, and then copy the endpoint.

    3. When you create a JDBC connection, set the URL to the copied VPC endpoint. Log in by using the username and password for Lindorm Wide Table. You can then connect to the OLAP resource group over the MySQL protocol. For more information about JDBC application development, see Use the MySQL protocol (Recommended).

  • Connect to an OLAP resource group through Lindorm Wide Table

    To connect to an OLAP resource group, specify the parameters _use_ldps_=true and compute-group=<compute_group_name> in the Lindorm Wide Table connection URL. For more information about connecting to Lindorm Wide Table by using JDBC, see Develop SQL-based applications.

    Note: The method for specifying these parameters varies depending on the connection protocol you use.

    If the resource group is named olapcg1, the connection parameters are specified as follows:

    Connection protocol

    Example format

    MySQL

    jdbc:mysql://ld-bp17j28j2y7pm****-proxy-sql-lindorm-public.lindorm.rds.aliyuncs.com:33060/?connectionAttributes=_use_ldps_:true,compute-group:olapcg1

    Avatica

    jdbc:lindorm:table:url=http://ld-bp17j28j2y7pm****-proxy-lindorm-pub.lindorm.rds.aliyuncs.com:30060;_use_ldps_=true;compute-group=olapcg1