From cd05bb59d2bbe6af962530a8b02468642395f625 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Mon, 24 Apr 2023 14:56:45 +0800 Subject: [PATCH] tiup: fix the scale-out yaml example (#13781) Signed-off-by: Aolin Co-authored-by: Aolin --- scale-tidb-using-tiup.md | 48 +++++++++++++--------------- ticdc/deploy-ticdc.md | 10 +++--- tiup/tiup-component-cluster-check.md | 4 +-- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/scale-tidb-using-tiup.md b/scale-tidb-using-tiup.md index 73070c409cd3..f70802ffdb44 100644 --- a/scale-tidb-using-tiup.md +++ b/scale-tidb-using-tiup.md @@ -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 "" >}} @@ -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 配置文件参考: @@ -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 配置文件参考: @@ -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 ` 查看当前集群的配置信息,因为其中的 `global` 和 `server_configs` 参数配置默认会被 `scale-out.yaml` 继承,因此也会在 `scale-out.yaml` 中生效。 +可以使用 `tiup cluster edit-config ` 查看当前集群的配置信息,因为其中的 `global` 和 `server_configs` 参数配置默认会被 `scale-out.yml` 继承,因此也会在 `scale-out.yml` 中生效。 ### 2. 执行扩容命令 @@ -102,7 +100,7 @@ pd_servers: {{< copyable "shell-regular" >}} ```shell - tiup cluster check scale-out.yaml --cluster --user root [-p] [-i /home/root/.ssh/gcp_rsa] + tiup cluster check scale-out.yml --cluster --user root [-p] [-i /home/root/.ssh/gcp_rsa] ``` (2)自动修复集群存在的潜在风险: @@ -110,7 +108,7 @@ pd_servers: {{< copyable "shell-regular" >}} ```shell - tiup cluster check scale-out.yaml --cluster --apply --user root [-p] [-i /home/root/.ssh/gcp_rsa] + tiup cluster check scale-out.yml --cluster --apply --user root [-p] [-i /home/root/.ssh/gcp_rsa] ``` (3)执行 scale-out 命令扩容 TiDB 集群: @@ -118,12 +116,12 @@ pd_servers: {{< copyable "shell-regular" >}} ```shell - tiup cluster scale-out scale-out.yaml [-p] [-i /home/root/.ssh/gcp_rsa] + tiup cluster scale-out 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] 交互式输入该用户的密码。 @@ -160,9 +158,9 @@ tiup cluster display > 1. 首先确认当前 TiDB 的版本支持 TiFlash,否则需要先升级 TiDB 集群至 v5.0 以上版本。 > 2. 执行 `tiup ctl:v pd -u http://: 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 "" >}} @@ -176,7 +174,7 @@ tiflash_servers: {{< copyable "shell-regular" >}} ```shell -tiup cluster scale-out scale-out.yaml +tiup cluster scale-out scale-out.yml ``` > **注意:** @@ -207,9 +205,9 @@ tiup cluster display 如果要添加 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 "" >}} @@ -217,10 +215,10 @@ tiup cluster display 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. 运行扩容命令 @@ -228,7 +226,7 @@ cdc_servers: {{< copyable "shell-regular" >}} ```shell -tiup cluster scale-out scale-out.yaml +tiup cluster scale-out scale-out.yml ``` > **注意:** diff --git a/ticdc/deploy-ticdc.md b/ticdc/deploy-ticdc.md index b8a76e15317a..1d3358cf6a0a 100644 --- a/ticdc/deploy-ticdc.md +++ b/ticdc/deploy-ticdc.md @@ -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 scale-out.yaml + tiup cluster scale-out scale-out.yml ``` 更多用例说明,请参考[扩容 TiCDC 节点](/scale-tidb-using-tiup.md#扩容-ticdc-节点)。 diff --git a/tiup/tiup-component-cluster-check.md b/tiup/tiup-component-cluster-check.md index 70e715a078a7..437cce99233f 100644 --- a/tiup/tiup-component-cluster-check.md +++ b/tiup/tiup-component-cluster-check.md @@ -150,7 +150,7 @@ tiup cluster check [flags] > `tiup cluster check` 也支持修复已部署集群的扩容拓扑文件,命令格式: > >```shell -> tiup cluster check scale-out.yaml --cluster --apply --user root [-p] [-i /home/root/.ssh/gcp_rsa] +> tiup cluster check scale-out.yml --cluster --apply --user root [-p] [-i /home/root/.ssh/gcp_rsa] >``` ### --cluster @@ -171,7 +171,7 @@ tiup cluster check [flags] > - `tiup cluster check` 也支持检查已部署集群的扩容拓扑文件,命令格式: > > ```shell -> tiup cluster check scale-out.yaml --cluster --user root [-p] [-i /home/root/.ssh/gcp_rsa] +> tiup cluster check scale-out.yml --cluster --user root [-p] [-i /home/root/.ssh/gcp_rsa] > ``` ### -N, --node