Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 14 additions & 70 deletions reference/tiflash/scale.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,86 +10,40 @@ This document describes how to scale in and out nodes in the TiFlash cluster.

## Scale out a TiFlash node

The following example shows how to scale out a TiFlash node if you deploy TiFlash on the `192.168.1.1` node.
If you need to add a TiFlash node to the `172.19.0.104` host, take the following steps:

1. Edit the `inventory.ini` file to add the TiFlash node information:
1. Create the `scale-out.yaml` file to add the TiFlash node information:

Currently, you can only add IP but not domain name.

{{< copyable "" >}}

```ini
[tiflash_servers]
192.168.1.1
tiflash_servers:
- host: 172.19.0.104
```

2. Edit the `hosts.ini` file to add the node information:

{{< copyable "" >}}

```ini
[servers]
192.168.1.1
[all:vars]
username = tidb
ntp_server = pool.ntp.org
```

3. Initialize the new node:

- Configure the SSH mutual trust and sudo rules on the Control Machine:

{{< copyable "shell-regular" >}}

```shell
ansible-playbook -i hosts.ini create_users.yml -l 192.168.1.1 -u root -k
```

- Install the NTP service on the target machine:

{{< copyable "shell-regular" >}}

```shell
ansible-playbook -i hosts.ini deploy_ntp.yml -u tidb -b
```

- Initialize the node on the target machine:

{{< copyable "shell-regular" >}}

```shell
ansible-playbook bootstrap.yml -l 192.168.1.1
```

4. Deploy the new node:

{{< copyable "shell-regular" >}}

```shell
ansible-playbook deploy.yml -l 192.168.1.1
```

5. Start the new node:
2. Run the scale-out command:

{{< copyable "shell-regular" >}}

```shell
ansible-playbook start.yml -l 192.168.1.1
tiup cluster scale-out test scale-out.yaml
```

6. Update the configuration of Prometheus and restart it:
3. View the cluster status:

{{< copyable "shell-regular" >}}

```shell
ansible-playbook rolling_update_monitor.yml --tags=prometheus
tiup cluster display test
```

7. Access the monitoring platform using your browser, and view the status of the cluster and the new node.
4. Access the monitoring platform using your browser, and view the status of the cluster and the new node.

## Scale in a TiFlash node

The following example shows how to scale in a TiFlash node if you stop the TiFlash service on the `192.168.1.1` node.
If you want to stop the TiFlash service on the `172.19.0.104` node, take the following steps:

> **Note:**
>
Expand All @@ -104,25 +58,15 @@ The following example shows how to scale in a TiFlash node if you stop the TiFla
{{< copyable "shell-regular" >}}

```shell
ansible-playbook stop.yml -l 192.168.1.1
tiup cluster scale-in test --node 172.19.0.104:9000
```

If the node still has other services and you want to stop TiFlash only, use the following command:

{{< copyable "shell-regular" >}}

```shell
ansible-playbook stop.yml -t tiflash -l 192.168.1.1
```

4. Edit the `inventory.ini` and `hosts.ini` files to remove the node information.

5. Update the configuration of Prometheus and restart it:
4. View the cluster status:

{{< copyable "shell-regular" >}}

```shell
ansible-playbook rolling_update_monitor.yml --tags=prometheus
tiup cluster display test
```

6. Access the monitoring platform using your browser, and view the status of the cluster.
5. Access the monitoring platform using your browser, and view the status of the cluster.