All Products
Search
Document Center

E-MapReduce:Scale out or scale in a StarRocks cluster

Last Updated:Feb 21, 2024

When you use an E-MapReduce (EMR) StarRocks cluster, you can flexibly increase or decrease the number of backend (BE) nodes in the cluster based on dynamic changes in business loads and performance requirements. This helps you optimize resource allocation and improve running efficiency of the system. This topic describes how to scale out or scale in a StarRocks cluster by adding or removing BE nodes.

Prerequisites

A StarRocks cluster is created. For more information, see Create a StarRocks cluster.

Scale out a StarRocks cluster

  1. Go to the Nodes tab.

    1. Log on to the EMR console. In the left-side navigation pane, click EMR on ECS.

    2. In the top navigation bar, select the region in which your cluster resides and select a resource group based on your business requirements.

    3. On the EMR on ECS page, find the desired cluster and click Nodes in the Actions column.

  2. On the Nodes tab, find the desired node group and click Scale Out in the Actions column.

  3. In the Scale Out dialog box, modify the parameters based on your business requirements and click OK.

  4. Check the scale-out result.

    1. Log on to your cluster and use a client to access the cluster. For more information, see Getting started.

    2. Run the following command to check the scale-out result:

      show backends;

      If the cluster is of EMR V5.9.1 or an earlier minor version, the added BE nodes may not be returned after you run the show backends; command. In this case, you can run the following command on the MySQL client to view the added BE nodes:

      ALTER SYSTEM ADD backend 'be_ip:heartbeat_service_port';

      Configure the following parameters based on your business requirements:

      • be_ip: Set the value to the internal IP address of the added BE node. You can obtain the internal IP address on the Nodes tab.

      • be_heartbeat_service_port: Set the value to the heartbeat service port of other BE nodes. You can obtain the heartbeat service port from the show backends; command output.

Scale in a StarRocks cluster

  1. Log on to your cluster and use a client to access the cluster. For more information, see Getting started.

  2. Run the following command to remove a BE node:

    ALTER SYSTEM DECOMMISSION backend "be_ip:be_heartbeat_service_port";

    Configure the following parameters based on your business requirements:

    • be_ip: Set the value to the internal IP address of the BE node to be removed. You can obtain the internal IP address on the Nodes tab.

    • be_heartbeat_service_port: The default value is 9050. You can run the show backends; command to view the heartbeat service port of the BE to be removed.

    If it takes an extended period of time to remove the BE node, you can run the DROP command to forcefully remove the BE node.

    Important

    If you run the DROP command to remove a BE node, make sure that three replicas of data are available in the system.

    ALTER SYSTEM DROP backend "be_ip:be_heartbeat_service_port";
  3. Run the following command to view the status of the BE node:

    show backends;

    Starrocks1

    If the value of the SystemDecommissioned parameter of the BE node is true, the BE is being removed. If the value of the TabletNum parameter of the BE node is 0, the system clears the metadata of the BE node.

    If the BE node is not displayed in the command output, the BE node is removed.

  4. Release the BE node.

    1. On the Nodes tab of the cluster in the EMR console, click the ID of the BE node that is removed.

      You are navigated to the Elasitc Compute Service (ECS) console.

    2. Release the node in the ECS console. For more information, see Release an instance.