# Online Scaling Out `TiFlash` Nodes (On-premises)

__*TiDB online scale out*__
__*TiFlash online scale out*__
__*zz-Issue-Diagram-Needed*__

+ **Step 1:** Turn on parameter `enable-placement-rules`
+ **Step 2:** Place the scale-out topology to a `yaml` file
+ **Step 3:** Execute the scale out command
+ **Step 4:** Verify that the new node has joined the cluster

```
~!@// Step 1@!~
$ tiup ctl:{cluster_version} pd -u http://{pd_ip}:{pd_port} config set enable-placement-rules true

~!@// Step 2@!~
$ vi scale-out.yaml

tiflash_servers:
  - host: 10.0.1.4

~!@// Step 3@!~
$ tiup cluster ~!@scale-out@!~ {cluster_name} scale-out.yaml

~!@// Step 4@!~
$ tiup cluster display {cluster_name}
```

![`smart`](./student-guide/diagram/OnlineScalingOutTiFlashNodes_aa_001_20220923.png)
-------------------------------------------------------------
Placement Rules, introduced in v5.0, is a replica rule system that guides PD to generate corresponding schedules for different types of data.

The Placement Rules feature is enabled by default in v5.0 and later versions of TiDB.

Scaling out `TiFlash` nodes is slightly different from `TiDB/TiKV/PD`. You need to add 2 steps as follows:

Step 1: Enable the `PD` Placement Rules function with the parameter `enable-placement-rules`.
```
tiup ctl:{cluster_version} pd -u http://{pd_ip}:{pd_port} config set enable-placement-rules true
```

Step 2: Edit the `scale-out` topology. For example, the node to be added is `10.0.1.4`:
```
vi scale-out.yaml

tiflash_servers:
  - host: 10.0.1.4
```

Step 3: Run `scale out` command:
```
tiup cluster scale-out {cluster-name} scale-out.yaml
```

Step 4: Verify the new `TiFlash` node has joined:
```
tiup cluster display {cluster-name}
```

Please refer to the documentation: `https://docs.pingcap.com/zh/tidb/stable/scale-tidb-using-tiup`











