# 练习 6-1: 横向扩缩容 TiDB Cloud 集群

## 概述
+ 在本练习中,您将在 TiDB Cloud 上的 TiDB 集群中进行横向扩缩容。


## 注意事项:
+ 此任务仅适用于 `Dedicated Tier` 集群。

## 持续时间
+ 完成此练习大约需要 15 分钟。

## 任务
1. 单击右上角的下拉菜单,然后选择 `Modify`。
2. 在 `Modify Cluster` 窗口中,在 TiDB 集群中横向扩容或缩容。

## 解决方案步骤
(a) 扩容 TiDB Cloud 集群
1. 单击右上角的下拉菜单,然后选择 `Modify`。
<img src="./diagram/GoModify_aa_001_20230119.png" width="50%" align="top"/>

2. 在 `Modify Cluster` 窗口中,你可以增加 TiDB、TiKV 和 TiFlash 的节点数,然后点击 `Review`。
<img src="./diagram/ScaleOutCloudCluster01_aa_001_20230119.png" width="50%" align="top"/>

3. 在下一页面,查看您的修改,然后点击 `Confirm and Deploy`。
<img src="./diagram/ScaleOutCloudCluster02_aa_001_20230119.png" width="50%" align="top"/>

4. 等待 TiDB Cloud 集群扩容。
<img src="./diagram/ScalingCloudCluster_aa_001_20230119.png" width="50%" align="top"/>
<img src="./diagram/DedicatedTierAvailable_aa_001_20230110.png" width="50%" align="top"/>

(b) 缩容 TiDB Cloud 集群
1. 单击右上角的下拉菜单,然后选择 `Modify`。
<img src="./diagram/GoModify_aa_001_20230119.png" width="50%" align="top"/>

2. 在 `Modify Cluster` 窗口中, 你可以减少 TiDB、TiKV 和 TiFlash 的节点数,然后点击 `Review`。（如果你想降低 TiKV 或 TiFlash 的 `Node Quantity`,你需要提交支持请求,执行 [TiDB Cloud 支持](https://docs.pingcap.com/tidbcloud/tidb-cloud-support) 中的步骤。
<img src="./diagram/ScaleInCloudCluster01_aa_002_20230119.png" width="50%" align="top"/>

3. 在下一页上,查看您的修改,然后点击 `Confirm and Deploy`。
<img src="./diagram/ScaleInCloudCluster02_aa_002_20230119.png" width="50%" align="top"/>

4. 等待 TiDB Cloud 集群完成缩容。
<img src="./diagram/ScalingCloudCluster_aa_001_20230119.png" width="50%" align="top"/>
<img src="./diagram/DedicatedTierAvailable_aa_001_20230110.png" width="50%" align="top"/>



 