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
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.
-
On the Instance Details page, go to the Configurations section. In the row for Compute Engine, click Resource Groups in the Actions column.
-
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 is100000.ImportantExceeding the quota immediately terminates jobs. For resource groups that require high stability, you can set this parameter to
0for 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.
NoteWhen you configure the property
MAX_MEM, useGas 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
defaultis automatically created. -
For the
defaultresource group, you can only modify its properties. You cannot delete or restart it.
-
-
-
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 |
|
When you configure a job, add the parameter to the Spark system parameters (configs) in the Job configuration section. Syntax: |
|
|
When you publish a recurring job, add the parameter to the Spark system parameters (conf). Syntax: |
|
|
Add the parameter to the JDBC connection URL (endpoint) of Lindorm Compute Engine to specify a compute resource group. Syntax: |
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.
-
To use an OLAP resource group, your Lindorm Wide Table must be version 2.6.5 or later. To view or upgrade your Lindorm Wide Table version, see Lindorm Wide Table version release notes and Upgrade the minor version of an instance.
-
OLAP resource groups currently support only read queries. Data write operations are not supported.
Lindorm-cli
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
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
Mac (Intel chip)
Mac (Arm chip)
Windows
Linux-arm64
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.gzThe executable file
lindorm-cli.exeis located in thelindorm-cli-linux-latestdirectory.
Step 2: Connect to wide table
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.
NoteIf you do not include the
_columnar_index_HINT, the query reads from and writes to Lindorm Wide Table by default.Example
Use the
testresource group of the Lindorm Compute Engine to query a table namedsearch_tablein thesearchindex_dbdatabase 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.
-
On the Instance Details page, go to the Configurations section. In the row for Compute Engine, click Resource Groups in the Actions column.
-
Hover over the name of the OLAP resource group to view its VPC endpoint, and then copy the endpoint.
-
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_=trueandcompute-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:olapcg1Avatica
jdbc:lindorm:table:url=http://ld-bp17j28j2y7pm****-proxy-lindorm-pub.lindorm.rds.aliyuncs.com:30060;_use_ldps_=true;compute-group=olapcg1