Updated on 2024-10-21 GMT+08:00

Elastically Adding or Deleting a Logical Cluster

Context

Logical clusters can be manually added or deleted, and also have the ability to automatically expand or shrink as needed. Computing logical clusters can be created and deleted during the scheduled period of time to dynamically scale computing resources.

  • A custom scheduled scaling plan creates a logical cluster that provides computing power. Once such logical cluster is associated, user's queries are handled by it, while table creation statements are still managed by the original logical cluster. For instructions on how to configure a custom scheduled scaling plan, see Configuring a Custom Scheduled Scaling Plan.
    • A user can be bound to only one computing logical cluster.
    • If a user associated with the read-only logical cluster has workloads in progress when the cluster is deleted, an error may be reported.
  • An auto scaling plan creates a logical cluster that facilitates parallel expansion. Once such logical cluster is associated with the primary logical cluster, specific queries from the primary logical cluster are routed to the logical cluster, but table creation statements are still executed in the original logical cluster. For how to configure an auto scaling plan, see Configuring an Auto Scaling Plan.

    To reduce statement queuing time, use parallel expansion. When the primary cluster is overwhelmed by high-concurrency tasks and lacks resources like memory, GaussDB(DWS) will automatically add extra cluster capacity to process the increased read and write statements. The performance and data consistency are consistent for users, regardless of whether the statement is executed on the primary cluster or the parallel extended cluster. You can set up a resource pool to control which statements are directed to a parallel extended cluster. When parallel expansion is enabled, qualifying statements are directed to the concurrent expansion cluster instead of being queued. Here are the limitations of the parallel expansion feature:

    • Only V3 and foreign tables are supported.
    • Only SELECT, INSERT, UPDATE, and DELETE statements are supported.
    • COPY cannot be used to import data.
    • The UPSERT statement is not supported.
    • Transaction blocks are not supported.
    • Stored procedures are not supported.
    • Recursive statements with the RETURNING clause and WITH RECURSIVE are not supported.
    • Lightweight update is not supported.
    • INSERT statements generated by a single VALUES or generate_series are not supported.
    • Table copy is not allowed.
  • You can manually add or delete plans for DWS 3.0 clusters. For earlier versions, contact technical support to upgrade them.
  • Only DWS 3.0 clusters and ECS clusters of 9.1.0 and later versions support auto elastic addition and deletion.
  • In a yearly/monthly DWS 3.0 cluster, nodes are automatically added when logical clusters are added as scheduled. Nodes are billed on a pay-per-use basis.

Configuring a Custom Scheduled Scaling Plan

  1. Log in to the GaussDB(DWS) console. In the navigation pane, choose Clusters > Dedicated Clusters.
  2. In the cluster list, click the name of the target cluster. The Cluster Information page is displayed.
  3. After DWS 3.0 clusters are created, they are in logical cluster mode.

    • DWS 3.0 cluster: In the navigation pane on the left, click Logical Clusters. On the displayed page, click Add Plan to configure a proper scheduling plan.

  4. Select a plan type. It can be:

    • Periodicity: The plan is executed once in every specified period (week or month). A logical cluster is created or deleted as scheduled as long as it does not conflict with other O&M operations. You can set the weekly time intervals for creating or deleting logical clusters.
      Figure 1 Setting Plan Type to Periodicity
    • One-time: The plan is executed only once in the specified period.
      Figure 2 Selecting One-time

  5. Click OK. In the scheduled plan list, you can view the plan details and next execution time.

    To avoid affecting services and ensure resources are available at the scheduled time, the plan may be skipped if it conflict with O&M operations, and may be executed about 20 minutes earlier than planned if the cluster creation is time-consuming.

Configuring an Auto Scaling Plan

  1. Log in to the GaussDB(DWS) console. In the navigation pane on the left, choose Clusters > Dedicated Clusters.
  2. In the cluster list, click the name of the target cluster. The Cluster Information page is displayed.
  3. Click Logical Clusters on the left to access the page for cluster management. Because once you have created a DWS 3.0 cluster, it will be in logical cluster mode.
  4. Click Auto Resiliency Switch to enable the auto scaling function for logical clusters.

    Enabling this function allows the system to efficiently manage node resources by detecting service demand and creating or deleting read-only elastic logical clusters as needed. This means that unused nodes are free of charge and the system can adapt to peak and off-peak hours seamlessly.

    Figure 3 Enabling auto scaling for logical clusters

  5. After auto scaling is enabled, run SQL statements after completing the operation described in Using the SQL Editor to Connect to a Cluster to create and set a resource pool, and bind a user to the resource pool to enable auto scaling for the specified resource pool.

    1
    2
    3
    4
    create resource pool poolg with(nodegroup = 'v3_logical');
    alter resource pool poolg with(active_statements=600);
    alter user "write_user" with resource pool "poolg";
    alter resource pool xxx  with (enable_concurrency_scaling=true);
    
    Figure 4 Setting a resource pool