Help Center/ GaussDB/ User Guide/ Instance Modifications/ Scaling In and Out an Instance/ Overview of Scaling In and Out an Instance
Updated on 2024-11-11 GMT+08:00

Overview of Scaling In and Out an Instance

After you purchase a GaussDB instance, resource requirements may change with service changes. In this scenario, GaussDB distributed instances that are independently deployed can be scaled in or out. Users can adjust resources as required. Currently, instances can be scaled in or out in the following ways:

Adding CNs for an Instance

Instances can be scaled out by adding CNs. For example, if the original instance is configured with 1 CN, 3 replicas, and 1 shard, the instance will have 3 CNs, 3 replicas, and 1 shard after 2 CNs is added. For details, see Adding Coordinator Nodes for an Instance (Distributed).

Figure 1 Adding CNs for an instance

Adding Shards for an Instance

Instances can be scaled out by adding shards. For example, if the original instance is configured with 3 CNs, 3 replicas, and 1 shard, the instance will have 3 CNs, 3 replicas, and 3 shards after 2 shards is added. For details, see Adding Shards for an Instance (Distributed).

Figure 2 Adding shards for an instance

Deleting CNs for an Instance

Instances can be scaled in by deleting CNs. For example, if the original instance is configured with 3 CNs, 3 replicas, and 3 shards, the instance will have 2 CNs, 3 replicas, and 3 shards after 1 CN is deleted. For details, see Deleting Coordinator Nodes for an Instance (Distributed).

Figure 3 Deleting CNs for an instance

Main processes are running on the main CN (that is, the CN whose component ID is cn_5001), so this CN cannot be deleted for scale-in. You can call the Querying the Components of a DB Instance API to query cn_5001. To scale in the instance, another CN will be deleted. In the example shown in Figure 4, the CN whose component ID is cn_5003 is deleted instead.

Figure 4 Deleting CNs for an instance

Deleting Shards for an Instance

Instances can be scaled in by deleting shards. For example, if the original instance is configured with 2 CNs, 3 replicas, and 3 shards, the instance will have 2 CNs, 3 replicas, and 2 shards after 1 shard is deleted. For details, see Deleting Shards for an Instance (Distributed).

Figure 5 Deleting shards for an instance