Skip to content

Commit

Permalink
tiup: fix the scale-out yaml example (#13781)
Browse files Browse the repository at this point in the history
Signed-off-by: Aolin <aolin.zhang@pingcap.com>
Co-authored-by: Aolin <aolin.zhang@pingcap.com>
  • Loading branch information
ti-chi-bot and Oreoxmt authored Apr 24, 2023
1 parent ee24200 commit cd05bb5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 32 deletions.
48 changes: 23 additions & 25 deletions scale-tidb-using-tiup.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ TiDB 集群可以在不中断线上服务的情况下进行扩容和缩容。
>
> - 从 TiUP v1.0.0 开始,扩容配置会继承原集群配置的 global 部分。
在 scale-out.yaml 文件添加扩容拓扑配置:

{{< copyable "shell-regular" >}}
在 scale-out.yml 文件添加扩容拓扑配置:

```shell
vi scale-out.yaml
vi scale-out.yml
```

{{< copyable "" >}}
Expand All @@ -52,8 +50,8 @@ tidb_servers:
ssh_port: 22
port: 4000
status_port: 10080
deploy_dir: /data/deploy/install/deploy/tidb-4000
log_dir: /data/deploy/install/log/tidb-4000
deploy_dir: /tidb-deploy/tidb-4000
log_dir: /tidb-deploy/tidb-4000/log
```

TiKV 配置文件参考:
Expand All @@ -66,9 +64,9 @@ tikv_servers:
ssh_port: 22
port: 20160
status_port: 20180
deploy_dir: /data/deploy/install/deploy/tikv-20160
data_dir: /data/deploy/install/data/tikv-20160
log_dir: /data/deploy/install/log/tikv-20160
deploy_dir: /tidb-deploy/tikv-20160
data_dir: /tidb-data/tikv-20160
log_dir: /tidb-deploy/tikv-20160/log
```

PD 配置文件参考:
Expand All @@ -82,12 +80,12 @@ pd_servers:
name: pd-1
client_port: 2379
peer_port: 2380
deploy_dir: /data/deploy/install/deploy/pd-2379
data_dir: /data/deploy/install/data/pd-2379
log_dir: /data/deploy/install/log/pd-2379
deploy_dir: /tidb-deploy/pd-2379
data_dir: /tidb-data/pd-2379
log_dir: /tidb-deploy/pd-2379/log
```

可以使用 `tiup cluster edit-config <cluster-name>` 查看当前集群的配置信息,因为其中的 `global``server_configs` 参数配置默认会被 `scale-out.yaml` 继承,因此也会在 `scale-out.yaml` 中生效。
可以使用 `tiup cluster edit-config <cluster-name>` 查看当前集群的配置信息,因为其中的 `global``server_configs` 参数配置默认会被 `scale-out.yml` 继承,因此也会在 `scale-out.yml` 中生效。

### 2. 执行扩容命令

Expand All @@ -102,28 +100,28 @@ pd_servers:
{{< copyable "shell-regular" >}}

```shell
tiup cluster check <cluster-name> scale-out.yaml --cluster --user root [-p] [-i /home/root/.ssh/gcp_rsa]
tiup cluster check <cluster-name> scale-out.yml --cluster --user root [-p] [-i /home/root/.ssh/gcp_rsa]
```

(2)自动修复集群存在的潜在风险:

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

```shell
tiup cluster check <cluster-name> scale-out.yaml --cluster --apply --user root [-p] [-i /home/root/.ssh/gcp_rsa]
tiup cluster check <cluster-name> scale-out.yml --cluster --apply --user root [-p] [-i /home/root/.ssh/gcp_rsa]
```

(3)执行 scale-out 命令扩容 TiDB 集群:

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

```shell
tiup cluster scale-out <cluster-name> scale-out.yaml [-p] [-i /home/root/.ssh/gcp_rsa]
tiup cluster scale-out <cluster-name> scale-out.yml [-p] [-i /home/root/.ssh/gcp_rsa]
```

以上操作示例中:

- 扩容配置文件为 `scale-out.yaml`
- 扩容配置文件为 `scale-out.yml`
- `--user root` 表示通过 root 用户登录到目标主机完成集群部署,该用户需要有 ssh 到目标机器的权限,并且在目标机器有 sudo 权限。也可以用其他有 ssh 和 sudo 权限的用户完成部署。
- [-i] 及 [-p] 为可选项,如果已经配置免密登录目标机,则不需填写。否则选择其一即可,[-i] 为可登录到目标机的 root 用户(或 --user 指定的其他用户)的私钥,也可使用 [-p] 交互式输入该用户的密码。

Expand Down Expand Up @@ -160,9 +158,9 @@ tiup cluster display <cluster-name>
> 1. 首先确认当前 TiDB 的版本支持 TiFlash,否则需要先升级 TiDB 集群至 v5.0 以上版本。
> 2. 执行 `tiup ctl:v<CLUSTER_VERSION> pd -u http://<pd_ip>:<pd_port> config set enable-placement-rules true` 命令,以开启 PD 的 Placement Rules 功能。或通过 [pd-ctl](/pd-control.md) 执行对应的命令。

### 1. 添加节点信息到 scale-out.yaml 文件
### 1. 添加节点信息到 scale-out.yml 文件

编写 scale-out.yaml 文件,添加该 TiFlash 节点信息(目前只支持 ip,不支持域名):
编写 scale-out.yml 文件,添加该 TiFlash 节点信息(目前只支持 ip,不支持域名):

{{< copyable "" >}}

Expand All @@ -176,7 +174,7 @@ tiflash_servers:
{{< copyable "shell-regular" >}}

```shell
tiup cluster scale-out <cluster-name> scale-out.yaml
tiup cluster scale-out <cluster-name> scale-out.yml
```

> **注意:**
Expand Down Expand Up @@ -207,28 +205,28 @@ tiup cluster display <cluster-name>

如果要添加 TiCDC 节点,IP 地址为 10.0.1.3、10.0.1.4,可以按照如下步骤进行操作。

### 1. 添加节点信息到 scale-out.yaml 文件
### 1. 添加节点信息到 scale-out.yml 文件

编写 scale-out.yaml 文件:
编写 scale-out.yml 文件:

{{< copyable "" >}}

```ini
cdc_servers:
- host: 10.0.1.3
gc-ttl: 86400
data_dir: /data/deploy/install/data/cdc-8300
data_dir: /tidb-data/cdc-8300
- host: 10.0.1.4
gc-ttl: 86400
data_dir: /data/deploy/install/data/cdc-8300
data_dir: /tidb-data/cdc-8300
```

### 2. 运行扩容命令

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

```shell
tiup cluster scale-out <cluster-name> scale-out.yaml
tiup cluster scale-out <cluster-name> scale-out.yml
```

> **注意:**
Expand Down
10 changes: 5 additions & 5 deletions ticdc/deploy-ticdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,25 @@ cdc_servers:

扩容的方式与部署 TiCDC 集群的方式类似,推荐使用 TiUP 工具完成。

1. 编写一个名为 `scale-out.yaml` 的配置文件,包含需要扩容的节点的配置信息。下面是一个示例:
1. 编写一个名为 `scale-out.yml` 的配置文件,包含需要扩容的节点的配置信息。下面是一个示例:

```shell
cdc_servers:
- host: 10.1.1.1
gc-ttl: 86400
data_dir: /data/deploy/install/data/cdc-8300
data_dir: /tidb-data/cdc-8300
- host: 10.1.1.2
gc-ttl: 86400
data_dir: /data/deploy/install/data/cdc-8300
data_dir: /tidb-data/cdc-8300
- host: 10.0.1.4:8300
gc-ttl: 86400
data_dir: /data/deploy/install/data/cdc-8300
data_dir: /tidb-data/cdc-8300
```

2. 在 TiUP 中控机上执行类似下面的命令进行扩容:

```shell
tiup cluster scale-out <cluster-name> scale-out.yaml
tiup cluster scale-out <cluster-name> scale-out.yml
```

更多用例说明,请参考[扩容 TiCDC 节点](/scale-tidb-using-tiup.md#扩容-ticdc-节点)。
Expand Down
4 changes: 2 additions & 2 deletions tiup/tiup-component-cluster-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ tiup cluster check <topology.yml | cluster-name> [flags]
> `tiup cluster check` 也支持修复已部署集群的扩容拓扑文件,命令格式:
>
>```shell
> tiup cluster check <cluster-name> scale-out.yaml --cluster --apply --user root [-p] [-i /home/root/.ssh/gcp_rsa]
> tiup cluster check <cluster-name> scale-out.yml --cluster --apply --user root [-p] [-i /home/root/.ssh/gcp_rsa]
>```
### --cluster
Expand All @@ -171,7 +171,7 @@ tiup cluster check <topology.yml | cluster-name> [flags]
> - `tiup cluster check` 也支持检查已部署集群的扩容拓扑文件,命令格式:
>
> ```shell
> tiup cluster check <cluster-name> scale-out.yaml --cluster --user root [-p] [-i /home/root/.ssh/gcp_rsa]
> tiup cluster check <cluster-name> scale-out.yml --cluster --user root [-p] [-i /home/root/.ssh/gcp_rsa]
> ```
### -N, --node
Expand Down

0 comments on commit cd05bb5

Please sign in to comment.