From 6afee2c2039e004845bdfbe346b45922775b9d10 Mon Sep 17 00:00:00 2001 From: lucklove Date: Tue, 10 Nov 2020 18:08:03 +0800 Subject: [PATCH 01/56] Prepare to change --- TOC.md | 2 +- tiup/tiup-documentation-guide.md | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/TOC.md b/TOC.md index 529722b2fe70..5a27a6e24145 100644 --- a/TOC.md +++ b/TOC.md @@ -489,7 +489,7 @@ + [TiFlash 简介](/tiflash/tiflash-overview.md) + [使用 TiFlash](/tiflash/use-tiflash.md) + TiUP - + [文档指南](/tiup/tiup-documentation-guide.md) + + [文档地图](/tiup/tiup-documentation-guide.md) + [概览](/tiup/tiup-overview.md) + [术语及核心概念](/tiup/tiup-terminology-and-concepts.md) + [TiUP 组件管理](/tiup/tiup-component-management.md) diff --git a/tiup/tiup-documentation-guide.md b/tiup/tiup-documentation-guide.md index 1614fb8124b0..3e9cb5ceab82 100644 --- a/tiup/tiup-documentation-guide.md +++ b/tiup/tiup-documentation-guide.md @@ -3,7 +3,11 @@ title: TiUP 文档指南 aliases: ['/docs-cn/dev/tiup/tiup-documentation-guide/'] --- -# TiUP 文档指南 +# TiUP 文档地图 + +## 用户指南 (User Guide) + +## 使用手册 (Reference) ## TiUP 使用文档 From 0e7670812faaa37d44beb22855441426b0353e2b Mon Sep 17 00:00:00 2001 From: lucklove Date: Wed, 11 Nov 2020 18:27:35 +0800 Subject: [PATCH 02/56] Introduce reference --- tiup/tiup-command-install.md | 28 ++++++++ tiup/tiup-documentation-guide.md | 20 ++---- tiup/tiup-reference.md | 110 +++++++++++++++++++++++++++++++ 3 files changed, 143 insertions(+), 15 deletions(-) create mode 100644 tiup/tiup-command-install.md create mode 100644 tiup/tiup-reference.md diff --git a/tiup/tiup-command-install.md b/tiup/tiup-command-install.md new file mode 100644 index 000000000000..1b51d6e59ba3 --- /dev/null +++ b/tiup/tiup-command-install.md @@ -0,0 +1,28 @@ +--- +title: install +aliases: ['/docs-cn/dev/tiup/tiup-command-install/'] +--- + +# install + +## 介绍 + +命令 `install` 用于安装一个或多个组件,它会从镜像仓库中下载特定版本的组件包,并在本地的 TiUP 数据目录中解压,以便后续使用 TiUP 执行该组件。 + +## 语法 + +```sh +tiup install [:version] [component2...N] [flags] +``` + +`` 和 `` 代表组件名字,`[version]` 代表一个可选的版本号,若不加 `version`,则安装指定组件的最新稳定版本,否则安装 `[version]` 指定的版本。 + +## 选项 + +无 + +## 输出 + +- 正常情况下输出下载进程 +- 若组件不存在则报错 `The component "%s" not found` +- 若版本不存在则报错 `version %s not supported by component %s` \ No newline at end of file diff --git a/tiup/tiup-documentation-guide.md b/tiup/tiup-documentation-guide.md index 3e9cb5ceab82..58c764c28ca5 100644 --- a/tiup/tiup-documentation-guide.md +++ b/tiup/tiup-documentation-guide.md @@ -3,28 +3,18 @@ title: TiUP 文档指南 aliases: ['/docs-cn/dev/tiup/tiup-documentation-guide/'] --- -# TiUP 文档地图 +# TiUP 文档指南 -## 用户指南 (User Guide) +## 使用文档 -## 使用手册 (Reference) - -## TiUP 使用文档 - -- [TiUP 概览](/tiup/tiup-overview.md):对 TiUP 进行整体介绍,如何安装和基本的用法 +- [TiUP 概览](/tiup/tiup-overview.md):对 TiUP 进行整体介绍,如何安装和基本的用法以及相关术语 - [TiUP 术语](/tiup/tiup-terminology-and-concepts.md):解释使用 TiUP 过程中可能用到的术语,了解 TiUP 的核心概念 - [TiUP 组件管理](/tiup/tiup-component-management.md):详细介绍 TiUP 所有命令,如何使用 TiUP 下载、更新、删除组件 - [TiUP FAQ](/tiup/tiup-faq.md):TiUP 使用过程中的常见问题,包含 TiUP 第三方组件的 FAQ - [TiUP 故障排查](/tiup/tiup-troubleshooting-guide.md):如果在使用 TiUP 过程中遇到问题,可以参考故障排查文档的解决方案 +- [TiUP 参考手册](/tiup/tiup-reference.md):TiUP 详细参考手册 -## TiUP 组件使用文档 - -- [tiup-playground](/tiup/tiup-playground.md):介绍如何使用 TiUP Playground 组件快速搭建本地测试集群 -- [tiup-cluster](/tiup/tiup-cluster.md):介绍 TiUP 的生产集群部署、运维组件 TiUP Cluster 的用法和命令行参数解释 -- [tiup-mirror](/tiup/tiup-mirror.md):介绍如何使用 TiUP Mirror 组件自定义一个本地离线镜像 -- [tiup-bench](/tiup/tiup-bench.md):介绍如何使用 TiUP Bench 组件进行常见的压力测试,如 TPCC/TPCH - -## TiUP 资源 +## 资源 - [AskTUG TiUP](https://asktug.com/c/qa/set-up-deploy):AskTUG.com 部署板块 - [TiUP Issues](https://github.com/pingcap/tiup/issues):TiUP Github Issues 列表 diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md new file mode 100644 index 000000000000..10e40bea7590 --- /dev/null +++ b/tiup/tiup-reference.md @@ -0,0 +1,110 @@ +--- +title: TiUP 参考手册 +aliases: ['/docs-cn/dev/tiup/tiup-reference/'] +--- + +# TiUP + +## 介绍 + +在各种系统软件和应用软件的安装管理中,包管理器均有着广泛的应用,包管理工具的出现大大简化了软件的安装和升级维护工作。例如,几乎所有使用 RPM 的 Linux 都会使用 Yum 来进行包管理,而 Anaconda 则可以非常方便地管理 python 的环境和相关软件包。 + +在早期的 TiDB 生态中,没有专门的包管理工具,使用者只能通过相应的配置文件和文件夹命名来手动管理,如 Prometheus 等第三方监控报表工具甚至需要额外的特殊管理,这样大大提升了运维管理难度。 + +从 TiDB 4.0 版本开始,TiUP 作为新的工具,承担着包管理器的角色,管理着 TiDB 生态下众多的组件,如 TiDB、PD、TiKV 等。用户想要运行 TiDB 生态中任何组件时,只需要执行 TiUP 一行命令即可,相比以前,极大地降低了管理难度。 + +TiUP 的使用围绕命令,组件,镜像这几个核心概念进行,我们下面先对它们进行定义。 + +### 命令 + +命令是程序功能的入口,一切功能都被实现在一个命令中,它具有以下特点: + +- 内置于可执行程序 +- 可以带有子命令 +- 可以带有参数及选项(flags) + + +TiUP 集成了一系列的子命令用于组件管理和镜像管理。 + +### 组件 + +区别于命令,组件具有以下特点: + +- 动态从镜像中取得 +- 本身是一个二进制程序 +- 有自己的命令及子命令 + +### 镜像 + +镜像是一个组件仓库,它存放了一系列组件,负责在 TiUP 需要某个组件时提供它。 + +## 语法 + +```sh +tiup [flags] [args...] +# or +tiup [flags] [args...] +``` + +使用 `help` 命令可以获取特定命令的信息,每个命令的摘要都显示了其参数及其用法。必须参数显示在尖括号中,可选参数显示在方括号中。 + +`` 代表命令名字,支持的命令列表请参考下方命令清单,`` 代表组件名,支持的组件列表请参考下方组件清单。 + +## 选项 + +### -B, --binary (boolean,默认 false) + +打印指定组件的二进制文件路径: + +- 执行 `tiup -B/--binary ` 将打印已安装的 `` 组件的最新稳定版路径,若 `` 组件未安装,则报错 +- 执行 `tiup -B/--binary :` 将答应已经安装的 `` 组件的 `` 版本所在的路径,若该版本未安装,则报错 + +> **使用限制: *** +> +> 该选项只能用于 `tiup [flags] [args...]` 格式的命令。 + +### --binpath (string) + +指定要执行的组件的路径:执行一个组件时,如果不想使用 TiUP 镜像中的二进制文件,可以使用该参数使用自定义路径的二进制文件替换之。 + +> **使用限制: *** +> +> 该选项只能用于 `tiup [flags] [args...]` 格式的命令。 + +### --skip-version-check (boolean,默认 false) + +已废弃 + +### -T, --tag (string) + +对启动的组件指定一个 `tag`:有的组件在执行过程中需要使用磁盘存储,TiUP 会分配一个临时目录作为该组件本次执行的存储目录,如果希望分配固定目录,可以用 `-T/--tag` 来指定目录名字,这样多次执行使用同样的 `tag` 就能读写到同一批文件。 + +### -v, --version + +打印 TiUP 的版本 + +### --help + +打印帮助信息 + +## 命令清单 + +- [install](/tiup/tiup-command-install.md):安装组件 +- list:查看组件列表 +- uniinstall:卸载组件 +- update:升级已安装的组件 +- status:查看组件运行状态 +- clean:清理组件数据目录 +- mirror:镜像管理 +- telemetry:遥测开关 +- completion:TiUP 命令补全 +- env:查看 TiUP 相关环境变量 +- help:查看特定命令或组件的帮助文档 + +## 组件清单 + +- cluster:生产环境 TiDB 集群管理 +- dm:生产环境 DM 集群管理 +- playground:本地集群体验 +- bench:数据库压测 +- ctl:TiDB 相关的控制工具 \ No newline at end of file From d8fda1cfaa37ae9d53bedd223e703b0d46042a94 Mon Sep 17 00:00:00 2001 From: lucklove Date: Wed, 11 Nov 2020 21:24:28 +0800 Subject: [PATCH 03/56] Add reference for tiup list and tiup uninstall --- tiup/tiup-command-install.md | 6 ++--- tiup/tiup-command-list.md | 41 ++++++++++++++++++++++++++++++++++ tiup/tiup-command-uninstall.md | 33 +++++++++++++++++++++++++++ tiup/tiup-reference.md | 4 ++-- 4 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 tiup/tiup-command-list.md create mode 100644 tiup/tiup-command-uninstall.md diff --git a/tiup/tiup-command-install.md b/tiup/tiup-command-install.md index 1b51d6e59ba3..9f49f344075f 100644 --- a/tiup/tiup-command-install.md +++ b/tiup/tiup-command-install.md @@ -1,5 +1,5 @@ --- -title: install +title: tiup install aliases: ['/docs-cn/dev/tiup/tiup-command-install/'] --- @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-install/'] ## 介绍 -命令 `install` 用于安装一个或多个组件,它会从镜像仓库中下载特定版本的组件包,并在本地的 TiUP 数据目录中解压,以便后续使用 TiUP 执行该组件。 +命令 `tiup install` 用于安装一个或多个组件,它会从镜像仓库中下载特定版本的组件包,并在本地的 TiUP 数据目录中解压,以便后续使用 TiUP 运行该组件。 ## 语法 @@ -15,7 +15,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-install/'] tiup install [:version] [component2...N] [flags] ``` -`` 和 `` 代表组件名字,`[version]` 代表一个可选的版本号,若不加 `version`,则安装指定组件的最新稳定版本,否则安装 `[version]` 指定的版本。 +`` 和 `` 代表组件名字,`[version]` 代表一个可选的版本号,若不加 `version`,则安装指定组件的最新稳定版本,否则安装 `[version]` 指定的版本。`[component2...N]` 表示可同时指定多个组件或同一个组件的多个版本。 ## 选项 diff --git a/tiup/tiup-command-list.md b/tiup/tiup-command-list.md new file mode 100644 index 000000000000..90d2733e7c9b --- /dev/null +++ b/tiup/tiup-command-list.md @@ -0,0 +1,41 @@ +--- +title: tiup list +aliases: ['/docs-cn/dev/tiup/tiup-command-list/'] +--- + +# tiup list + +## 介绍 + +命令 `tiup list` 用于查询镜像中可用的组件列表。 + +## 语法 + +```sh +tiup list [component] [flags] +``` + +`[component]` 是可选的组件名称,若指定,则列出该组件的所有版本,若不指定,则列出所有组件列表。 + +## 选项 + +### --all (boolean, 默认 false) + +显示所有组件:默认只显示非隐藏组件。 + +### --installed (boolean,默认 false) + +只显示已经安装的组件或版本。 + +### --verbose (boolean,默认 false) + +在组件列表中显示已安装的版本列表:默认组件列表不显示当前已安装的版本。 + +## 输出 + +- 若未指定 `[component]` + - 若指定 --verbose:输出 `组件名(Name)`,`已安装版本(Installed)`, `组件所有者(Owner)`,`组件描述(Owner)` 构成的组件信息列表 + - 若不指定 --verbose:输出 `组件名(Name)`,`组件所有者(Owner)`,`组件描述(Owner)` 构成的组件信息列表 +- 若指定 `[component]` + - 若 `[component]` 存在:输出 `版本(Version)`,`是否已安装(Installed)`,`发布时间(Release)`,`支持的平台(Platforms)` 构成的版本信息列表 + - 若 `[component]` 不存在:报错 `failed to fetch component: unknown component` \ No newline at end of file diff --git a/tiup/tiup-command-uninstall.md b/tiup/tiup-command-uninstall.md new file mode 100644 index 000000000000..c89a73a7cf04 --- /dev/null +++ b/tiup/tiup-command-uninstall.md @@ -0,0 +1,33 @@ +--- +title: tiup uninstall +aliases: ['/docs-cn/dev/tiup/tiup-command-uninstall/'] +--- + +# tiup uninstall + +## 介绍 + +命令 `tiup uninstall` 用于卸载已安装的组件。 + +## 语法 + +```sh +tiup uninstall : [component2...N] [flags] +``` + +`` 表示要卸载的组件名字,`` 表示要卸载的版本,如果省略,则表示卸载该组件的全部已安装版本,因为安全原因,省略 `` 时必须加上选项 `--all` 明确表示需要卸载该组件的所有版本。`[component2...N]` 表示可指定卸载多个组件或版本。 + +## 选项 + +### --all (boolean, 默认 false) + +卸载指定组件的全部已安装版本,省略 `` 时使用。 + +### --self (boolean,默认 false) + +卸载 TiUP 自身:删除所有从镜像上下载过来的数据,但会保留 TiUP 及其组件产生的数据,数据存放在 TIUP_HOME 指定的文件夹中,若未设置过 TIUP_HOME,则默认值为 ~/.tiup/。 + +## 输出 + +- 正常退出:`Uninstalled component "%s" successfully!` +- 若未指定 `` 也未指定 `--all`:报错 `Use "tiup uninstall tidbx --all" if you want to remove all versions.` \ No newline at end of file diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 10e40bea7590..8aa2928cd5c5 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -90,8 +90,8 @@ tiup [flags] [args...] ## 命令清单 - [install](/tiup/tiup-command-install.md):安装组件 -- list:查看组件列表 -- uniinstall:卸载组件 +- [list](/tiup/tiup-command-list.md):查看组件列表 +- [uniinstall](/tiup/tiup-command-uninstall.md):卸载组件 - update:升级已安装的组件 - status:查看组件运行状态 - clean:清理组件数据目录 From 20776745e6afa2e829d81d787c47c50849ddb22e Mon Sep 17 00:00:00 2001 From: lucklove Date: Thu, 26 Nov 2020 21:20:07 +0800 Subject: [PATCH 04/56] mirror WIP --- tiup/tiup-command-clean.md | 19 ++++ tiup/tiup-command-install.md | 2 +- tiup/tiup-command-status.md | 30 +++++++ tiup/tiup-command-update.md | 43 +++++++++ tiup/tiup-mirror-reference.md | 162 ++++++++++++++++++++++++++++++++++ tiup/tiup-reference.md | 8 +- 6 files changed, 259 insertions(+), 5 deletions(-) create mode 100644 tiup/tiup-command-clean.md create mode 100644 tiup/tiup-command-status.md create mode 100644 tiup/tiup-command-update.md create mode 100644 tiup/tiup-mirror-reference.md diff --git a/tiup/tiup-command-clean.md b/tiup/tiup-command-clean.md new file mode 100644 index 000000000000..29f517384e2a --- /dev/null +++ b/tiup/tiup-command-clean.md @@ -0,0 +1,19 @@ +--- +title: tiup clean +aliases: ['/docs-cn/dev/tiup/tiup-command-clean/'] +--- + +# tiup clean + +## 介绍 + +命令 `tiup clean` 用于清除组件运行过程中产生的数据 + +## 语法 + + + +## 选项 + + +## 输出 diff --git a/tiup/tiup-command-install.md b/tiup/tiup-command-install.md index 9f49f344075f..67d3779d1ce5 100644 --- a/tiup/tiup-command-install.md +++ b/tiup/tiup-command-install.md @@ -3,7 +3,7 @@ title: tiup install aliases: ['/docs-cn/dev/tiup/tiup-command-install/'] --- -# install +# tiup install ## 介绍 diff --git a/tiup/tiup-command-status.md b/tiup/tiup-command-status.md new file mode 100644 index 000000000000..f8b3edd30218 --- /dev/null +++ b/tiup/tiup-command-status.md @@ -0,0 +1,30 @@ +--- +title: tiup status +aliases: ['/docs-cn/dev/tiup/tiup-command-status/'] +--- + +# tiup status + +## 介绍 + +命令 `tiup status` 查看组件运行信息:通过 `tiup [flags] [args...]` 运行组件之后,可以通过该命令查看组件的运行信息。 + +> **使用限制: *** +> +> 只能查询到以下两种组件的信息: +> 1. 尚在运行的组件 +> 2. 通过 `tiup -T/--tag` 指定 tag 运行的组件 + +## 语法 + +```sh +tiup status [flags] +``` + +## 选项 + +无 + +## 输出 + +由 `Tag 名字`,`组件名`,`进程 PID`,`运行状态`, `启动时间`,`启动参数`,`数据目录`,`二进制文件路径` 构成的表格,若启动时未指定 Tag 名字,则 Tag 名字段为随机字符串。 \ No newline at end of file diff --git a/tiup/tiup-command-update.md b/tiup/tiup-command-update.md new file mode 100644 index 000000000000..eefdca957b53 --- /dev/null +++ b/tiup/tiup-command-update.md @@ -0,0 +1,43 @@ +--- +title: tiup update +aliases: ['/docs-cn/dev/tiup/tiup-command-update/'] +--- + +# tiup update + +## 介绍 + +命令 `tiup update` 用于升级已安装的组件。 + +## 语法 + +```sh +tiup update [component1][:version] [component2..N] [flags] +``` + +`[component1]` 表示要升级的组件名字,`[version]` 表示要卸载的版本,如果省略,则表示升级到该组件的最新稳定版本,`[component2...N]` 表示可指定升级多个组件或版本。如果一个组件也不指定:即 `[component1][:version] [component2..N]` 为空,则需要配合使用 `--all` 选项或 `--self` 选项。 + +升级操作不会删除旧的版本,仍然可以在执行时指定旧版本。 + +## 选项 + +### --all (boolean, 默认 false) + +升级所有已安装的组件,若未指定任何组件,则必须指定该选项为 `true`。 + +### --force (boolean, 默认 false) + +若指定的组件版本已经安装,则不进行升级操作,指定该参数可忽略已安装版本强制升级。 + +### --nightly (boolean, 默认 false) + +将指定组件升级到 nightly:等价于 `tiup update :nightly`。 + +### --self (boolean,默认 false) + +升级 tiup 自身。 + +## 输出 + +- 升级成功:`Updated successfully!` +- 目标版本不存在:`Error: version %s not supported by component %s` \ No newline at end of file diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md new file mode 100644 index 000000000000..b84ee02ae8f7 --- /dev/null +++ b/tiup/tiup-mirror-reference.md @@ -0,0 +1,162 @@ +--- +title: tiup mirror reference +aliases: ['/docs-cn/dev/tiup/tiup-mirror-reference/'] +--- + +# tiup mirror reference + +## 介绍 + +TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件的元信息。镜像可以以以下两种形式存在: +- 本地磁盘上的目录:用于服务本地的 TiUP 客户端,文档中将称之为本地镜像 +- 基于远程的磁盘目录启动的 HTTP 镜像:服务远程的 TiUP 客户端,文档中将称之为远程镜像 + +## 镜像的创建与更新 + +镜像可以通过以下两种方式创建: +- 通过命令 `tiup mirror init` 从零生成 +- 通过命令 `tiup mirrir clone` 从已有镜像克隆 + +在创建镜像之后,可以通过 `tiup mirror` 相关命令来给镜像添加组件或删除组件,无论是通过何种方式更新镜像,TiUP 都不会从镜像中删除任何文件,而是通过增加文件并分配新版本号的方式更新。 + +## 本地镜像 + +一个典型的镜像目录结构如下: + +``` ++ # 镜像根目录 +|-- root.json # 镜像根证书 +|-- {1..N}.root.json # 镜像根证书 +|-- {1..N}.index.json # 组件/用户索引 +|-- {1..N}.{component}.json # 组件元信息 +|-- {component}-{version}-{os}-{arch}.tar.gz # 组件二进制包 +|-- snapshot.json # 镜像最新快照 +|-- timestamp.json # 镜像最新时间戳 +|--+ commits # 镜像更新日志(可删除) + |--+ commit-{ts1..tsN} + |-- {N}.{component}.json + |-- {N}.index.json + |-- {component}-{version}-{os}-{arch}.tar.gz + |-- snapshot.json + |-- timestamp.json +|--+ keys # 镜像私钥(可移动到其他位置) + |-- {hash1..hashN}-root.json # 根证书私钥 + |-- {hash}-index.json # 索引私钥 + |-- {hash}-snapshot.json # 快照私钥 + |-- {hash}-timestamp.json # 时间戳私钥 +``` + +### 镜像根证书 + +在 TiUP 镜像中,根证书用于存放其他元信息文件的公钥,每次获取到任何元信息文件(*.json)都需要根据其文件类型(root,index,snapshot,timestamp)在当前已安装的 root.json 中找到对应的公钥,然后用公钥验证其签名是否合法。 + +根证书文件格式如下: + +``` +{ + "signatures": [ # 每个元信息文件有一些列的签名,签名由该文件对应的几个私钥签出 + { + "keyid": "{id-of-root-key-1}", # 第一个参与签名私钥的 ID,该 ID 由私钥对应的公钥内容哈希得到 + "sig": "{signature-by-root-key-1}" # 该私钥对此文件 signed 部分签名的结果 + }, + ... + { + "keyid": "{id-of-root-key-N}", # 第 N 个参与签名私钥的 ID + "sig": "{signature-by-root-key-N}" # 该私钥对此文件 signed 部分签名的结果 + } + ], + "signed": { # 被签名的部分 + "_type": "root", # 该字段说明本文件的类型,root.json 的类型就是 root + "expires": "{expiration-date-of-this-file}", # 该文件的过期时间,过期后客户端会拒绝此文件 + "roles": { # root.json 中的 roles 用来记录对各个元文件签名的密钥 + "{role:index,root,snapshot,timestamp}": { # 涉及到的元文件由 index, root, snapshot, timestamp + "keys": { # 只有 keys 中记录的密钥签名才是合法的 + "{id-of-the-key-1}": { # 用于签名 {role} 的第 1 个密钥 ID + "keytype": "rsa", # 密钥类型,目前固定为 rsa + "keyval": { # 密钥的 payload + "public": "{public-key-content}" # 表示公钥内容 + }, + "scheme": "rsassa-pss-sha256" # 目前固定为 rsassa-pss-sha256 + }, + "{id-of-the-key-N}": { # 用于签名 {role} 的第 N 个密钥 ID + "keytype": "rsa", + "keyval": { + "public": "{public-key-content}" + }, + "scheme": "rsassa-pss-sha256" + } + }, + "threshold": {N}, # threshold 指示该元文件需要至少 N 个密钥签名 + "url": "/{role}.json" # url 是指该文件的获取地址,对于 index 文件,需要在前面加上版本号,即 /{N}.index.json + } + }, + "spec_version": "0.1.0", # 本文件遵循的规范版本,未来变更文件结构需要升级版本号,目前为 0.1.0 + "version": {N} # 本文件的版本号,每次更新文件需要创建一个新的 {N+1}.root.json,并将其 version 设置为 N + 1 + } +} +``` + +## 索引 + +索引文件记录了镜像中所有的组件已经组件的所有者信息。 + +其格式如下: + +``` +{ + "signatures": [ # 该文件的签名 + { + "keyid": "{id-of-index-key-1}", # 第一个参与签名的 key 的 ID + "sig": "{signature-by-index-key-1}", # 该私钥对此文件 signed 部分签名的结果 + }, + ... + { + "keyid": "{id-of-root-key-N}", # 第 N 个参与签名私钥的 ID + "sig": "{signature-by-root-key-N}" # 该私钥对此文件 signed 部分签名的结果 + } + ], + "signed": { + "_type": "index", # 指示该文件类型 + "components": { # 组件列表 + "{component1}": { # 第一个组件的名称 + "hidden": {bool}, # 是否是隐藏组件 + "owner": "{owner-id}", # 组件所有者 ID + "standalone": {bool}, # 该组件是否可独立运行 + "url": "/{component}.json", # 获取组件的地址,需要加上版本号:/{N}.{component}.json + "yanked": {bool} # 该组件是否已被标记为删除 + }, + ... + "{componentN}": { # 第 N 个组件的名称 + ... + }, + }, + "default_components": ["{component1}".."{componentN}"], # 镜像必须包含的默认组件,该字段目前固定为空(未启用) + "expires": "{expiration-date-of-this-file}", # 该文件的过期时间,过期后客户端会拒绝此文件 + "owners": { + "{owner1}": { # 第一个属主的 ID + "keys": { # 只有 keys 中记录的密钥签名才是合法的 + "{id-of-the-key-1}": { # 该属主的第一个密钥 + "keytype": "rsa", # 密钥类型,目前固定为 rsa + "keyval": { # 密钥的 payload + "public": "{public-key-content}" # 表示公钥内容 + }, + "scheme": "rsassa-pss-sha256" # 目前固定为 rsassa-pss-sha256 + }, + ... + "{id-of-the-key-N}": { # 该属主的第 N 个密钥 + ... + } + }, + "name": "{owner-name}", # 该属主的名字 + "threshod": {N} # 指示该属主拥有的组件必须含有至少 N 个合法签名 + }, + ... + "{ownerN}": { # 第 N 个属主的 ID + ... + } + } + "spec_version": "0.1.0", # 本文件遵循的规范版本,未来变更文件结构需要升级版本号,目前为 0.1.0 + "version": {N} # 本文件的版本号,每次更新文件需要创建一个新的 {N+1}.index.json,并将其 version 设置为 N + 1 + } +} +``` \ No newline at end of file diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 8aa2928cd5c5..308763cb042b 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -41,9 +41,9 @@ TiUP 集成了一系列的子命令用于组件管理和镜像管理。 ## 语法 ```sh -tiup [flags] [args...] +tiup [flags] [args...] # 执行命令 # or -tiup [flags] [args...] +tiup [flags] [args...] # 运行组件 ``` 使用 `help` 命令可以获取特定命令的信息,每个命令的摘要都显示了其参数及其用法。必须参数显示在尖括号中,可选参数显示在方括号中。 @@ -92,8 +92,8 @@ tiup [flags] [args...] - [install](/tiup/tiup-command-install.md):安装组件 - [list](/tiup/tiup-command-list.md):查看组件列表 - [uniinstall](/tiup/tiup-command-uninstall.md):卸载组件 -- update:升级已安装的组件 -- status:查看组件运行状态 +- [update](/tiup/tiup-command-update.md):升级已安装的组件 +- [status](/tiup/tiup-command-status.md):查看组件运行状态 - clean:清理组件数据目录 - mirror:镜像管理 - telemetry:遥测开关 From 14e8a3a8aea6d536085e79a86fd7bf53c69d5fc6 Mon Sep 17 00:00:00 2001 From: lucklove Date: Wed, 9 Dec 2020 21:54:19 +0800 Subject: [PATCH 05/56] Update --- tiup/tiup-mirror-reference.md | 160 ++++++++++++++++++++++++++++++++-- 1 file changed, 155 insertions(+), 5 deletions(-) diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index b84ee02ae8f7..9e3a610e4e2d 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -19,14 +19,14 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 在创建镜像之后,可以通过 `tiup mirror` 相关命令来给镜像添加组件或删除组件,无论是通过何种方式更新镜像,TiUP 都不会从镜像中删除任何文件,而是通过增加文件并分配新版本号的方式更新。 -## 本地镜像 +## 镜像结构 一个典型的镜像目录结构如下: ``` + # 镜像根目录 |-- root.json # 镜像根证书 -|-- {1..N}.root.json # 镜像根证书 +|-- {2..N}.root.json # 镜像根证书 |-- {1..N}.index.json # 组件/用户索引 |-- {1..N}.{component}.json # 组件元信息 |-- {component}-{version}-{os}-{arch}.tar.gz # 组件二进制包 @@ -34,6 +34,7 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 |-- timestamp.json # 镜像最新时间戳 |--+ commits # 镜像更新日志(可删除) |--+ commit-{ts1..tsN} + |-- {N}.root.json |-- {N}.{component}.json |-- {N}.index.json |-- {component}-{version}-{os}-{arch}.tar.gz @@ -46,7 +47,12 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 |-- {hash}-timestamp.json # 时间戳私钥 ``` -### 镜像根证书 +> **注意: *** +> +> 1. commits 目录是在更新镜像过程中产生的日志,用于回滚镜像,磁盘空间不足时可以定期删除旧的文件夹 +> 2. keys 文件夹中存放的私钥较敏感,建议单独妥善保管 + +### 根证书 在 TiUP 镜像中,根证书用于存放其他元信息文件的公钥,每次获取到任何元信息文件(*.json)都需要根据其文件类型(root,index,snapshot,timestamp)在当前已安装的 root.json 中找到对应的公钥,然后用公钥验证其签名是否合法。 @@ -96,7 +102,7 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 } ``` -## 索引 +### 索引 索引文件记录了镜像中所有的组件已经组件的所有者信息。 @@ -159,4 +165,148 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 "version": {N} # 本文件的版本号,每次更新文件需要创建一个新的 {N+1}.index.json,并将其 version 设置为 N + 1 } } -``` \ No newline at end of file +``` + +### 组件 + +组件元信息文件记录了特定组件的平台以及版本信息。 + +其格式如下: + +``` +{ + "signatures": [ # 该文件的签名 + { + "keyid": "{id-of-index-key-1}", # 第一个参与签名的 key 的 ID + "sig": "{signature-by-index-key-1}", # 该私钥对此文件 signed 部分签名的结果 + }, + ... + { + "keyid": "{id-of-root-key-N}", # 第 N 个参与签名私钥的 ID + "sig": "{signature-by-root-key-N}" # 该私钥对此文件 signed 部分签名的结果 + } + ], + "signed": { + "_type": "component", # 指示该文件类型 + "description": "{description-of-the-component}", # 该组件的描述信息 + "expires": "{expiration-date-of-this-file}", # 该文件的过期时间,过期后客户端会拒绝此文件 + "id": "{component-id}", # 该组件的 id,具有全局唯一性 + "nightly": "{nightly-cursor}", # nightly 游标,值为最新的 nightly 的版本号(如 v5.0.0-nightly-20201209) + "platforms": { # 该组件支持的平台(如 darwin/amd64,linux/arm64 等) + "{platform-pair-1}": { + "{version-1}": { # Semantic Version 版本号(如 v1.0.0 等) + "dependencies": null, # 用于约定组件之间的依赖关系,该字段尚未使用,固定为 null + "entry": "{entry}", # 入口二进制文件位于 tar 包的相对路径 + "hashs": { # tar 包的 checksum,我们使用 sha256 和 sha512 + "sha256": "{sum-of-sha256}", + "sha512": "{sum-of-sha512}", + }, + "length": {length-of-tar}, # tar 包的长度 + "released": "{release-time}", # 该版本的 release 时间 + "url": "{url-of-tar}", # tar 包的下载地址 + "yanked": {bool} # 该版本是否已被禁用 + } + }, + ... + "{platform-pair-N}": { + ... + } + }, + "spec_version": "0.1.0", # 本文件遵循的规范版本,未来变更文件结构需要升级版本号,目前为 0.1.0 + "version": {N} # 本文件的版本号,每次更新文件需要创建一个新的 {N+1}.{component}.json,并将其 version 设置为 N + 1 +} +``` + +### 快照 + +快照文件记录了各个元文件当前的版本号。 + +其格式如下: + +``` +{ + "signatures": [ # 该文件的签名 + { + "keyid": "{id-of-index-key-1}", # 第一个参与签名的 key 的 ID + "sig": "{signature-by-index-key-1}", # 该私钥对此文件 signed 部分签名的结果 + }, + ... + { + "keyid": "{id-of-root-key-N}", # 第 N 个参与签名私钥的 ID + "sig": "{signature-by-root-key-N}" # 该私钥对此文件 signed 部分签名的结果 + } + ], + "signed": { + "_type": "snapshot", # 指示该文件类型 + "expires": "{expiration-date-of-this-file}", # 该文件的过期时间,过期后客户端会拒绝此文件 + "meta": { # 其他元文件的信息 + "/root.json": { + "length": {length-of-json-file}, # root.json 的长度 + "version": {version-of-json-file} # root.json 的 version + }, + "/index.json": { + "length": {length-of-json-file}, + "version": {version-of-json-file} + }, + "/{component-1}.json": { + "length": {length-of-json-file}, + "version": {version-of-json-file} + }, + ... + "/{component-N}.json": { + ... + } + }, + "spec_version": "0.1.0", # 本文件遵循的规范版本,未来变更文件结构需要升级版本号,目前为 0.1.0 + "version": 0 # 本文件的版本号,固定为 0 + } +``` + +### 时间戳 + +时间戳文件记录了当前快照 checksum。 + +其文件格式如下: + +``` +{ + "signatures": [ # 该文件的签名 + { + "keyid": "{id-of-index-key-1}", # 第一个参与签名的 key 的 ID + "sig": "{signature-by-index-key-1}", # 该私钥对此文件 signed 部分签名的结果 + }, + ... + { + "keyid": "{id-of-root-key-N}", # 第 N 个参与签名私钥的 ID + "sig": "{signature-by-root-key-N}" # 该私钥对此文件 signed 部分签名的结果 + } + ], + "signed": { + "_type": "timestamp", # 指示该文件类型 + "expires": "{expiration-date-of-this-file}", # 该文件的过期时间,过期后客户端会拒绝此文件 + "meta": { # snapshot.json 的信息 + "/snapshot.json": { + "hashes": { + "sha256": "{sum-of-sha256}" # snapshot.json 的 sha256 + }, + "length": {length-of-json-file} # snapshot.json 的长度 + } + }, + "spec_version": "0.1.0", # 本文件遵循的规范版本,未来变更文件结构需要升级版本号,目前为 0.1.0 + "version": {N} # 本文件的版本号,每次更新文件需要覆盖 timestamp.json,并将其 version 设置为 N + 1 +``` + +## 客户端工作流程 + +客户端通过以下逻辑保证从镜像下载到的文件是安全的: + +- 客户端安装时随 binary 附带了一个 root.json +- 客户端运行时以已有的 root.json 为基础,做如下操作: + 1. 获取 root.json 中的 version,记为 N + 2. 向镜像请求 {N+1}.root.json,若成功,使用 root.json 中记录的公钥验证该文件是否合法 +- 向镜像请求 timestamp.json,并使用 root.json 中记录的公钥验证该文件是否合法 +- 检查 timestamp.json 中记录的 snapshot.json 的 checksum 和本地的 snapshot.json 的 checksum 是否吻合 + - 若不吻合,则向镜像请求最新的 snapshot.json 并使用 root.json 中记录的公钥验证该文件是否合法 +- 对于 index.json 文件,从 snapshot.json 中获取其版本号 N,并请求 {N}.index.json,然后使用 root.json 中记录的公钥验证该文件是否合法 +- 对于组件(如 tidb.json,tikv.json),从 snapshot.json 中获取其版本号 N,并请求 {N}.{component}.json,然后使用 index.json 中记录的公钥验证该文件是否合法 +- 对于组件 tar 文件,从 {component}.json 中获取其 url 及 checksum,请求 url 得到 tar 包,并验证 checksum 是否正确 \ No newline at end of file From 724aea0c724e4946883ca7b9eeabe33727d0924f Mon Sep 17 00:00:00 2001 From: lucklove Date: Thu, 10 Dec 2020 21:17:01 +0800 Subject: [PATCH 06/56] Add tiup mirror command --- tiup/tiup-command-clean.md | 9 +++++++++ tiup/tiup-command-mirror.md | 40 +++++++++++++++++++++++++++++++++++++ tiup/tiup-reference.md | 2 +- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tiup/tiup-command-mirror.md diff --git a/tiup/tiup-command-clean.md b/tiup/tiup-command-clean.md index 29f517384e2a..7b7aa9c2f844 100644 --- a/tiup/tiup-command-clean.md +++ b/tiup/tiup-command-clean.md @@ -11,9 +11,18 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-clean/'] ## 语法 +```sh +tiup clean [name] [flags] +``` +`[name]` 代表 [status 命令](/tiup/tiup-command-status.md)输出的 `Name` 字段。若省略 ``,则必须配合 `--all` 使用。 ## 选项 +### --all (boolean, 默认 false) + +清除所有运行记录。 ## 输出 + +Clean instance of `%s`, directory: %s \ No newline at end of file diff --git a/tiup/tiup-command-mirror.md b/tiup/tiup-command-mirror.md new file mode 100644 index 000000000000..0454a006643e --- /dev/null +++ b/tiup/tiup-command-mirror.md @@ -0,0 +1,40 @@ +--- +title: tiup mirror +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror/'] +--- + +# tiup mirror + +## 介绍 + +在 TiUP 中,[镜像](/tiup/tiup-mirror-reference.md)是一个非常重要的概念,目前 TiUP 支持两种形式的镜像: + +- 本地镜像:即 TiUP 客户端和镜像在同一台机器上,客户端通过文件系统访问镜像 +- 远程镜像:即 TiUP 客户端和镜像不在同一台机器上,客户端通过网络访问镜像 + +命令 `tiup mirror` 用于管理镜像,提供了创建镜像,组件发布,密钥管理等多种功能。 + +## 语法 + +```sh +tiup mirror [flags] +``` + +`` 代表子命令,支持的子命令列表请参考下方命令清单。 + +## 选项 + +无 + +## 命令清单 + +- genkey: 生成私钥文件 +- sign: 使用私钥文件对特定文件进行签名 +- init: 创建一个空的镜像 +- set: 设置当前镜像 +- grant: 为当前镜像引入新的组件作者 +- publish: 向当前镜像推送新的组件 +- modify: 修改当前镜像中的组件属性 +- rotate: 更新当前镜像中的根证书 +- clone: 从已有镜像克隆一个新的镜像 +- merge: 合并两个或多个镜像 \ No newline at end of file diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 308763cb042b..5c4622fec747 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -94,7 +94,7 @@ tiup [flags] [args...] # 运行组件 - [uniinstall](/tiup/tiup-command-uninstall.md):卸载组件 - [update](/tiup/tiup-command-update.md):升级已安装的组件 - [status](/tiup/tiup-command-status.md):查看组件运行状态 -- clean:清理组件数据目录 +- [clean](/tiup/tiup-command-clean.md):清理组件数据目录 - mirror:镜像管理 - telemetry:遥测开关 - completion:TiUP 命令补全 From 7d3494407dee3d61feb5fc6a9126bf6564151578 Mon Sep 17 00:00:00 2001 From: lucklove Date: Wed, 16 Dec 2020 20:25:59 +0800 Subject: [PATCH 07/56] More document for mirror --- tiup/tiup-command-mirror-genkey.md | 51 ++++++++++++++++++++++++++++++ tiup/tiup-command-mirror-init.md | 45 ++++++++++++++++++++++++++ tiup/tiup-command-mirror-sign.md | 47 +++++++++++++++++++++++++++ tiup/tiup-command-mirror.md | 6 ++-- tiup/tiup-reference.md | 6 ++-- 5 files changed, 150 insertions(+), 5 deletions(-) create mode 100644 tiup/tiup-command-mirror-genkey.md create mode 100644 tiup/tiup-command-mirror-init.md create mode 100644 tiup/tiup-command-mirror-sign.md diff --git a/tiup/tiup-command-mirror-genkey.md b/tiup/tiup-command-mirror-genkey.md new file mode 100644 index 000000000000..36e89a60f4fb --- /dev/null +++ b/tiup/tiup-command-mirror-genkey.md @@ -0,0 +1,51 @@ +--- +title: tiup mirror genkey +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-genkey/'] +--- + +# tiup mirror genkey + +## 介绍 + +在 TiUP [镜像](/tiup/tiup-mirror-reference.md)的定义中,有三类角色: + +- 镜像管理员:拥有 `root.json`, `index.json`, `snapshot.json` 以及 `timestamp.json` 的修改权限 +- 组件管理员:拥有相关组件的修改权限 +- 普通用户:可以下载并使用组件 + +由于修改文件需要相关的管理员进行签名,因此管理员必须拥有自己的私钥。命令 `tiup mirror genkey` 就是用于生成私钥的。 + +> **最佳实践: *** +> +> 永远不要通过网络传输私钥。 + +## 语法 + +```sh +tiup mirror genkey [flags] +``` + +## 选项 + +### -n, --name(string,默认 private) + +密钥的名字,该名字决定最终生成的文件名,生成的私钥文件路径为:${TIUP_HOME}/keys/{name}.json,其中 `TIUP_HOME` 为 TiUP 的家目录,`name` 为 `-n/--name` 指定的密钥名字。 + +### -p, --public(boolean,默认 false) + +显示当前私钥对应的公钥,当前私钥名字由 `-n/--name` 选项指定。 + +当指定了 `-p/--public` 时,不会创建新的私钥,若 `-n/--name` 指定的私钥不存在,则报错。 + +### --save(boolean,默认 false) + +将公钥信息储存为文件放置于当前目录,文件名称为 `{hash-prefix}-public.json`,其中 `hash-prefix` 为该密钥 ID 的前 16 位。 + +## 输出 + +- 若未指定 `-p/--public`: + - 若指定的密钥已存在:`Key already exists, skipped` + - 若指定的密钥不存在:`private key have been write to ${TIUP_HOME}/keys/{name}.json` +- 若指定 `-p/--public`: + - 若指定的密钥不存在:`Error: open ${TIUP_HOME}/keys/{name}.json: no such file or directory` + - 若指定的密钥存在:输出该密钥对应的公钥内容 diff --git a/tiup/tiup-command-mirror-init.md b/tiup/tiup-command-mirror-init.md new file mode 100644 index 000000000000..23004fe86f17 --- /dev/null +++ b/tiup/tiup-command-mirror-init.md @@ -0,0 +1,45 @@ +--- +title: tiup mirror init +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-init/'] +--- + +# tiup mirror init + +## 介绍 + +命令 `tiup mirror init` 用于初始化一个空的镜像,初始化的镜像不包含任何组件和组件管理员,仅生成以下文件: + +``` ++ # 镜像根目录 +|-- root.json # 镜像根证书 +|-- 1.index.json # 组件/用户索引 +|-- snapshot.json # 镜像最新快照 +|-- timestamp.json # 镜像最新时间戳 +|--+ keys # 镜像私钥(可移动到其他位置) + |-- {hash1..hashN}-root.json # 根证书私钥 + |-- {hash}-index.json # 索引私钥 + |-- {hash}-snapshot.json # 快照私钥 + |-- {hash}-timestamp.json # 时间戳私钥 +``` + +以上文件的具体作用及内容格式请参考[镜像说明](/tiup/tiup-mirror-reference.md)。 + +## 语法 + +```sh +tiup mirror init [flags] +``` + +`` 为本地目录路径,可以为相对路径,TiUP 会以该路径为 mirror-dir,在其中生成文件,若该目录已存在,则必须为空,若该目录不存在,则 TiUP 会自动创建。 + +## 选项 + +### -k, --key-dir(string,默认 {path}/keys) + +指定生成私钥文件的目录,若指定的文件目录不存在,则会自动创建。 + +### 输出 + +- 若成功:无输出 +- 若 `` 不为空:`Error: the target path '%s' is not an empty directory` +- 若 `` 不是目录:`Error: fdopendir: not a directory` \ No newline at end of file diff --git a/tiup/tiup-command-mirror-sign.md b/tiup/tiup-command-mirror-sign.md new file mode 100644 index 000000000000..3ca744554210 --- /dev/null +++ b/tiup/tiup-command-mirror-sign.md @@ -0,0 +1,47 @@ +--- +title: tiup mirror sign +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-sign/'] +--- + +# tiup mirror sign + +## 介绍 + +命令 `tiup mirror sign` 用于对[镜像](/tiup/tiup-mirror-reference.md)中定义的元信息文件(*.json)进行签名,这些文件可能储存在本地文件系统,也可以放在远端使用 http 协议提供签名入口。 + + +## 语法 + +```sh +tiup mirror sign [flags] +``` + +`` 为被签名的文件地址,可以有两种地址: + +- 网络地址:http 或者 https 开头,如 http://172.16.5.5:8080/rotate/root.json +- 本地文件路径:相对路径或绝对路径均可 + +如果是网络地址,该地址必须提供以下功能: + +- 支持以 `http get` 访问,此时应当返回被签名文件的完整内容(包含 signatures 字段) +- 支持以 `http post` 访问,客户端会在 `http get` 返回的内容的 signatures 字段中加上本次的签名 POST 到该地址 + +## 选项 + +### -k, --key (string, 默认 ${TIUP_HOME}/keys/private.json) + +指定用于签名的私钥位置。 + +### --timeout (int,默认 10) + +通过网络签名时网络的访问超时时间,单位为秒。 + +> **使用限制: *** +> +> 只有当 `` 为网络地址时该选项有效。 + +## 输出 + +- 成功:无输出 +- 文件已被指定的 key 签名过:`Error: this manifest file has already been signed by specified key` +- 文件不是合法的 manifest:`Error: unmarshal manifest: %s` \ No newline at end of file diff --git a/tiup/tiup-command-mirror.md b/tiup/tiup-command-mirror.md index 0454a006643e..66a20cc1bbf5 100644 --- a/tiup/tiup-command-mirror.md +++ b/tiup/tiup-command-mirror.md @@ -28,9 +28,9 @@ tiup mirror [flags] ## 命令清单 -- genkey: 生成私钥文件 -- sign: 使用私钥文件对特定文件进行签名 -- init: 创建一个空的镜像 +- [genkey](/tiup/tiup-command-mirror-genkey.md): 生成私钥文件 +- [sign](/tiup/tiup-command-mirror-sign.md): 使用私钥文件对特定文件进行签名 +- [init](/tiup/tiup-command-mirror-init.md): 创建一个空的镜像 - set: 设置当前镜像 - grant: 为当前镜像引入新的组件作者 - publish: 向当前镜像推送新的组件 diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 5c4622fec747..3df381c25123 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -73,7 +73,9 @@ tiup [flags] [args...] # 运行组件 ### --skip-version-check (boolean,默认 false) -已废弃 +跳过版本号合法性检查,默认指定的版本号只能是 Semantic Version。 + +***deprecated*** ### -T, --tag (string) @@ -95,7 +97,7 @@ tiup [flags] [args...] # 运行组件 - [update](/tiup/tiup-command-update.md):升级已安装的组件 - [status](/tiup/tiup-command-status.md):查看组件运行状态 - [clean](/tiup/tiup-command-clean.md):清理组件数据目录 -- mirror:镜像管理 +- [mirror](/tiup/tiup-command-mirror.md):镜像管理 - telemetry:遥测开关 - completion:TiUP 命令补全 - env:查看 TiUP 相关环境变量 From cfe4a2cdc459a4496d30a2a60fe6870ff70f000c Mon Sep 17 00:00:00 2001 From: lucklove Date: Thu, 17 Dec 2020 16:05:26 +0800 Subject: [PATCH 08/56] Add doc --- tiup/tiup-command-list.md | 4 +-- tiup/tiup-command-mirror-genkey.md | 2 +- tiup/tiup-command-mirror-grant.md | 42 ++++++++++++++++++++++++++ tiup/tiup-command-mirror-set.md | 47 ++++++++++++++++++++++++++++++ tiup/tiup-command-mirror-sign.md | 2 +- tiup/tiup-command-mirror.md | 4 +-- tiup/tiup-command-status.md | 2 +- tiup/tiup-mirror-reference.md | 4 +-- tiup/tiup-reference.md | 4 +-- 9 files changed, 100 insertions(+), 11 deletions(-) create mode 100644 tiup/tiup-command-mirror-grant.md create mode 100644 tiup/tiup-command-mirror-set.md diff --git a/tiup/tiup-command-list.md b/tiup/tiup-command-list.md index 90d2733e7c9b..efd5b38ee7e2 100644 --- a/tiup/tiup-command-list.md +++ b/tiup/tiup-command-list.md @@ -34,8 +34,8 @@ tiup list [component] [flags] ## 输出 - 若未指定 `[component]` - - 若指定 --verbose:输出 `组件名(Name)`,`已安装版本(Installed)`, `组件所有者(Owner)`,`组件描述(Owner)` 构成的组件信息列表 - - 若不指定 --verbose:输出 `组件名(Name)`,`组件所有者(Owner)`,`组件描述(Owner)` 构成的组件信息列表 + - 若指定 --verbose:输出 `组件名(Name)`,`已安装版本(Installed)`, `组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 + - 若不指定 --verbose:输出 `组件名(Name)`,`组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 - 若指定 `[component]` - 若 `[component]` 存在:输出 `版本(Version)`,`是否已安装(Installed)`,`发布时间(Release)`,`支持的平台(Platforms)` 构成的版本信息列表 - 若 `[component]` 不存在:报错 `failed to fetch component: unknown component` \ No newline at end of file diff --git a/tiup/tiup-command-mirror-genkey.md b/tiup/tiup-command-mirror-genkey.md index 36e89a60f4fb..476d7e6ccfb5 100644 --- a/tiup/tiup-command-mirror-genkey.md +++ b/tiup/tiup-command-mirror-genkey.md @@ -15,7 +15,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-genkey/'] 由于修改文件需要相关的管理员进行签名,因此管理员必须拥有自己的私钥。命令 `tiup mirror genkey` 就是用于生成私钥的。 -> **最佳实践: *** +> **最佳实践:** > > 永远不要通过网络传输私钥。 diff --git a/tiup/tiup-command-mirror-grant.md b/tiup/tiup-command-mirror-grant.md new file mode 100644 index 000000000000..9df90062dd12 --- /dev/null +++ b/tiup/tiup-command-mirror-grant.md @@ -0,0 +1,42 @@ +--- +title: tiup mirror grant +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-grant/'] +--- + +# tiup mirror grant + +## 介绍 + +命令 `tiup mirror grant` 用来向当前镜像中引入一个组件管理员。 + +组件管理员可以使用其密钥发布新的组件,也可以对其之前发布的组件作出修改,添加组件管理员时,该组件管理员需要先将其公钥发送给镜像管理员,镜像管理员使用此命令将其加入。 + +> **使用限制:** +> +> 该命令仅支持在当前镜像为本地镜像时使用。 + +## 语法 + +```sh +tiup mirror grant [flags] +``` + +`` 为该组件管理员的 ID,该 ID 需要在整个镜像中唯一,建议使用符合正则 `^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$` 的字符串。 + +## 选项 + +### -k, --key(string,默认 ${TIUP_HOME}/keys/private.json) + +指定引入的组件管理员的密钥,该密钥可以是公钥也可以是私钥,如果传入私钥,会被转换成对应的公钥储存在镜像中。 + +一个密钥只能被一个组件管理员使用。 + +### -n, --name(string,默认 ) + +指定组件管理员的名字,该名字会展示在组件列表的 `Owner` 字段上,若未指定 `-n/--name` 则使用 `` 作为组件管理员名字。 + +### 输出 + +- 若执行成功:无输出 +- 若管理员 ID 重复:`Error: owner %s exists` +- 若密钥已被其他管理员使用:`Error: key %s exists` \ No newline at end of file diff --git a/tiup/tiup-command-mirror-set.md b/tiup/tiup-command-mirror-set.md new file mode 100644 index 000000000000..16c1b6d65531 --- /dev/null +++ b/tiup/tiup-command-mirror-set.md @@ -0,0 +1,47 @@ +--- +title: tiup mirror set +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-set/'] +--- + +# tiup mirror set + +## 介绍 + +命令 `tiup mirror set` 用于切换当前镜像,支持本地文件系统镜像和远程网络镜像两种镜像。 + +官方镜像为 `https://tiup-mirrors.pingcap.com` + +## 语法 + +```sh +tiup mirror set [flags] +``` + +`` 为镜像地址,可以有两种形式: + +- 网络地址:http 或者 https 开头,如 http://172.16.5.5:8080,https://tiup-mirrors.pingcap.com 等 +- 本地文件路径:镜像目录的绝对路径 + +## 选项 + +### -r, --root(string,默认 `{mirror-dir}/root.json`) + +指定根证书。 + +每个镜像的根证书不相同,而根证书是镜像安全性最关键的一环,在使用网络镜像时,可能遭受中间人攻击,为了避免此类攻击,推荐手动将根网络镜像的根证书下载到本地: + +``` +wget /root.json -O /path/to/local/root.json +``` + +然后进行人工查验,认定无误之后,再通过手工指定根证书的方式切换镜像: + +``` +tiup mirror set -r /path/to/local/root.json +``` + +在这种操作方式下,如果中间人在 `wget` 之前攻击了镜像,我们能发现根证书不正确,如果在 `wget` 之后攻击了镜像,TiUP 会发现镜像和根证书不符。 + +## 输出 + +无 \ No newline at end of file diff --git a/tiup/tiup-command-mirror-sign.md b/tiup/tiup-command-mirror-sign.md index 3ca744554210..46cde1f6011a 100644 --- a/tiup/tiup-command-mirror-sign.md +++ b/tiup/tiup-command-mirror-sign.md @@ -36,7 +36,7 @@ tiup mirror sign [flags] 通过网络签名时网络的访问超时时间,单位为秒。 -> **使用限制: *** +> **使用限制:** > > 只有当 `` 为网络地址时该选项有效。 diff --git a/tiup/tiup-command-mirror.md b/tiup/tiup-command-mirror.md index 66a20cc1bbf5..abdffa67bcca 100644 --- a/tiup/tiup-command-mirror.md +++ b/tiup/tiup-command-mirror.md @@ -31,8 +31,8 @@ tiup mirror [flags] - [genkey](/tiup/tiup-command-mirror-genkey.md): 生成私钥文件 - [sign](/tiup/tiup-command-mirror-sign.md): 使用私钥文件对特定文件进行签名 - [init](/tiup/tiup-command-mirror-init.md): 创建一个空的镜像 -- set: 设置当前镜像 -- grant: 为当前镜像引入新的组件作者 +- [set](/tiup/tiup-command-mirror-set.md): 设置当前镜像 +- [grant](/tiup/tiup-command-mirror-grant.md): 为当前镜像引入新的组件作者 - publish: 向当前镜像推送新的组件 - modify: 修改当前镜像中的组件属性 - rotate: 更新当前镜像中的根证书 diff --git a/tiup/tiup-command-status.md b/tiup/tiup-command-status.md index f8b3edd30218..eee7e5946446 100644 --- a/tiup/tiup-command-status.md +++ b/tiup/tiup-command-status.md @@ -9,7 +9,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-status/'] 命令 `tiup status` 查看组件运行信息:通过 `tiup [flags] [args...]` 运行组件之后,可以通过该命令查看组件的运行信息。 -> **使用限制: *** +> **使用限制:** > > 只能查询到以下两种组件的信息: > 1. 尚在运行的组件 diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index 9e3a610e4e2d..25a8b743c23e 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -47,7 +47,7 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 |-- {hash}-timestamp.json # 时间戳私钥 ``` -> **注意: *** +> **注意:** > > 1. commits 目录是在更新镜像过程中产生的日志,用于回滚镜像,磁盘空间不足时可以定期删除旧的文件夹 > 2. keys 文件夹中存放的私钥较敏感,建议单独妥善保管 @@ -126,7 +126,7 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 "components": { # 组件列表 "{component1}": { # 第一个组件的名称 "hidden": {bool}, # 是否是隐藏组件 - "owner": "{owner-id}", # 组件所有者 ID + "owner": "{owner-id}", # 组件管理员 ID "standalone": {bool}, # 该组件是否可独立运行 "url": "/{component}.json", # 获取组件的地址,需要加上版本号:/{N}.{component}.json "yanked": {bool} # 该组件是否已被标记为删除 diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 3df381c25123..d183748bf6f7 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -59,7 +59,7 @@ tiup [flags] [args...] # 运行组件 - 执行 `tiup -B/--binary ` 将打印已安装的 `` 组件的最新稳定版路径,若 `` 组件未安装,则报错 - 执行 `tiup -B/--binary :` 将答应已经安装的 `` 组件的 `` 版本所在的路径,若该版本未安装,则报错 -> **使用限制: *** +> **使用限制:** > > 该选项只能用于 `tiup [flags] [args...]` 格式的命令。 @@ -67,7 +67,7 @@ tiup [flags] [args...] # 运行组件 指定要执行的组件的路径:执行一个组件时,如果不想使用 TiUP 镜像中的二进制文件,可以使用该参数使用自定义路径的二进制文件替换之。 -> **使用限制: *** +> **使用限制:** > > 该选项只能用于 `tiup [flags] [args...]` 格式的命令。 From 0098142b6ff23ffd0f534848188f5b3d14dd46a4 Mon Sep 17 00:00:00 2001 From: lucklove Date: Fri, 18 Dec 2020 20:23:55 +0800 Subject: [PATCH 09/56] Update publish document --- tiup/tiup-command-mirror-publish.md | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tiup/tiup-command-mirror-publish.md diff --git a/tiup/tiup-command-mirror-publish.md b/tiup/tiup-command-mirror-publish.md new file mode 100644 index 000000000000..ac35ee5e7bbe --- /dev/null +++ b/tiup/tiup-command-mirror-publish.md @@ -0,0 +1,61 @@ +--- +title: tiup mirror publish +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-publish/'] +--- + +# tiup mirror publish + +## 介绍 + +命令 `tiup mirror publish` 用于发布新组件,或已有组件的新版本。只有合法的组件管理员才可以发布组件,组件管理员的引入方式参考[grant命令](/tiup/tiup-command-mirror-grant.md)。 + +## 语法 + +```sh +tiup mirror publish [flags] +``` + +各个参数解释如下: + +- ``:组件名,如 ,建议使用符合正则 `^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$` 的字符串 +- ``:当前正在发布的版本,需要符合 [Semantic Versioning](https://semver.org/) +- ``:`.tar.gz` 包的本地路径,需要将组件的可执行文件及依赖放在该包中,由 TiUP 上传到镜像 +- ``:组件的可执行文件在 `` 中的位置 + +## 选项 + +### -k, --key(string,默认 ${TIUP_HOME}/keys/private.json) + +组件管理员的私钥,客户端需要使用该私钥对组件信息 (`{component}.json`) 进行签名。 + +### --arch(string,默认 ${GOARCH}) + +该 `` 中的二进制文件运行的平台,一个 `` 只能选以下三个平台之一: + +- amd64:表示在 amd64 架构的机器上运行 +- arm64:表示在 arm64 架构的机器上运行 +- any:表示可以在以上两种架构的机器上运行(比如脚本) + +> **注意:** +> +> 若 `--arch` 指定为 `any`,则 `--os` 也必须指定为 `any`。 + +### --os(string,默认 ${GOOS}) + +该 `` 中的二进制文件运行的操作系统,一个 `` 只能选以下三个操作系统之一: + +- linux:表示在 Linux 操作系统上运行 +- darwin:表示在 Darwin 操作系统上运行 +- any:表示可以在以上两种操作系统上运行(比如脚本) + +> **注意:** +> +> 若 `--os` 指定为 `any`,则 `--arch` 也必须指定为 `any`。 + +### --desc(string,默认为空) + +该组件的描述信息。 + +### --hide(boolean,默认 false) + +是否为隐藏组件,若为隐藏组件,则不在 `tiup list` 的列表中显示,但是 `tiup list --all` 可看到。 \ No newline at end of file From 448f74f63612730950dd99fec02ecb6657fdbf7e Mon Sep 17 00:00:00 2001 From: lucklove Date: Tue, 22 Dec 2020 20:05:39 +0800 Subject: [PATCH 10/56] Update document for mirror --- tiup/tiup-command-mirror-clone.md | 41 +++++++++++++++++++ tiup/tiup-command-mirror-modify.md | 57 +++++++++++++++++++++++++++ tiup/tiup-command-mirror-publish.md | 15 ++++++- tiup/tiup-command-mirror-rotate.md | 61 +++++++++++++++++++++++++++++ tiup/tiup-command-mirror.md | 8 ++-- 5 files changed, 176 insertions(+), 6 deletions(-) create mode 100644 tiup/tiup-command-mirror-clone.md create mode 100644 tiup/tiup-command-mirror-modify.md create mode 100644 tiup/tiup-command-mirror-rotate.md diff --git a/tiup/tiup-command-mirror-clone.md b/tiup/tiup-command-mirror-clone.md new file mode 100644 index 000000000000..7746f240f3d3 --- /dev/null +++ b/tiup/tiup-command-mirror-clone.md @@ -0,0 +1,41 @@ +--- +title: tiup mirror clone +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-clone/'] +--- + +# tiup mirror clone + +## 介绍 + +命令 `tiup mirror clone` 用于从一个已经存在的镜像上克隆或部分克隆出一个新的镜像,新的镜像和旧的镜像组件/部分组件相同,但使用的密钥不同。 + +## 语法 + +```sh +tiup mirror clone [global version] [flags] +``` + +- `` 是本地存放克隆下来的镜像的路径,如果不存在则会自动创建 +- `[global version]` 若指定了该参数,会尝试克隆所有组件的该版本,若某些组件没有该版本,则克隆其最新版本 + +## 选项 + +### -f, --full(boolean,默认 false) + +是否克隆整个镜像,指定该选项后会完整从目标镜像克隆所有组件的所有版本,此时其他选项的指定与否将没有意义。 + +### -a, --arch(strings,默认 amd64,arm64) + +仅克隆能在指定平台上运行的组件。 + +### -o, --os(strings,默认 linux,darwin) + +仅克隆能在指定操作系统上运行的组件。 + +### --prefix(boolean,默认 false) + +匹配版本时是否前缀匹配,默认情况下必须严格匹配指定的版本才会下载,指定该选项之后,仅前缀匹配指定的版本也会被下载。 + +### --{component}(strings,默认为空) + +指定要克隆的 `{component}` 组件的版本列表, `{component}` 为组件名,可选的组件名可执行 [tiup list --all](/tiup/tiup-command-list.md) 查看。 \ No newline at end of file diff --git a/tiup/tiup-command-mirror-modify.md b/tiup/tiup-command-mirror-modify.md new file mode 100644 index 000000000000..7abc3233d9d8 --- /dev/null +++ b/tiup/tiup-command-mirror-modify.md @@ -0,0 +1,57 @@ +--- +title: tiup mirror modify +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-modify/'] +--- + +# tiup mirror modify + +## 介绍 + +命令 `tiup mirror modify` 用于修改已发布的组件。只有合法的组件管理员才可以修改组件,且只能修改其自己发布的组件,组件发布方式参考[publish 命令](/tiup/tiup-command-mirror-publish.md)。 + +## 语法 + +```sh +tiup mirror modify [:version] [flags] +``` + +各个参数解释如下: + +- ``:组件名称 +- `[version]`:想要修改的版本,若不指定,则表示修改整个组件 + +## 选项 + +### -k, --key(string,默认 ${TIUP_HOME}/keys/private.json) + +组件管理员的私钥,客户端需要使用该私钥对组件信息 (`{component}.json`) 进行签名。 + +### --yank(boolean,默认 false) + +将指定组件或指定版本标记为不可用: + +- 标记组件不可用之后 `tiup list` 将看不到该组件,也无法安装该组件的新版本 +- 标记版本不可用之后 `tiup list ` 将看不到该版本,也无法安装该版本 + +### --hide(boolean,默认 false) + +将该组件设置为隐藏,隐藏之后该组件将不在 `tiup list` 的列表中显示,但是 `tiup list --all` 可看到。 + +> **注意:** +> +> 该选项只能应用于组件上,无法应用于组件的版本上。 + +### --standalone(boolean,默认 false) + +该组件是否独立可运行的组件,该参数尚未使用,将在未来启用。 + +> **注意:** +> +> 该选项只能应用于组件上,无法应用于组件的版本上。 + +## 输出 + +- 若成功:无输出 +- 若该组件管理员无权修改目标组件: + - 若使用远程镜像:`Error: The server refused, make sure you have access to this component` + - 若使用本地镜像:`Error: the signature is not correct` \ No newline at end of file diff --git a/tiup/tiup-command-mirror-publish.md b/tiup/tiup-command-mirror-publish.md index ac35ee5e7bbe..1963645ae799 100644 --- a/tiup/tiup-command-mirror-publish.md +++ b/tiup/tiup-command-mirror-publish.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-publish/'] ## 介绍 -命令 `tiup mirror publish` 用于发布新组件,或已有组件的新版本。只有合法的组件管理员才可以发布组件,组件管理员的引入方式参考[grant命令](/tiup/tiup-command-mirror-grant.md)。 +命令 `tiup mirror publish` 用于发布新组件,或已有组件的新版本。只有合法的组件管理员才可以发布组件,组件管理员的引入方式参考[grant 命令](/tiup/tiup-command-mirror-grant.md)。 ## 语法 @@ -58,4 +58,15 @@ tiup mirror publish [flags] ### --hide(boolean,默认 false) -是否为隐藏组件,若为隐藏组件,则不在 `tiup list` 的列表中显示,但是 `tiup list --all` 可看到。 \ No newline at end of file +是否为隐藏组件,若为隐藏组件,则不在 `tiup list` 的列表中显示,但是 `tiup list --all` 可看到。 + +### --standalone(boolean,默认 false) + +该组件是否独立可运行的组件,该参数尚未使用,将在未来启用。 + +## 输出 + +- 若成功:无输出 +- 若该组件管理员无权修改目标组件: + - 若使用远程镜像:`Error: The server refused, make sure you have access to this component` + - 若使用本地镜像:`Error: the signature is not correct` \ No newline at end of file diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md new file mode 100644 index 000000000000..8fb58885ed5e --- /dev/null +++ b/tiup/tiup-command-mirror-rotate.md @@ -0,0 +1,61 @@ +--- +title: tiup mirror rotate +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-rotate/'] +--- + +# tiup mirror rotate + +## 介绍 + +TiUP 的镜像中有一个非常重要的文件:root.json,里面记录了整个系统需要使用的公钥,是 TiUP 信任链的基础,它的内容主要包含几个部分: + +- N 个管理员的签名,对于官方镜像, N 为 5,默认初始化的镜像 N 为 3 +- 用于验证以下文件的公钥: + - root.json + - index.json + - snapshot.json + - timestamp.json +- 过期时间,对于官方镜像,为 root.json 创建时间后延一年 + +关于镜像的详细介绍可以参考[镜像说明](/tiup/tiup-mirror-reference.md)。 + +在某些情况下,我们需要更新 root.json: + +- 更换镜像的密钥 +- 更新证书过期时间 + +更新 root.json 内容之后,必须由管理员对其进行重新签名,否则客户端会拒绝,更新流程如下: + +- 更新 root.json 的内容 +- N 个管理员对新的 root.json 进行签名 +- 更新 snapshot.json,记录新的 root.json 的 version +- 对新的 snapshot.json 进行签名 +- 更新 timestamp.json,记录新的 snapshot.json 的 hash +- 对新的 timestamp.json 进行签名 + +TiUP 使用命令 `tiup mirror rotate` 来自动化以上流程。 + +> **注意:** +> +> 经测试,[小于 TiUP v1.3.0 的版本无法正确获得新的 root.json](https://github.com/pingcap/tiup/issues/983)。 +> 使用此功能前请确保所有的 TiUP 客户端升级到了 v1.3.0 及其以上版本。 + +## 语法 + +```sh +tiup mirror rotate [flags] +``` + +该命令会启动一个编辑器,修改其内容为目标值(比如将 expires 字段的值向后推移),然后需要将 version 字段加一,保存。保存之后会启动一个临时的 http 服务器,等待 N 个 不同的镜像管理员签名。 + +镜像管理员签名的方式参考[sign 命令](/tiup/tiup-command-mirror-sign.md)。 + +## 选项 + +### --addr(string,默认 0.0.0.0:8080) + +临时服务器的监听地址,需要确保该地址可以被其他镜像管理员访问,这样他们才能使用[sign 命令](/tiup/tiup-command-mirror-sign.md)签名。 + +## 输出 + +- 各个镜像管理员当前的签名状态 \ No newline at end of file diff --git a/tiup/tiup-command-mirror.md b/tiup/tiup-command-mirror.md index abdffa67bcca..e3a948a2c07e 100644 --- a/tiup/tiup-command-mirror.md +++ b/tiup/tiup-command-mirror.md @@ -33,8 +33,8 @@ tiup mirror [flags] - [init](/tiup/tiup-command-mirror-init.md): 创建一个空的镜像 - [set](/tiup/tiup-command-mirror-set.md): 设置当前镜像 - [grant](/tiup/tiup-command-mirror-grant.md): 为当前镜像引入新的组件作者 -- publish: 向当前镜像推送新的组件 -- modify: 修改当前镜像中的组件属性 -- rotate: 更新当前镜像中的根证书 -- clone: 从已有镜像克隆一个新的镜像 +- [publish](/tiup/tiup-command-mirror-publish.md): 向当前镜像推送新的组件 +- [modify](/tiup/tiup-command-mirror-modify.md): 修改当前镜像中的组件属性 +- [rotate](/tiup/tiup-command-mirror-rotate.md): 更新当前镜像中的根证书 +- [clone](/tiup/tiup-command-mirror-rotate.md): 从已有镜像克隆一个新的镜像 - merge: 合并两个或多个镜像 \ No newline at end of file From 637a92f27788f16dc63d05aa6b110af1e07f12a0 Mon Sep 17 00:00:00 2001 From: lucklove Date: Thu, 24 Dec 2020 20:22:57 +0800 Subject: [PATCH 11/56] Finish the command section --- tiup/tiup-command-completion.md | 46 ++++++++++++++++++++++++++++++ tiup/tiup-command-env.md | 29 +++++++++++++++++++ tiup/tiup-command-help.md | 26 +++++++++++++++++ tiup/tiup-command-mirror-merge.md | 33 ++++++++++++++++++++++ tiup/tiup-command-mirror.md | 2 +- tiup/tiup-command-telemetry.md | 47 +++++++++++++++++++++++++++++++ tiup/tiup-reference.md | 8 +++--- 7 files changed, 186 insertions(+), 5 deletions(-) create mode 100644 tiup/tiup-command-completion.md create mode 100644 tiup/tiup-command-env.md create mode 100644 tiup/tiup-command-help.md create mode 100644 tiup/tiup-command-mirror-merge.md create mode 100644 tiup/tiup-command-telemetry.md diff --git a/tiup/tiup-command-completion.md b/tiup/tiup-command-completion.md new file mode 100644 index 000000000000..4aab051b84a7 --- /dev/null +++ b/tiup/tiup-command-completion.md @@ -0,0 +1,46 @@ +--- +title: tiup completion +aliases: ['/docs-cn/dev/tiup/tiup-command-completion/'] +--- + +# tiup completion + +## 介绍 + +为了记忆命令的心智负担,TiUP 提供了 `tiup completion` 命令用于生成命令行自动补全的配置文件,目前支持 `bash` 和 `zsh` 两种 shell 的命令补全。 + +如果是 bash,需要提前安装好 bash-completion: + +- macOS 的安装方式为:`brew install bash-completion` 或者 `brew install bash-completion@2`(Bash 4.1+) +- Linux 的安装方式为:使用包管理器安装 `bash-completion` 包 + +## 语法 + +```sh +tiup completion +``` + +`` 为 shell 类型,目前支持 `bash` 和 `zsh`。 + +## 使用方式 + +### bash + +将自动补全代码写入一个文件,并且在 .bash_profile 中 source 之: + +```sh +tiup completion bash > ~/.completion.bash.inc + +printf " +# tiup shell completion +source '$HOME/.completion.bash.inc' +" >> $HOME/.bash_profile + +source $HOME/.bash_profile +``` + +### zsh + +```sh +tiup completion zsh > "${fpath[1]}/_tiup" +``` \ No newline at end of file diff --git a/tiup/tiup-command-env.md b/tiup/tiup-command-env.md new file mode 100644 index 000000000000..09990913586f --- /dev/null +++ b/tiup/tiup-command-env.md @@ -0,0 +1,29 @@ +--- +title: tiup env +aliases: ['/docs-cn/dev/tiup/tiup-command-env/'] +--- + +# tiup env + +## 介绍 + +TiUP 为用户提供了灵活的定制化接口,其中一部分是使用环境变量来实现的,命令 `tiup env` 用于查询 TiUP 支持用户自定义的环境变量以及它们此时的值。 + +## 语法 + +```sh +tiup env [name1...N] +``` + +`[name1...N]` 用于查看指定的环境变量,若不指定,则查看所有支持的环境变量。 + +## 选项 + +无 + +## 输出 + +- 若未指定 `[name1...N]`,则输出 "{key}"="{value}" 列表 +- 若指定了 `[name1...N]`,则按顺序输出 "{value}" 列表 + +以上输出若 value 为空则代表其未设置,TiUP 会采用默认行为。 \ No newline at end of file diff --git a/tiup/tiup-command-help.md b/tiup/tiup-command-help.md new file mode 100644 index 000000000000..fc73fe6d109e --- /dev/null +++ b/tiup/tiup-command-help.md @@ -0,0 +1,26 @@ +--- +title: tiup help +aliases: ['/docs-cn/dev/tiup/tiup-command-help/'] +--- + +# tiup help + +## 介绍 + +TiUP 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得,基本上,`tiup help ` 等价于 `tiup --help`。 + +## 语法 + +```sh +tiup help [command] +``` + +`[command]` 用于指定要查看哪个命令的帮助信息,若不指定,则查看 TiUP 自身的帮助信息。 + +## 选项 + +无 + +## 输出 + +`[command]` 或 TiUP 的帮助信息。 \ No newline at end of file diff --git a/tiup/tiup-command-mirror-merge.md b/tiup/tiup-command-mirror-merge.md new file mode 100644 index 000000000000..1c4cd0302491 --- /dev/null +++ b/tiup/tiup-command-mirror-merge.md @@ -0,0 +1,33 @@ +--- +title: tiup mirror merge +aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-merge/'] +--- + +# tiup mirror merge + +## 介绍 + +命令 `tiup mirror merge` 用于合并一个或多个镜像到当前镜像。在合并之前,需要使用命令 [tiup mirror set](/tiup/tiup-command-mirror-set.md) 指定当一个有权限发布组件的前镜像。 + +执行此命令需要满足几个条件: + +- 目标镜像的所有组件的管理员 ID 必须在当前镜像中存在 +- 执行该命令的用户的 `${TIUP_HOME}/keys` 目录中有上述管理员 ID 在当前镜像中对应的所有的私钥 + +## 语法 + +```sh +tiup mirror merge [mirror-dir-N] [flags] +``` + +- ``:要合并到当前镜像的第一个镜像 +- `[mirror-dir-N]`:要合并到当前镜像的第 N 个镜像 + +## 选项 + +无 + +## 输出 + +- 成功:无输出 +- 当前镜像缺失目标镜像某个组件的管理员,或 `${TIUP_HOME}/keys` 缺失该管理员的私钥:`Error: missing owner keys for owner %s on component %s` \ No newline at end of file diff --git a/tiup/tiup-command-mirror.md b/tiup/tiup-command-mirror.md index e3a948a2c07e..10d642c87b9b 100644 --- a/tiup/tiup-command-mirror.md +++ b/tiup/tiup-command-mirror.md @@ -37,4 +37,4 @@ tiup mirror [flags] - [modify](/tiup/tiup-command-mirror-modify.md): 修改当前镜像中的组件属性 - [rotate](/tiup/tiup-command-mirror-rotate.md): 更新当前镜像中的根证书 - [clone](/tiup/tiup-command-mirror-rotate.md): 从已有镜像克隆一个新的镜像 -- merge: 合并两个或多个镜像 \ No newline at end of file +- [merge](/tiup/tiup-command-mirror-merge.md): 合并镜像 \ No newline at end of file diff --git a/tiup/tiup-command-telemetry.md b/tiup/tiup-command-telemetry.md new file mode 100644 index 000000000000..37d04f890435 --- /dev/null +++ b/tiup/tiup-command-telemetry.md @@ -0,0 +1,47 @@ +--- +title: tiup telemetry +aliases: ['/docs-cn/dev/tiup/tiup-command-telemetry/'] +--- + +# tiup telemetry + +## 介绍 + +TiDB、TiUP 及 TiDB Dashboard 默认会收集使用情况信息,并将这些信息分享给 PingCAP 用于改善产品,例如,通过这些使用情况信息,PingCAP 可以了解常见的 TiDB 集群操作,从而确定新功能优先级。 + +当 TiUP 遥测功能开启时,执行 TiUP 命令时将会将使用情况信息分享给 PingCAP,包括(但不限于): + +- 随机生成的遥测标示符 +- TiUP 命令的执行情况,如命令执行是否成功、命令执行耗时等 +- 使用 TiUP 进行部署的情况,如部署的目标机器硬件信息、组件版本号、修改过的部署配置名称等 + +TiUP 使用命令 `tiup telemetry` 来控制遥测。 + +## 语法 + +```sh +tiup telemetry +``` + +`` 代表子命令,支持的子命令列表请参考下方命令一节。 + +## 命令 + +### status + +命令 `tiup telemetry status` 查看当前的遥测设置,输出以下信息: + +- status: 当前是否开启遥测(enable|disable) +- uuid: 随机生成的遥测标示符 + +### reset + +命令 `tiup telemetry reset` 重置当前的遥测标示符,以一个新的随机标识符代替之。 + +### enable + +命令 `tiup telemetry enable` 启用遥测。 + +### disable + +命令 `tiup telemetry disable` 停用遥测。 \ No newline at end of file diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index d183748bf6f7..089f98c226a3 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -98,10 +98,10 @@ tiup [flags] [args...] # 运行组件 - [status](/tiup/tiup-command-status.md):查看组件运行状态 - [clean](/tiup/tiup-command-clean.md):清理组件数据目录 - [mirror](/tiup/tiup-command-mirror.md):镜像管理 -- telemetry:遥测开关 -- completion:TiUP 命令补全 -- env:查看 TiUP 相关环境变量 -- help:查看特定命令或组件的帮助文档 +- [telemetry](/tiup/tiup-command-telemetry.md):遥测开关 +- [completion](/tiup/tiup-command-completion.md):TiUP 命令补全 +- [env](/tiup/tiup-command-env.md):查看 TiUP 相关环境变量 +- [help](/tiup/tiup-command-help.md):查看特定命令或组件的帮助文档 ## 组件清单 From 769ddffbf0a8aa6c14823ee66494368d3c0428dd Mon Sep 17 00:00:00 2001 From: lucklove Date: Wed, 30 Dec 2020 16:52:21 +0800 Subject: [PATCH 12/56] Add topology reference for tiup-cluster --- tiup/tiup-cluster-topology-reference.md | 594 ++++++++++++++++++++++++ tiup/tiup-component-cluster.md | 74 +++ tiup/tiup-dm-topology-reference.md | 0 3 files changed, 668 insertions(+) create mode 100644 tiup/tiup-cluster-topology-reference.md create mode 100644 tiup/tiup-component-cluster.md create mode 100644 tiup/tiup-dm-topology-reference.md diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md new file mode 100644 index 000000000000..9426df1b0eeb --- /dev/null +++ b/tiup/tiup-cluster-topology-reference.md @@ -0,0 +1,594 @@ +--- +title: tiup cluster topology reference +aliases: ['/docs-cn/dev/tiup/tiup-mirror-reference/'] +--- + +# tiup cluster topology reference + +## 介绍 + +在部署或扩容 TiDB 集群时,需要提供一份拓扑文件来描述集群拓扑,同样,修改配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。 + +拓扑文件[示例参考](https://github.com/pingcap/tiup/blob/master/examples/topology.example.yaml)。 + +## 文件结构 + +一个 TiDB 集群的拓扑文件可能包含以下区块: + +- [global](/tiup/tiup-mirror-reference.md#global):集群全局配置,其中一些是集群的默认值,可以在实例里面单独配置 +- [monitored](/tiup/tiup-mirror-reference.md#monitored):监控服务配置,即 blackbox exporter 和 node exporter,每台机器上都会部署一个 node expoter 一个 blackbox exporter +- [server_configs](/tiup/tiup-mirror-reference.md#server_configs):全局服务配置,针对每种组件配置其默认配置,这个配置可以在每个实例里单独覆盖,该配置用于生成服务的配置文件 +- [pd_servers](/tiup/tiup-mirror-reference.md#pd_servers):PD 实例的配置,用来指定 PD 组件部署到哪些机器上 +- [tidb_servers](/tiup/tiup-mirror-reference.md#tidb_servers): TiDB 实例的配置,用来指定 TiDB 组件部署到哪些机器上 +- [tikv_servers](/tiup/tiup-mirror-reference.md#tikv_servers):TiKV 实例的配置,用来指定 TiKV 组件部署到哪些机器上 +- [tiflash_servers](/tiup/tiup-mirror-reference.md#tiflash_servers):TiFlash 实例的配置,用来指定 TiFlash 组件部署到哪些机器上 +- [pump_servers](/tiup/tiup-mirror-reference.md#pump_servers):Pump 实例的配置,用来指定 Pump 组件部署到哪些机器上 +- [drainer_servers](/tiup/tiup-mirror-reference.md#drainer_servers):Drainer 实例的配置,用来指定 Drainer 组件部署到哪些机器上 +- [cdc_servers](/tiup/tiup-mirror-reference.md#cdc_servers):CDC 实例的配置,用来指定 CDC 组件部署到哪些机器上 +- [tispark_masters](/tiup/tiup-mirror-reference.md#tispark_masters):TiSpark Master 实例的配置,用来指定 TiSpark Master 组件部署到哪台机器上,仅允许部署一个 TiSpark Master 节点 +- [tispark_workers](/tiup/tiup-mirror-reference.md#tispark_workers):TiSpark Worker 实例的配置,用来指定 TiSpark Worker 组件部署到哪些机器上 +- [monitoring_servers](/tiup/tiup-mirror-reference.md#monitoring_servers):Prometheus 实例的配置,用来指定 Prometheus 部署在哪台机器上 +- [grafana_servers](/tiup/tiup-mirror-reference.md#grafana_servers):Grafana 实例的配置,用来指定 Grafana 部署在哪台机器上 +- [alertmanager_servers](/tiup/tiup-mirror-reference.md#alertmanager_servers):Alertemanager 实例的配置,用来指定 Alertmanager 部署在哪台机器上 + +### global + +global 区块集群的全局配置,包含以下字段: + +- user:以什么用户来启动部署的集群,默认值:"tidb",如果 `` 字段指定的用户在目标机器上不存在,会自动尝试创建 +- group:自动创建用户时指定用户所属的用户组,默认和 `` 字段值相同,若指定的组不存在,则自动创建 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,默认值:22 +- enable_tls:是否对集群启用 tls,启用之后集群之间,客户端与集群之间都必须用生成的 tls 证书链接,启用后无法关闭,默认值:false +- deploy_dir:每个组件的默认部署目录,默认值:"deploy",其应用规则如下: + - 如果 `` 为绝对路径,那么组件会部署到 `/-` 目录 + - 如果 `` 为相对路径,那么组件会部署到 `/home///-` 目录 + - 对于在自己的实例中设置了 `deploy_dir` 字段的组件实例,部署路径由实例中的 `deploy_dir` 决定 +- data_dir:默认数据目录, 默认值 "data",其应用规则如下: + - 如果 `` 为绝对路径,那么组件数据将放到 `/-` + - 如果 `` 为相对路径,那么组件数据将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 + - 对于在自己的实例中设置了 `data_dir` 字段的组件实例,数据路径由实例中的 `data_dir` 决定 +- log_dir:默认数据目录, 默认值 "log",其应用规则如下: + - 如果 `` 为绝对路径,那么组件日志将放到 `/-` + - 如果 `` 为相对路径,那么组件日志将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 + - 对于在自己的实例中设置了 `log_dir` 字段的组件实例,日志路径由实例中的 `log_dir` 决定 +- os:目标机器的操作系统,该字段决定了向目标机器推送适配哪个操作系统的组件,默认值:linux +- arch:目标机器的架构,该字段决定了向目标机器推送哪个平台的二进制包,支持 amd64 和 arm64,默认值 amd64 +- resource_control:运行时资源控制,该字段下所有配置都将写入 systemd 的 service 文件中,默认不限制,支持控制的资源: + - memory_limit: 限制运行时最大内存,例如 "2G" 表示最多使用 2G 内存 + - cpu_quota:限制运行时最大 CPU 占用率,例如 "200%" + - io_read_bandwidth_max:读磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" + - io_write_bandwidth_max:写磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" + - limit_core:控制 core dump 大小 + +global 配置示例: + +```yaml +global: + user: "tidb" + resource_control: + memory_limit: "2G" +``` + +### monitored + +monitored 用于配置目标机上的监控服务:node_exporter 和 blackbox_exporter,它包含这些字段: + +- node_exporter_port: node_exporter 的服务端口,默认值 9100 +- blackbox_exporter_port:blackbox_exporter 的服务端口,默认值 9115 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 + +monitored 配置示例: + +```yaml +monitored: + node_exporter_port: 9100 + blackbox_exporter_port: 9115 +``` + +### server_configs + +server_configs 用于配置服务,生成各组件的配置文件,类似 global 区块,该区块内的配置可以在具体的实例中被覆盖。主要包含以下字段: + +- tidb:TiDB 服务的相关配置,支持的所有配置请参考[TiDB 配置文件描述](/tidb-configuration-file.md) +- tikv:TiKV 服务的相关配置,支持的所有配置请参考[TiKV 配置文件描述](/tikv-configuration-file.md) +- pd:PD 服务的相关配置,支持的所有配置请参考[PD 配置文件描述](/pd-configuration-file.md) +- tiflash:TiFlash 服务的相关配置,支持的所有配置请参考[TiFlash 配置参数](/tiflash-configuration.md) +- tiflash_learner:每个 TiFlash 中内置了一个特殊的 TiKV,该配置用于配置这个特殊的 TiKV,一般不建议修改这个配置下的内容 +- pump:pump 服务相关配置,支持的所有配置请参考[TiDB Binlog 配置说明](/tidb-binlog-configuration-file.md#pump) +- drainer:drainer 服务相关配置,支持的所有配置请参考[TiDB Binlog 配置说明](/tidb-binlog-configuration-file.md#drainer) +- cdc:cdc 服务相关配置,支持的所有配置请参考[TiCDC 安装部署](/deploy-ticdc.md) + +server_configs 配置示例: + +```yaml +server_configs: + tidb: + run-ddl: true + lease: "45s" + split-table: true + token-limit: 1000 + tikv: + log-level: "info" + readpool.unified.min-thread-count: 1 +``` + +### pd_servers + +pd_servers 约定了将 PD 的服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- listen_host:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 host 所指定的 IP +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- name:指定该 PD 实例的名字,不同实例的名字不能相同 +- client_port:指定 pd 的客户端链接端口,默认是 2379 +- peer_port:指定 pd 之间互相通信的端口,默认是 2380 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config:该字段配置规则和 server_configs 里的 pd 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 pd 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- listen_host +- name +- client_port +- peer_port +- deploy_dir +- data_dir +- log_dir +- arch +- os + +pd_servers 配置示例: + +```yaml +pd_servers: + - host: 10.0.1.11 + config: + schedule.max-merge-region-size: 20 + schedule.max-merge-region-keys: 200000 + - host: 10.0.1.12 +``` + +### tidb_servers + +tidb_servers 约定了将 TiDB 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- listen_host:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 host 所指定的 IP +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:TiDB 服务的监听端口,用于提供给 MySQL 客户端连接,默认 4000 +- status_port:TiDB 状态服务的监听端口,用于外部通过 http 请求查看 TiDB 服务的状态,默认 10080 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config:该字段配置规则和 server_configs 里的 tidb 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 tidb 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- listen_host +- port +- status_port +- deploy_dir +- log_dir +- arch +- os + +tidb_servers 配置示例: + +```yaml +tidb_servers: + - host: 10.0.1.14 + config: + log.level: warn + log.slow-query-file: tidb-slow-overwrited.log + - host: 10.0.1.15 +``` + +### tikv_servers + +tikv_servers 约定了将 TiKV 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- listen_host:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 host 所指定的 IP +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:TiKV 服务的监听端口,默认 20160 +- status_port:TiKV 状态服务的监听端口,默认 20180 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config:该字段配置规则和 server_configs 里的 tikv 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 tikv 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- listen_host +- port +- status_port +- deploy_dir +- data_dir +- log_dir +- arch +- os + +tikv_servers 配置示例: + +```yaml +tikv_servers: + - host: 10.0.1.14 + config: + server.labels: { zone: "zone1", host: "host1" } + - host: 10.0.1.15 + config: + server.labels: { zone: "zone1", host: "host2" } +``` + +### tiflash_servers + +tiflash_servers 约定了将 TiFlash 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- tcp_port:TiFlash TCP 服务的端口,默认 9000 +- http_port:TiFlash HTTP 服务的端口,默认 8123 +- flash_service_port:TiFlash 提供服务的端口,TiDB 通过该端口从 TiFlash 读数据,默认 3930 +- metrics_port:TiFlash 的状态端口,用于输出 metric 数据,默认 8234 +- flash_proxy_port:内置 TiKV 的端口,默认 20170 +- flash_proxy_status_port:内置 TiKV 的状态端口,默认为 20292 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成,TiFlash 的数据目录支持多个,采用逗号分割 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- tmp_path: TiFlash 临时文件的存放路径,默认使用 [`path` 或者 `storage.latest.dir` 的第一个目录] + "/tmp" +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config:该字段配置规则和 server_configs 里的 tiflash 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 tiflash 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 +- learner_config:每个 TiFlash 中内置了一个特殊的 TiKV,该配置用于配置这个特殊的 TiKV,一般不建议修改这个配置下的内容 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,data_dir 在部署完成之后只能新增目录,而以下字段在部署完成之后就不能再修改: + +- host +- tcp_port +- http_port +- flash_service_port +- flash_proxy_port +- flash_proxy_status_port +- metrics_port +- deploy_dir +- log_dir +- tmp_path +- arch +- os + +tiflash_servers 配置示例: + +```yaml +tiflash_servers: + - host: 10.0.1.21 + - host: 10.0.1.22 +``` + +### pump_servers + +pump_servers 约定了将 Binlog 组件的 Pump 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:Pump 服务的监听端口,默认 8250 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config:该字段配置规则和 server_configs 里的 pump 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 pump 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- port +- deploy_dir +- data_dir +- log_dir +- arch +- os + +pump_servers 配置示例: + +```yaml +pump_servers: + - host: 10.0.1.21 + config: + gc: 7 + - host: 10.0.1.22 +``` + +### drainer_servers + +drainer_servers 约定了将 Binlog 组件的 Drainer 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:Drainer 服务的监听端口,默认 8249 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- commit_ts:Drainer 启动的时候会去读取 checkpoint,如果读取不到,就会使用该字段做为初次启动开始的同步时间点,该字段默认为 -1(从 PD 总获取最新时间戳作为 commit_ts) +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config:该字段配置规则和 server_configs 里的 drainer 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 drainer 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- port +- deploy_dir +- data_dir +- log_dir +- commit_ts +- arch +- os + +drainer_servers 配置示例: + +```yaml +drainer_servers: + - host: 10.0.1.21 + config: + syncer.db-type: "mysql" + syncer.to.host: "127.0.0.1" + syncer.to.user: "root" + syncer.to.password: "" + syncer.to.port: 3306 + syncer.ignore-table: + - db-name: test + tbl-name: log + - db-name: test + tbl-name: audit +``` + +### cdc_servers + +cdc_servers 约定了将 CDC 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:CDC 服务的监听端口,默认 8300 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- gc-ttl:TiCDC 在 PD 设置的服务级别 GC safepoint 的 TTL (Time To Live) 时长,单位为秒,默认值为 86400,即 24 小时 +- tz:TiCDC 服务使用的时区。TiCDC 在内部转换 timestamp 等时间数据类型和向下游同步数据时使用该时区,默认为进程运行本地时区。 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config:该字段配置规则和 server_configs 里的 cdc 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- port +- deploy_dir +- log_dir +- gc-ttl +- tz +- arch +- os + +cdc_servers 配置示例: + +```yaml +cdc_servers: + - host: 10.0.1.20 + gc-ttl: 86400 + - host: 10.0.1.21 +``` + +### tispark_masters + +tispark_masters 约定了将 TiSpark 的 master 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- listen_host:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 host 所指定的 IP +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:Spark 的监听端口,节点之前通讯用,默认 7077 +- web_port:Spark 的网页端口,提供网页服务,可查看任务情况,默认 8080 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- java_home:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 JAVA_HOME +- spark_config:用于配置 TiSpark 服务,生成配置文件下发到 host 指定的机器 +- spark_env:配置 Spark 启动时的环境变量 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- listen_host +- port +- web_port +- deploy_dir +- arch +- os + +tispark_masters 配置示例: + +```yaml +tispark_masters: + - host: 10.0.1.21 + spark_config: + spark.driver.memory: "2g" + spark.eventLog.enabled: "False" + spark.tispark.grpc.framesize: 2147483647 + spark.tispark.grpc.timeout_in_sec: 100 + spark.tispark.meta.reload_period_in_sec: 60 + spark.tispark.request.command.priority: "Low" + spark.tispark.table.scan_concurrency: 256 + spark_env: + SPARK_EXECUTOR_CORES: 5 + SPARK_EXECUTOR_MEMORY: "10g" + SPARK_WORKER_CORES: 5 + SPARK_WORKER_MEMORY: "10g" + - host: 10.0.1.22 +``` + +### tispark_workers + +tispark_workers 约定了将 TiSpark 的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- listen_host:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 host 所指定的 IP +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:Spark 的监听端口,节点之前通讯用,默认 7077 +- web_port:Spark 的网页端口,提供网页服务,可查看任务情况,默认 8080 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- java_home:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 JAVA_HOME +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- listen_host +- port +- web_port +- deploy_dir +- arch +- os + +tispark_workers 配置示例: + +```yaml +tispark_workers: + - host: 10.0.1.22 + - host: 10.0.1.23 +``` + +### monitoring_servers + +monitoring_servers 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:指定 Prometheus 提供服务的端口,默认是 9090 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- storage_retention:Prometheus 监控数据保留时间,默认 "15d" +- rule_dir:该字段指定一个本地目录,该目录中应当含有完整的 *.rules.yml 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- port +- deploy_dir +- data_dir +- log_dir +- arch +- os + +monitoring_servers 配置示例: + +```yaml +monitoring_servers: + - host: 10.0.1.11 + rule_dir: /local/rule/dir +``` + +### grafana_servers + +grafana_servers 约定了将 Grafana 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:指定 Grafana 提供服务的端口,默认是 3000 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- username:Grafana 登陆界面的用户名 +- password:Grafana 对应的密码 +- dashboard_dir:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +> **注意:** +> +> 如果配置了 grafana_servers 的 dashboard_dir 字段,在执行 tiup cluster rename 命令进行集群重命名后,需要完成以下操作: +> +> 1. 在本地的 dashboards 目录中,将 datasource 字段的值更新为新的集群名(datasource 是以集群名命名的) +> 2. 执行 tiup cluster reload -R grafana 命令 + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- port +- deploy_dir +- arch +- os + +grafana_servers 配置示例: + +```yaml +grafana_servers: + - host: 10.0.1.11 + dashboard_dir: /local/dashboard/dir +``` + +### alertmanager_servers + +alertmanager_servers 约定了将 Alertmanager 服务部署到哪些机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- web_port:指定 Alertmanager 提供网页服务的端口,默认是 9093 +- cluster_port:指定 Alertmanger 和 其他 Alertmanager 通讯的端口,默认是 9094 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config_file:该字段指定一个本地文件,该文件会在集群配置初始化阶段被传输到目标机器上,作为 Alertmanager 的配置 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- web_port +- cluster_port +- deploy_dir +- data_dir +- log_dir +- arch +- os + +alertmanager_servers 配置示例: + +```yaml +alertmanager_servers: + - host: 10.0.1.11 + config_file: /local/config/file + - host: 10.0.1.12 + config_file: /local/config/file +``` \ No newline at end of file diff --git a/tiup/tiup-component-cluster.md b/tiup/tiup-component-cluster.md new file mode 100644 index 000000000000..38c0311f7a5f --- /dev/null +++ b/tiup/tiup-component-cluster.md @@ -0,0 +1,74 @@ +--- +title: TiUP Cluster +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster/'] +--- + +# TiUP Cluster + +## 介绍 + +TiUP Cluster 是 TiUP 提供的使用 Golang 编写的集群管理组件,通过 TiUP cluster 组件就可以进行日常的运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 TiDB 集群;管理 TiDB 集群参数。 + +## 语法 + +```sh +tiup cluster [command] [flags] +``` + +`[command]` 代表命令名字,支持的命令列表请参考下方命令清单。 + +## 选项 + +### --ssh (string,默认 builtin) + +通过哪种 ssh 客户端到远端(部署 TiDB 服务的机器)执行命令,支持以下几个值: + +- builtin:使用 tiup-cluster 内置的 easyssh 客户端 +- system:使用当前操作系统默认的 ssh 客户端 +- none:不使用 ssh 客户端,这种方式只支持部署到当前机器 + +### --ssh-timeout(uint,默认 5) + +设置 ssh 连接超时时间,单位为秒。 + +### --wait-timeout(uint,默认 120) + +设置执行命令的超时时间,单位为秒。 + +### -y, --yes (boolean,默认 false) + +跳过所有二次确认,除非是使用脚本调用 TiUP,否则不推荐使用。 + +### -v, --version(boolean,默认 false) + +输出 tiup-cluster 当前版本信息。 + +### -h, --help(boolean,默认 false) + +输出相关命令的帮助信息。 + +## 命令清单 + +- import:导入 ansible 部署的集群 +- check:部署前后的集群检查 +- deploy:根据指定拓扑部署集群 +- list:查询已部署的集群列表 +- start:启动指定集群 +- display:展示指定集群状态 +- stop:停止指定集群 +- restart:重启指定集群 +- scale-in:缩容指定集群 +- scale-out:扩容指定集群 +- upgrade:升级指定集群 +- exec:在指定集群的指定机器上执行命令 +- prune:销毁指定集群中状态为 tombstone 的实例 +- edit-config:修改指定集群配置 +- reload:重载指定集群配置 +- patch:替换已部署集群的某个服务 +- rename:重命名集群 +- clean:删除指定集群数据 +- destroy:销毁指定集群 +- audit:查询集群操作审计日志 +- enable:开启指定集群或服务开机自启动 +- disable:关闭指定集群或服务开机自启动 +- help:输出帮助信息 \ No newline at end of file diff --git a/tiup/tiup-dm-topology-reference.md b/tiup/tiup-dm-topology-reference.md new file mode 100644 index 000000000000..e69de29bb2d1 From 89feb16902dddb2995f3a9f087d8228d5d4f3a8f Mon Sep 17 00:00:00 2001 From: lucklove Date: Thu, 31 Dec 2020 11:23:46 +0800 Subject: [PATCH 13/56] Document for dm cluster topology --- tiup/tiup-cluster-topology-reference.md | 32 +-- tiup/tiup-dm-topology-reference.md | 294 ++++++++++++++++++++++++ 2 files changed, 310 insertions(+), 16 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index 9426df1b0eeb..2ab93e5edf3f 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -1,6 +1,6 @@ --- title: tiup cluster topology reference -aliases: ['/docs-cn/dev/tiup/tiup-mirror-reference/'] +aliases: ['/docs-cn/dev/tiup/tiup-cluster-topology-reference/'] --- # tiup cluster topology reference @@ -15,21 +15,21 @@ aliases: ['/docs-cn/dev/tiup/tiup-mirror-reference/'] 一个 TiDB 集群的拓扑文件可能包含以下区块: -- [global](/tiup/tiup-mirror-reference.md#global):集群全局配置,其中一些是集群的默认值,可以在实例里面单独配置 -- [monitored](/tiup/tiup-mirror-reference.md#monitored):监控服务配置,即 blackbox exporter 和 node exporter,每台机器上都会部署一个 node expoter 一个 blackbox exporter -- [server_configs](/tiup/tiup-mirror-reference.md#server_configs):全局服务配置,针对每种组件配置其默认配置,这个配置可以在每个实例里单独覆盖,该配置用于生成服务的配置文件 -- [pd_servers](/tiup/tiup-mirror-reference.md#pd_servers):PD 实例的配置,用来指定 PD 组件部署到哪些机器上 -- [tidb_servers](/tiup/tiup-mirror-reference.md#tidb_servers): TiDB 实例的配置,用来指定 TiDB 组件部署到哪些机器上 -- [tikv_servers](/tiup/tiup-mirror-reference.md#tikv_servers):TiKV 实例的配置,用来指定 TiKV 组件部署到哪些机器上 -- [tiflash_servers](/tiup/tiup-mirror-reference.md#tiflash_servers):TiFlash 实例的配置,用来指定 TiFlash 组件部署到哪些机器上 -- [pump_servers](/tiup/tiup-mirror-reference.md#pump_servers):Pump 实例的配置,用来指定 Pump 组件部署到哪些机器上 -- [drainer_servers](/tiup/tiup-mirror-reference.md#drainer_servers):Drainer 实例的配置,用来指定 Drainer 组件部署到哪些机器上 -- [cdc_servers](/tiup/tiup-mirror-reference.md#cdc_servers):CDC 实例的配置,用来指定 CDC 组件部署到哪些机器上 -- [tispark_masters](/tiup/tiup-mirror-reference.md#tispark_masters):TiSpark Master 实例的配置,用来指定 TiSpark Master 组件部署到哪台机器上,仅允许部署一个 TiSpark Master 节点 -- [tispark_workers](/tiup/tiup-mirror-reference.md#tispark_workers):TiSpark Worker 实例的配置,用来指定 TiSpark Worker 组件部署到哪些机器上 -- [monitoring_servers](/tiup/tiup-mirror-reference.md#monitoring_servers):Prometheus 实例的配置,用来指定 Prometheus 部署在哪台机器上 -- [grafana_servers](/tiup/tiup-mirror-reference.md#grafana_servers):Grafana 实例的配置,用来指定 Grafana 部署在哪台机器上 -- [alertmanager_servers](/tiup/tiup-mirror-reference.md#alertmanager_servers):Alertemanager 实例的配置,用来指定 Alertmanager 部署在哪台机器上 +- [global](/tiup/tiup-cluster-topology-reference.md#global):集群全局配置,其中一些是集群的默认值,可以在实例里面单独配置 +- [monitored](/tiup/tiup-cluster-topology-reference.md#monitored):监控服务配置,即 blackbox exporter 和 node exporter,每台机器上都会部署一个 node expoter 一个 blackbox exporter +- [server_configs](/tiup/tiup-cluster-topology-reference.md#server_configs):全局服务配置,针对每种组件配置其默认配置,这个配置可以在每个实例里单独覆盖,该配置用于生成服务的配置文件 +- [pd_servers](/tiup/tiup-cluster-topology-reference.md#pd_servers):PD 实例的配置,用来指定 PD 组件部署到哪些机器上 +- [tidb_servers](/tiup/tiup-cluster-topology-reference.md#tidb_servers): TiDB 实例的配置,用来指定 TiDB 组件部署到哪些机器上 +- [tikv_servers](/tiup/tiup-cluster-topology-reference.md#tikv_servers):TiKV 实例的配置,用来指定 TiKV 组件部署到哪些机器上 +- [tiflash_servers](/tiup/tiup-cluster-topology-reference.md#tiflash_servers):TiFlash 实例的配置,用来指定 TiFlash 组件部署到哪些机器上 +- [pump_servers](/tiup/tiup-cluster-topology-reference.md#pump_servers):Pump 实例的配置,用来指定 Pump 组件部署到哪些机器上 +- [drainer_servers](/tiup/tiup-cluster-topology-reference.md#drainer_servers):Drainer 实例的配置,用来指定 Drainer 组件部署到哪些机器上 +- [cdc_servers](/tiup/tiup-cluster-topology-reference.md#cdc_servers):CDC 实例的配置,用来指定 CDC 组件部署到哪些机器上 +- [tispark_masters](/tiup/tiup-cluster-topology-reference.md#tispark_masters):TiSpark Master 实例的配置,用来指定 TiSpark Master 组件部署到哪台机器上,仅允许部署一个 TiSpark Master 节点 +- [tispark_workers](/tiup/tiup-cluster-topology-reference.md#tispark_workers):TiSpark Worker 实例的配置,用来指定 TiSpark Worker 组件部署到哪些机器上 +- [monitoring_servers](/tiup/tiup-cluster-topology-reference.md#monitoring_servers):Prometheus 实例的配置,用来指定 Prometheus 部署在哪台机器上 +- [grafana_servers](/tiup/tiup-cluster-topology-reference.md#grafana_servers):Grafana 实例的配置,用来指定 Grafana 部署在哪台机器上 +- [alertmanager_servers](/tiup/tiup-cluster-topology-reference.md#alertmanager_servers):Alertemanager 实例的配置,用来指定 Alertmanager 部署在哪些机器上 ### global diff --git a/tiup/tiup-dm-topology-reference.md b/tiup/tiup-dm-topology-reference.md index e69de29bb2d1..b23c3a524f02 100644 --- a/tiup/tiup-dm-topology-reference.md +++ b/tiup/tiup-dm-topology-reference.md @@ -0,0 +1,294 @@ +--- +title: tiup dm topology reference +aliases: ['/docs-cn/dev/tiup/tiup-dm-topology-reference/'] +--- + +# tiup dm topology reference + +## 介绍 + +在部署或扩容 DM 集群时,需要提供一份拓扑文件来描述集群拓扑,同样,修改配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。 + +拓扑文件[示例参考](https://github.com/pingcap/tiup/blob/master/examples/dm/topology.example.yaml)。 + +## 文件结构 + +一个 DM 集群的拓扑文件可能包含以下区块: + +- [global](/tiup/tiup-dm-topology-reference.md#global):集群全局配置,其中一些是集群的默认值,可以在实例里面单独配置 +- [server_configs](/tiup/tiup-dm-topology-reference.md#server_configs):全局服务配置,针对每种组件配置其默认配置,这个配置可以在每个实例里单独覆盖,该配置用于生成服务的配置文件 +- [master_servers](/tiup/tiup-dm-topology-reference.md#master_servers):DM master 实例的配置,用来指定 DM 组件的 master 服务部署到哪些机器上 +- [worker_servers](/tiup/tiup-dm-topology-reference.md#worker_servers):DM worker 实例的配置,用来指定 DM 组件的 worker 服务部署到哪些机器上 +- [monitoring_servers](/tiup/tiup-cluster-topology-reference.md#monitoring_servers):Prometheus 实例的配置,用来指定 Prometheus 部署在哪台机器上 +- [grafana_servers](/tiup/tiup-cluster-topology-reference.md#grafana_servers):Grafana 实例的配置,用来指定 Grafana 部署在哪台机器上 +- [alertmanager_servers](/tiup/tiup-cluster-topology-reference.md#alertmanager_servers):Alertemanager 实例的配置,用来指定 Alertmanager 部署在哪些机器上 + +### global + +global 区块集群的全局配置,包含以下字段: + +- user:以什么用户来启动部署的集群,默认值:"tidb",如果 `` 字段指定的用户在目标机器上不存在,会自动尝试创建 +- group:自动创建用户时指定用户所属的用户组,默认和 `` 字段值相同,若指定的组不存在,则自动创建 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,默认值:22 +- enable_tls:是否对集群启用 tls,启用之后集群之间,客户端与集群之间都必须用生成的 tls 证书链接,启用后无法关闭,默认值:false +- deploy_dir:每个组件的默认部署目录,默认值:"deploy",其应用规则如下: + - 如果 `` 为绝对路径,那么组件会部署到 `/-` 目录 + - 如果 `` 为相对路径,那么组件会部署到 `/home///-` 目录 + - 对于在自己的实例中设置了 `deploy_dir` 字段的组件实例,部署路径由实例中的 `deploy_dir` 决定 +- data_dir:默认数据目录, 默认值 "data",其应用规则如下: + - 如果 `` 为绝对路径,那么组件数据将放到 `/-` + - 如果 `` 为相对路径,那么组件数据将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 + - 对于在自己的实例中设置了 `data_dir` 字段的组件实例,数据路径由实例中的 `data_dir` 决定 +- log_dir:默认数据目录, 默认值 "log",其应用规则如下: + - 如果 `` 为绝对路径,那么组件日志将放到 `/-` + - 如果 `` 为相对路径,那么组件日志将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 + - 对于在自己的实例中设置了 `log_dir` 字段的组件实例,日志路径由实例中的 `log_dir` 决定 +- os:目标机器的操作系统,该字段决定了向目标机器推送适配哪个操作系统的组件,默认值:linux +- arch:目标机器的架构,该字段决定了向目标机器推送哪个平台的二进制包,支持 amd64 和 arm64,默认值 amd64 +- resource_control:运行时资源控制,该字段下所有配置都将写入 systemd 的 service 文件中,默认不限制,支持控制的资源: + - memory_limit: 限制运行时最大内存,例如 "2G" 表示最多使用 2G 内存 + - cpu_quota:限制运行时最大 CPU 占用率,例如 "200%" + - io_read_bandwidth_max:读磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" + - io_write_bandwidth_max:写磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" + - limit_core:控制 core dump 大小 + +global 配置示例: + +```yaml +global: + user: "tidb" + resource_control: + memory_limit: "2G" +``` + +### server_configs + +server_configs 用于配置服务,生成各组件的配置文件,类似 global 区块,该区块内的配置可以在具体的实例中被覆盖。主要包含以下字段: + +- master:DM master 服务的相关配置,支持的所有配置请参考[DM-master 配置文件介绍](https://docs.pingcap.com/zh/tidb-data-migration/stable/dm-master-configuration-file) +- worker:DM worker 服务的相关配置,支持的所有配置请参考[DM-worker 配置文件介绍](https://docs.pingcap.com/zh/tidb-data-migration/stable/dm-worker-configuration-file) + +server_configs 配置示例: + +```yaml +server_configs: + master: + log-level: info + rpc-timeout: "30s" + rpc-rate-limit: 10.0 + rpc-rate-burst: 40 + worker: + log-level: info +``` + +## master_servers + +master_servers 约定了将 DM 组件的 master 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- name:指定该 DM master 实例的名字,不同实例的名字不能相同 +- port:指定 DM master 提供给服务的端口,默认 8261 +- peer_port:指定 DM master 之间互相通信的端口,默认是 8291 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config:该字段配置规则和 server_configs 里的 master 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 master 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- v1_source_path:从 v1.0.x 升级时,可指定该目录,该目录中应当存放有 V1 的源的配置文件 + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- name +- port +- peer_port +- deploy_dir +- data_dir +- log_dir +- arch +- os +- v1_source_path + +master_servers 配置示例: + +```yaml +master_servers: + - host: 10.0.1.11 + name: master1 + ssh_port: 22 + port: 8261 + peer_port: 8291 + deploy_dir: "/dm-deploy/dm-master-8261" + data_dir: "/dm-data/dm-master-8261" + log_dir: "/dm-deploy/dm-master-8261/log" + numa_node: "0,1" + # The following configs are used to overwrite the `server_configs.master` values. + config: + log-level: info + rpc-timeout: "30s" + rpc-rate-limit: 10.0 + rpc-rate-burst: 40 + - host: 10.0.1.18 + name: master2 + - host: 10.0.1.19 + name: master3 +``` + +## worker_servers + +worker_servers 约定了将 DM 组件的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- name:指定该 DM worker 实例的名字,不同实例的名字不能相同 +- port:指定 DM master 提供给服务的端口,默认 8262 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config:该字段配置规则和 server_configs 里的 worker 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 worker 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- name +- port +- deploy_dir +- data_dir +- log_dir +- arch +- os + +worker_servers 配置示例: + +```yaml +worker_servers: + - host: 10.0.1.12 + ssh_port: 22 + port: 8262 + deploy_dir: "/dm-deploy/dm-worker-8262" + log_dir: "/dm-deploy/dm-worker-8262/log" + numa_node: "0,1" + # config is used to overwrite the `server_configs.worker` values + config: + log-level: info + - host: 10.0.1.19 +``` + +### monitoring_servers + +monitoring_servers 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:指定 Prometheus 提供服务的端口,默认是 9090 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- storage_retention:Prometheus 监控数据保留时间,默认 "15d" +- rule_dir:该字段指定一个本地目录,该目录中应当含有完整的 *.rules.yml 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- port +- deploy_dir +- data_dir +- log_dir +- arch +- os + +monitoring_servers 配置示例: + +```yaml +monitoring_servers: + - host: 10.0.1.11 + rule_dir: /local/rule/dir +``` + +### grafana_servers + +grafana_servers 约定了将 Grafana 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- port:指定 Grafana 提供服务的端口,默认是 3000 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- username:Grafana 登陆界面的用户名 +- password:Grafana 对应的密码 +- dashboard_dir:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +> **注意:** +> +> 如果配置了 grafana_servers 的 dashboard_dir 字段,在执行 tiup cluster rename 命令进行集群重命名后,需要完成以下操作: +> +> 1. 在本地的 dashboards 目录中,将 datasource 字段的值更新为新的集群名(datasource 是以集群名命名的) +> 2. 执行 tiup cluster reload -R grafana 命令 + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- port +- deploy_dir +- arch +- os + +grafana_servers 配置示例: + +```yaml +grafana_servers: + - host: 10.0.1.11 + dashboard_dir: /local/dashboard/dir +``` + +### alertmanager_servers + +alertmanager_servers 约定了将 Alertmanager 服务部署到哪些机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- host:部署到哪台机器,填 IP 地址,不可省略 +- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port +- web_port:指定 Alertmanager 提供网页服务的端口,默认是 9093 +- cluster_port:指定 Alertmanger 和 其他 Alertmanager 通讯的端口,默认是 9094 +- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 +- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 +- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" +- config_file:该字段指定一个本地文件,该文件会在集群配置初始化阶段被传输到目标机器上,作为 Alertmanager 的配置 +- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control + +以上字段中,这些字段在部署完成之后就不能再修改: + +- host +- web_port +- cluster_port +- deploy_dir +- data_dir +- log_dir +- arch +- os + +alertmanager_servers 配置示例: + +```yaml +alertmanager_servers: + - host: 10.0.1.11 + config_file: /local/config/file + - host: 10.0.1.12 + config_file: /local/config/file +``` \ No newline at end of file From 96fbf835fe3e7b22a6eb539fada795c811c2c8a9 Mon Sep 17 00:00:00 2001 From: lucklove Date: Tue, 5 Jan 2021 21:38:58 +0800 Subject: [PATCH 14/56] Update --- tiup/tiup-command-uninstall.md | 4 +- tiup/tiup-component-cluster-check.md | 195 +++++++++++++++++++++++ tiup/tiup-component-cluster-deploy.md | 56 +++++++ tiup/tiup-component-cluster-display.md | 60 +++++++ tiup/tiup-component-cluster-import.md | 58 +++++++ tiup/tiup-component-cluster-list.md | 35 ++++ tiup/tiup-component-cluster-prune.md | 26 +++ tiup/tiup-component-cluster-restart.md | 48 ++++++ tiup/tiup-component-cluster-scale-in.md | 61 +++++++ tiup/tiup-component-cluster-scale-out.md | 51 ++++++ tiup/tiup-component-cluster-start.md | 44 +++++ tiup/tiup-component-cluster-stop.md | 48 ++++++ tiup/tiup-component-cluster-upgrade.md | 51 ++++++ tiup/tiup-component-cluster.md | 29 ++-- 14 files changed, 749 insertions(+), 17 deletions(-) create mode 100644 tiup/tiup-component-cluster-check.md create mode 100644 tiup/tiup-component-cluster-deploy.md create mode 100644 tiup/tiup-component-cluster-display.md create mode 100644 tiup/tiup-component-cluster-import.md create mode 100644 tiup/tiup-component-cluster-list.md create mode 100644 tiup/tiup-component-cluster-prune.md create mode 100644 tiup/tiup-component-cluster-restart.md create mode 100644 tiup/tiup-component-cluster-scale-in.md create mode 100644 tiup/tiup-component-cluster-scale-out.md create mode 100644 tiup/tiup-component-cluster-start.md create mode 100644 tiup/tiup-component-cluster-stop.md create mode 100644 tiup/tiup-component-cluster-upgrade.md diff --git a/tiup/tiup-command-uninstall.md b/tiup/tiup-command-uninstall.md index c89a73a7cf04..b7e3deb6e9b7 100644 --- a/tiup/tiup-command-uninstall.md +++ b/tiup/tiup-command-uninstall.md @@ -19,11 +19,11 @@ tiup uninstall : [component2...N] [flags] ## 选项 -### --all (boolean, 默认 false) +### --all(boolean, 默认 false) 卸载指定组件的全部已安装版本,省略 `` 时使用。 -### --self (boolean,默认 false) +### --self(boolean,默认 false) 卸载 TiUP 自身:删除所有从镜像上下载过来的数据,但会保留 TiUP 及其组件产生的数据,数据存放在 TIUP_HOME 指定的文件夹中,若未设置过 TIUP_HOME,则默认值为 ~/.tiup/。 diff --git a/tiup/tiup-component-cluster-check.md b/tiup/tiup-component-cluster-check.md new file mode 100644 index 000000000000..6e78f10697cb --- /dev/null +++ b/tiup/tiup-component-cluster-check.md @@ -0,0 +1,195 @@ +--- +title: tiup cluster check +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-check/'] +--- + +# tiup cluster check + +对于严肃的生产环境,在正式上线之前需要进行一系列检查,来确保集群拥有最好的表现,为了简化人工检查的步骤,tiup-cluster 提供了 `check` 子命令,该命令用于检查指定集群的机器硬件和软件环境是否满足正常运行条件。 + +## 检查项列表 + +### 操作系统版本 + +检查部署机操作系统发行版和版本:目前仅支持部署在 CentOS 7 的操作系统上,之后随兼容性改进可能增加更多系统版本。 + +### CPU EPOLLEXCLUSIVE + +检查部署机 CPU 是否支持 EPOLLEXCLUSIVE。 + +### numactl + +检查部署机是否安装 numactl,若用户配置绑核,则必须安装 numactl。 + +### 系统时间 + +检查部署机系统时间是否同步:将部署机系统时间与中控机对比,偏差超出某一阈值后报错。 + +### 时间同步服务 + +检查部署机是否配置了时间同步服务:即 ntpd 是否在运行 + +### Swap 分区 + +检查部署机是否启用 Swap 分区:建议禁用 Swap 分区 + +### 内核参数 + +检查各项内核参数的值: + +- net.ipv4.tcp_tw_recycle: 0 +- net.ipv4.tcp_syncookies: 0 +- net.core.somaxconn: 32768 +- vm.swappiness: 0 +- vm.overcommit_memory: 0 or 1 +- fs.file-max: 1000000 + +### THP(透明大页) + +检查部署机是否启用透明大页:建议禁用透明大页。 + +### 系统 Limits + +检查 /etc/security/limits.conf 中各项 limit 值: + +``` + soft nofile 1000000 + hard nofile 1000000 + soft stack 10240 +``` + +其中 `` 为部署、运行 TiDB 集群的用户,最后一列的数值为要求达到的最小值。 + +### SELinux + +检查 SELinux 是否启用:建议用户禁用 SELinux。 + +### 防火墙 + +检查 FirewallD 服务是否启用:建议用户禁用 FirewallD 或为 TiDB 集群各服务添加允许规则。 + +### irqbalance + +检查 irqbalance 服务是否启用:建议用户启用 irqbalance 服务。 + +### 磁盘挂载参数 + +检查 ext4 分区的挂载参数:确保挂载参数包含 nodelalloc,noatime 选项。 + +### 端口占用 + +检查部署机上是否已有进程占用了端口:检查拓扑中定义的端口(包括自动补全的默认端口)在部署机上是否已被占用。 + +> **注意:** +> +> 端口占用检查假设集群尚未启动,如果检查的是已经部署并启动的集群,那么端口占用检查一定会失败,因为端口确实被占用了。 + +### CPU 核心数 + +检查部署机 CPU 信息:建议生产级群 CPU 逻辑核心数 >= 16 + +> **注意:** +> +> 默认不检查 CPU 核心数,需要通过选项 `--enable-cpu` 启用。 + +### 内存大小 + +检查部署机的内存大小:建议生产集群总内存容量 >= 32Gb。 + +> **注意:** +> +> 默认不检查内存大小,需要通过选项 `--enable-mem` 启用。 + +### fio 磁盘性能测试 + +使用 fio 测试 data_dir 所在磁盘的性能,包括三个测试项目: + +- fio_randread_write_latency +- fio_randread_write +- fio_randread + +> **注意:** +> +> 默认不进行 fio 磁盘性能测试,需要通过选项 `--enable-disk` 启用。 + +## 语法 + +```sh +tiup cluster check [flags] +``` + +若集群尚未部署,需要传递将用于部署集群的 [tompology.yml](/tiup/tiup-cluster-topology-reference.md) 文件,tiup-cluster 会根据该文件的内容连接到对应机器去检查。若集群已经部署,则可以使用集群的名字 `` 作为检查对象。 + +> **注意:** +> +> 若传递的是集群名字,则需要配合 `--cluster` 选项使用。 + +## 选项 + +### --apply(boolean,默认 false) + +尝试自动修复失败的检查项,目前仅会尝试修复以下项目: + +- SELinux +- 防火墙 +- irqbalance +- 内核参数 +- 系统 Limits +- THP(透明大页) + +### --cluster(boolean,默认 false) + +tiup-cluster 支持对未部署的集群进行检查,也支持对已部署的集群进行检查,命令格式: + +```sh +tiup cluster check [flags] +``` + +若选择的格式为 `tiup cluster check ` 则必须加上该选项:`tiup cluster check --cluster`。 + +### --enable-cpu(boolean,默认 false) + +默认情况下 tiup-cluster 不检查 CPU 核心数,该选项用于启用 CPU 核心数检查。 + +### --enable-disk(boolean,默认 false) + +默认情况下 tiup-cluster 不进行 fio 磁盘性能测试,该选项用于启用 fio 磁盘性能测试。 + +### --enable-mem + +默认情况下 tiup-cluster 不检查内存大小,该选项用于启用内存大小检查。 + +### -u, --user(string,默认为当前执行命令的用户) + +指定连接目标机器的用户名,该用户在目标机器上需要有免密 sudo root 的权限。 + +> **注意:** +> +> 仅当 `--cluster` 选项为 false 时该选项有效,否则该值固定为部署集群时拓扑文件中指定的用户名。 + +### -i, --identity_file(string,默认 ~/.ssh/id_rsa) + +指定连接目标机器的密钥文件。 + +> **注意:** +> +> 仅当 `--cluster` 选项为 false 时该选项有效,否则该值固定为 `${TIUP_HOME}/storage/cluster/clusters//ssh/id_rsa` + +### -p, --password(boolean,默认 false) + +在连接目标机器时使用密码登陆: +- 对于指定了 `--cluster` 的集群,密码为部署集群时拓扑文件中指定的用户的密码 +- 对于未指定 `--cluster` 的集群,密码为 `-u/--user` 参数指定的用户的密码 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +输出含有以下字段的表格: + +- Node:目标节点 +- Check:检查项 +- Result:检查结果(Pass/Warn/Fail) +- Message:结果描述 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-deploy.md b/tiup/tiup-component-cluster-deploy.md new file mode 100644 index 000000000000..42c4f7e9322f --- /dev/null +++ b/tiup/tiup-component-cluster-deploy.md @@ -0,0 +1,56 @@ +--- +title: tiup cluster deploy +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-deploy/'] +--- + +# tiup cluster deploy + +命令 `tiup cluster deploy` 用于部署一个全新的集群。 + +## 语法 + +```sh +tiup cluster deploy [flags] +``` + +- `` 表示新集群的名字,不能和现有集群同名 +- `` 为要部署的 TiDB 集群版本号,如 `v4.0.9` +- `` 为事先编写好的[拓扑文件](/tiup/tiup-cluster-topology-reference.md) + +## 选项 + +### -u, --user(string,默认为当前执行命令的用户) + +指定连接目标机器的用户名,该用户在目标机器上需要有免密 sudo root 的权限。 + +### -i, --identity_file(string,默认 ~/.ssh/id_rsa) + +指定连接目标机器的密钥文件。 + +### -p, --password(boolean,默认 false) + +在连接目标机器时使用密码登陆,不可和 `-i/--identity_file` 同时使用。 + +### --ignore-config-check(boolean,默认 false) + +在二进制文件部署之后,会对 TiDB,TiKV 和 PD 组件执行配置检查,检查方式为 ` --config-check `,其中 `` 为部署的二进制文件的路径,`` 为根据用户配置生成的配置文件。 + +如果想要跳过该项检查,可以使用该选项。 + +### --no-labels(boolean,默认 false) + +当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology.labels.md))。 + +但是对于测试环境,可能并不在意是否将一个 region 的副本调度到了同一台机器上,这个时候可以使用 `--no-labels` 来绕过检查。 + +### --skip-create-user(boolean,false) + +在部署集群时,tiup-cluster 会先检查拓扑文件中指定的用户名是否存在,如果不存在就会创建一个。指定 `--skip-create-user` 选项后不再检查用户是否存在,直接跳过创建步骤。 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +部署日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-display.md b/tiup/tiup-component-cluster-display.md new file mode 100644 index 000000000000..2ff3511d61a8 --- /dev/null +++ b/tiup/tiup-component-cluster-display.md @@ -0,0 +1,60 @@ +--- +title: tiup cluster display +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-display/'] +--- + +# tiup cluster display + +## 介绍 + +如果想查看集群中每个组件的运行状态,逐一登录到各个机器上查看显然很低效。因此,tiup-cluster 提供了 `tiup cluster display` 命令来高效完成这件工作。 + +## 语法 + +```sh +tiup cluster display [flags] +``` + +`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 + +## 选项 + +### --dashboard(boolean,默认为 false) + +默认情况会展示整个集群的所有节点信息,加上该选项后仅展示 dashboard 的信息。 + +### -N, --node(strings,默认为 [],表示所有节点) + +指定要查询的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将查询他们的交集中的服务状态。 + +### -R, --role strings(strings,默认为 [],表示所有角色) + +指定要查询的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将查询他们的交集中的服务状态。 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +- 集群名称 +- 集群版本 +- SSH 客户端类型 +- Dashboard 地址 +- 含有以下字段的表格: + - ID:节点 ID,由 IP:PORT 构成 + - Role:该节点部署的服务角色(如 tidb, tikv 等) + - Host:该节点对应的机器 IP + - Ports:服务占用的端口号 + - OS/Arch:该节点的操作系统和机器架构 + - Status:该节点服务当前的状态 + - Data Dir:服务的数据目录,`-` 表示没有数据目录 + - Deploy Dir:服务的部署目录 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-import.md b/tiup/tiup-component-cluster-import.md new file mode 100644 index 000000000000..183c1be89201 --- /dev/null +++ b/tiup/tiup-component-cluster-import.md @@ -0,0 +1,58 @@ +--- +title: tiup cluster import +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-import/'] +--- + +# tiup cluster import + +## 介绍 + +在 TiDB 4.0 以前的版本,集群基本是通过 TiDB Ansible 部署的,TiUP Cluster 提供了 `import` 命令用于让这些集群过渡到 TiUP Cluster 组件接管。 + +> **注意:** +> +> 1. TiDB Ansible 配置导入到 TiUP 中管理后,不能再通过 TiDB Ansible 对集群进行操作,否则可能因元信息不一致造成冲突 +> 2. 对于满足以下情况之一的 TiDB Ansible 部署的集群,暂不支持导入: +> a. 启用了 `TLS` 加密功能的集群 +> b. 纯 KV 集群(没有 TiDB 实例的集群) +> c. 启用了 `Kafka` 的集群 +> d. 启用了 `Spark` 的集群 +> e. 启用了 `Lightning` / `Importer` 的集群 +> f. 仍使用老版本 '`push`' 的方式收集监控指标(从 3.0 默认为 '`pull`' 模式,如果没有特意调整过则可以支持) +> g. 在 `inventory.ini` 配置文件中单独为机器的 `node_exporter` / `blackbox_exporter` 通过 `node_exporter_port` / `blackbox_exporter_port` 设置了非默认端口(在 `group_vars` 目录中统一配置的可以兼容) + +## 语法 + +```sh +tiup cluster import [flags] +``` + +## 选项 + +### -d, --dir string(string, 默认 当前目录) + +指定 TiDB Ansible 所在目录。 + +### --ansible-config(string,默认 "./ansible.cfg") + +指定 Ansible 的配置文件路径。 + +### --inventory string(string,默认 "inventory.ini") + +指定 ansible inventory 文件的名字。 + +### --no-backup(boolean,默认 false) + +默认情况下,import 成功之后会将 `--dir` 指定的目录里所有内容备份到 `${TIUP_HOME}/.tiup/storage/cluster/clusters/{cluster-name}/ansible-backup` 下面。该选项用于禁用这个步骤,这在该目录下有多个 inventory 文件(部署了多个集群)的时候很有用。 + +### --rename(string,默认为空) + +重命名导入的集群。默认集群名为 inventory 中指定的 cluster_name。 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +import 过程的 debug 信息。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-list.md b/tiup/tiup-component-cluster-list.md new file mode 100644 index 000000000000..2842998c3baa --- /dev/null +++ b/tiup/tiup-component-cluster-list.md @@ -0,0 +1,35 @@ +--- +title: tiup cluster list +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-list/'] +--- + +# tiup cluster list + +## 介绍 + +tiup-cluster 支持使用同一个中控机部署多套集群,而命令 `tiup cluster list` 可以查看当前登陆的用户使用该中控机部署了哪些集群。 + +> **注意:** +> +> 部署的集群数据默认放在 `~/.tiup/storage/cluster/clusters/` 目录下,因此在同一台中控机上,用户 A 部署的集群用户 B 是看不到的。 + +## 语法 + +```sh +tiup cluster list [flags] +``` + +## 选项 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +输出含有以下字段的表格: +- Name:集群名字 +- User:部署用户 +- Version:集群版本 +- Path:集群部署数据在中控机上的路径 +- PrivateKey:连接集群的私钥所在路径 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-prune.md b/tiup/tiup-component-cluster-prune.md new file mode 100644 index 000000000000..50c4bddf0bce --- /dev/null +++ b/tiup/tiup-component-cluster-prune.md @@ -0,0 +1,26 @@ +--- +title: tiup cluster prune +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-prune/'] +--- + +# tiup cluster list + +## 介绍 + +在[缩容集群](/tiup/tiup-component-cluster-scale-in.md)时,对于某些组件,并不会立即停止服务并删除数据,而是需要等数据调度完成之后,用户手动执行 `tiup cluster prune` 命令清理。 + +## 语法 + +```sh +tiup cluster prune [flags] +``` + +## 选项 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +清理过程的日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-restart.md b/tiup/tiup-component-cluster-restart.md new file mode 100644 index 000000000000..49461bcb00ae --- /dev/null +++ b/tiup/tiup-component-cluster-restart.md @@ -0,0 +1,48 @@ +--- +title: tiup cluster restart +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-restart/'] +--- + +# tiup cluster restart + +## 介绍 + +命令 `tiup cluster restart` 用于重启指定集群的所有服务或部分服务。 + +> **注意:** +> +> 重启过程中会有一段时间服务不可用。 + +## 语法 + +```sh +tiup cluster restart [flags] +``` + +`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 + +## 选项 + +### -N, --node(strings,默认为 [],表示所有节点) + +指定要重启的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将重启他们的交集中的服务。 + +### -R, --role strings(strings,默认为 [],表示所有角色) + +指定要重启的节点,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将重启他们的交集中的服务。 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +重启服务的日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-scale-in.md b/tiup/tiup-component-cluster-scale-in.md new file mode 100644 index 000000000000..263d9c10f8c7 --- /dev/null +++ b/tiup/tiup-component-cluster-scale-in.md @@ -0,0 +1,61 @@ +--- +title: tiup cluster scale-in +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-scale-in/'] +--- + +# tiup cluster scale-in + +## 介绍 + +`tiup cluster scale-in` 命令用于集群缩容,缩容即下线服务,最终会将指定的节点从集群中移除,并删除遗留的相关数据文件。 + +由于 TiKV,TiFlash 和 TiDB Binlog 组件的下线是异步的(需要先通过 API 执行移除操作)并且下线过程耗时较长(需要持续观察节点是否已经下线成功),所以对 TiKV,TiFlash 和 TiDB Binlog 组件做了特殊处理: + +- 对 TiKV,TiFlash 及 Binlog 组件的操作: + - tiup-cluster 通过 API 将其下线后直接退出而不等待下线完成 + - 执行 `tiup cluster display` 查看下线节点的状态,等待其状态变为 Tombstone + - 执行 `tiup cluster prune` 命令清理 Tombstone 节点,该命令会执行以下操作: + - 停止已经下线掉的节点的服务 + - 清理已经下线掉的节点的相关数据文件 + - 更新集群的拓扑,移除已经下线掉的节点 +- 对其他组件的操作 + - 下线 PD 组件时,会通过 API 将指定节点从集群中删除掉(这个过程很快),然后停掉指定 PD 的服务并且清除该节点的相关数据文件 + - 下线其他组件时,直接停止并且清除节点的相关数据文件 + +## 语法 + +```sh +tiup cluster scale-in [flags] +``` + +`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 + +## 选项 + +### -N, --node(strings,无默认值,必须非空) + +选择要缩容的节点,若缩容多个节点,以逗号分割。 + +### --force(boolean,默认 false) + +在某些情况下,有可能被缩容的节点宿主机已经宕机,导致无法通过 ssh 连接到节点进行操作,这个时候可以通过 `--force` 选项强制将其从集群中移除。 + +> **注意:** +> +> 强制移除 TiKV 节点不会等待数据调度,移除一个以上正在提供服务的 TiKV 节点会有数据丢失的风险。 + +### --transfer-timeout(uint,默认 300) + +在缩容 PD 或 TiKV 时,会先将被缩容节点的 leader 迁移到其他节点,迁移过程会需要一定时间,可以通过设置 `--transfer-timeout` 设置最长等待时间(单位为秒),超时之后会跳过等待直接缩容服务。 + +> **注意:** +> +> 若出现跳过等待直接缩容的情况,服务性能可能会出现抖动。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +缩容日志 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-scale-out.md b/tiup/tiup-component-cluster-scale-out.md new file mode 100644 index 000000000000..fa2a77a8ea63 --- /dev/null +++ b/tiup/tiup-component-cluster-scale-out.md @@ -0,0 +1,51 @@ +--- +title: tiup cluster scale-out +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-scale-out/'] +--- + +# tiup cluster scale-out + +## 介绍 + +`tiup cluster scale-out` 命令用于集群扩容,扩容的内部逻辑与部署类似,tiup-cluster 组件会先建立新节点的 SSH 连接,在目标节点上创建必要的目录,然后执行部署并且启动服务。其中 PD 节点的扩容会通过 join 方式加入到集群中,并且会更新与 PD 有关联的服务的配置;其他服务直接启动加入到集群中。 + +## 语法 + +```sh +tiup cluster scale-out [flags] +``` + +- `` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md) +- `` 为事先编写好的扩容[拓扑文件](/tiup/tiup-cluster-topology-reference.md),该文件应当仅包含扩容部分的拓扑 + +## 选项 + +### -u, --user(string,默认为当前执行命令的用户) + +指定连接目标机器的用户名,该用户在目标机器上需要有免密 sudo root 的权限。 + +### -i, --identity_file(string,默认 ~/.ssh/id_rsa) + +指定连接目标机器的密钥文件。 + +### -p, --password(boolean,默认 false) + +在连接目标机器时使用密码登陆,不可和 `-i/--identity_file` 同时使用。 + +### --no-labels(boolean,默认 false) + +当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology.labels.md))。 + +但是对于测试环境,可能并不在意是否将一个 region 的副本调度到了同一台机器上,这个时候可以使用 `--no-labels` 来绕过检查。 + +### --skip-create-user(boolean,false) + +在扩容集群时,tiup-cluster 会先检查拓扑文件中指定的用户名是否存在,如果不存在就会创建一个。指定 `--skip-create-user` 选项后不再检查用户是否存在,直接跳过创建步骤。 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +扩容日志 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-start.md b/tiup/tiup-component-cluster-start.md new file mode 100644 index 000000000000..f9ed1ab90fc9 --- /dev/null +++ b/tiup/tiup-component-cluster-start.md @@ -0,0 +1,44 @@ +--- +title: tiup cluster start +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-start/'] +--- + +# tiup cluster start + +## 介绍 + +命令 `tiup cluster start` 用于启动指定集群的所有或部分服务。 + +## 语法 + +```sh +tiup cluster start [flags] +``` + +`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 + +## 选项 + +### -N, --node(strings,默认为 [],表示所有节点) + +指定要启动的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将启动他们的交集中的服务。 + +### -R, --role strings(strings,默认为 [],表示所有角色) + +指定要启动的节点,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将启动他们的交集中的服务。 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +启动日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-stop.md b/tiup/tiup-component-cluster-stop.md new file mode 100644 index 000000000000..9fa315af3be0 --- /dev/null +++ b/tiup/tiup-component-cluster-stop.md @@ -0,0 +1,48 @@ +--- +title: tiup cluster stop +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-stop/'] +--- + +# tiup cluster stop + +## 介绍 + +命令 `tiup cluster stop` 用于停止指定集群的所有服务或部分服务。 + +> **注意:** +> +> 核心服务停止后集群将无法提供服务。 + +## 语法 + +```sh +tiup cluster stop [flags] +``` + +`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 + +## 选项 + +### -N, --node(strings,默认为 [],表示所有节点) + +指定要停止的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将停止他们的交集中的服务。 + +### -R, --role strings(strings,默认为 [],表示所有角色) + +指定要停止的节点,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将停止他们的交集中的服务。 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +停服务的日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-upgrade.md b/tiup/tiup-component-cluster-upgrade.md new file mode 100644 index 000000000000..260aad474bd1 --- /dev/null +++ b/tiup/tiup-component-cluster-upgrade.md @@ -0,0 +1,51 @@ +--- +title: tiup cluster upgrade +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-upgrade/'] +--- + +# tiup cluster upgrade + +## 介绍 + +命令 `tiup cluster upgrade` 用于将指定集群升级到特定版本。 + +## 语法 + +```sh +tiup cluster upgrade [flags] +``` + +- `` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 +- `` 为要升级到的目标版本,目前仅允许升级到比当前集群更高的版本,不允许升级到比当前集群更低的版本,即不允许降级。同时也不允许升级成 nightly 版本 + +## 选项 + +### --force(boolean,默认 false) + +升级集群需要保证集群目前是启动的,在某些情况下,可能希望在集群未启动的状态下升级,这时候可以使用 `--force` 忽略升级过程的错误,强制替换二进制文件并启动集群。 + +> **注意:** +> +> 对正在提供服务的集群强制升级可能导致集群服务不可用。对于未启动的集群,升级成功后会自动启动集群。 + +### --transfer-timeout(uint,默认 300) + +在升级 PD 或 TiKV 时,会先将被升级节点的 leader 迁移到其他节点,迁移过程会需要一定时间,可以通过设置 `--transfer-timeout` 设置最长等待时间(单位为秒),超时之后会跳过等待直接升级服务。 + +> **注意:** +> +> 若出现跳过等待直接升级的情况,服务性能可能会出现抖动。 + +### --ignore-config-check(boolean,默认 false) + +在二进制文件更新之后,会对 TiDB,TiKV 和 PD 组件执行配置检查,检查方式为 ` --config-check `,其中 `` 为新部署的二进制文件的路径,`` 为根据用户配置生成的配置文件。 + +如果想要跳过该项检查,可以使用该选项。 + +### --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +升级服务的日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster.md b/tiup/tiup-component-cluster.md index 38c0311f7a5f..913e09dd7a04 100644 --- a/tiup/tiup-component-cluster.md +++ b/tiup/tiup-component-cluster.md @@ -33,11 +33,11 @@ tiup cluster [command] [flags] ### --wait-timeout(uint,默认 120) -设置执行命令的超时时间,单位为秒。 +运维过程中涉及到很多操作:指定 systemctl 启动/停止服务,等待端口上线/下线等,每个操作可能会消耗数秒,`--wait-timeout` 用于设置每个步骤的最长等待时间(单位为秒),超时后报错退出。 ### -y, --yes (boolean,默认 false) -跳过所有二次确认,除非是使用脚本调用 TiUP,否则不推荐使用。 +跳过所有风险操作的二次确认,除非是使用脚本调用 TiUP,否则不推荐使用。 ### -v, --version(boolean,默认 false) @@ -49,19 +49,18 @@ tiup cluster [command] [flags] ## 命令清单 -- import:导入 ansible 部署的集群 -- check:部署前后的集群检查 -- deploy:根据指定拓扑部署集群 -- list:查询已部署的集群列表 -- start:启动指定集群 -- display:展示指定集群状态 -- stop:停止指定集群 -- restart:重启指定集群 -- scale-in:缩容指定集群 -- scale-out:扩容指定集群 -- upgrade:升级指定集群 -- exec:在指定集群的指定机器上执行命令 -- prune:销毁指定集群中状态为 tombstone 的实例 +- [import](/tiup/tiup-component-cluster-import.md):导入 ansible 部署的集群 +- [check](/tiup/tiup-component-cluster-check.md):部署前后的集群检查 +- [deploy](/tiup/tiup-component-cluster-deploy.md):根据指定拓扑部署集群 +- [list](/tiup/tiup-component-cluster-list.md):查询已部署的集群列表 +- [display](/tiup/tiup-component-cluster-display.md):展示指定集群状态 +- [start](/tiup/tiup-component-cluster-start.md):启动指定集群 +- [stop](/tiup/tiup-component-cluster-stop.md):停止指定集群 +- [restart](/tiup/tiup-component-cluster-restart.md):重启指定集群 +- [scale-in](/tiup/tiup-component-cluster-scale-in.md):缩容指定集群 +- [scale-out](/tiup/tiup-component-cluster-scale-out.md):扩容指定集群 +- [upgrade](/tiup/tiup-component-cluster-upgrade.md):升级指定集群 +- [prune](/tiup/tiup-component-cluster-prune.md):销毁指定集群中状态为 Tombstone 的实例 - edit-config:修改指定集群配置 - reload:重载指定集群配置 - patch:替换已部署集群的某个服务 From 35807e7450c76103c3848592aa15e42e19276495 Mon Sep 17 00:00:00 2001 From: lucklove Date: Thu, 7 Jan 2021 18:24:59 +0800 Subject: [PATCH 15/56] Finish dm --- tiup/tiup-cluster-topology-reference.md | 2 +- tiup/tiup-component-cluster-audit.md | 33 ++++++++++ tiup/tiup-component-cluster-check.md | 2 +- tiup/tiup-component-cluster-clean.md | 55 ++++++++++++++++ tiup/tiup-component-cluster-deploy.md | 2 +- tiup/tiup-component-cluster-destroy.md | 44 +++++++++++++ tiup/tiup-component-cluster-disable.md | 44 +++++++++++++ tiup/tiup-component-cluster-display.md | 2 +- tiup/tiup-component-cluster-edit-config.md | 34 ++++++++++ tiup/tiup-component-cluster-enable.md | 48 ++++++++++++++ tiup/tiup-component-cluster-help.md | 26 ++++++++ tiup/tiup-component-cluster-import.md | 2 +- tiup/tiup-component-cluster-list.md | 2 +- tiup/tiup-component-cluster-patch.md | 71 +++++++++++++++++++++ tiup/tiup-component-cluster-prune.md | 2 +- tiup/tiup-component-cluster-reload.md | 73 ++++++++++++++++++++++ tiup/tiup-component-cluster-rename.md | 36 +++++++++++ tiup/tiup-component-cluster-restart.md | 4 +- tiup/tiup-component-cluster-scale-out.md | 2 +- tiup/tiup-component-cluster-start.md | 4 +- tiup/tiup-component-cluster-stop.md | 4 +- tiup/tiup-component-cluster-upgrade.md | 2 +- tiup/tiup-component-cluster.md | 20 +++--- tiup/tiup-component-dm-audit.md | 33 ++++++++++ tiup/tiup-component-dm-deploy.md | 40 ++++++++++++ tiup/tiup-component-dm-destroy.md | 32 ++++++++++ tiup/tiup-component-dm-display.md | 55 ++++++++++++++++ tiup/tiup-component-dm-edit-config.md | 34 ++++++++++ tiup/tiup-component-dm-help.md | 26 ++++++++ tiup/tiup-component-dm-import.md | 53 ++++++++++++++++ tiup/tiup-component-dm-list.md | 35 +++++++++++ tiup/tiup-component-dm-patch.md | 63 +++++++++++++++++++ tiup/tiup-component-dm-prune.md | 26 ++++++++ tiup/tiup-component-dm-reload.md | 55 ++++++++++++++++ tiup/tiup-component-dm-restart.md | 48 ++++++++++++++ tiup/tiup-component-dm-scale-in.md | 36 +++++++++++ tiup/tiup-component-dm-scale-out.md | 41 ++++++++++++ tiup/tiup-component-dm-start.md | 44 +++++++++++++ tiup/tiup-component-dm-stop.md | 48 ++++++++++++++ tiup/tiup-component-dm-upgrade.md | 29 +++++++++ tiup/tiup-component-dm.md | 68 ++++++++++++++++++++ tiup/tiup-reference.md | 4 +- 42 files changed, 1257 insertions(+), 27 deletions(-) create mode 100644 tiup/tiup-component-cluster-audit.md create mode 100644 tiup/tiup-component-cluster-clean.md create mode 100644 tiup/tiup-component-cluster-destroy.md create mode 100644 tiup/tiup-component-cluster-disable.md create mode 100644 tiup/tiup-component-cluster-edit-config.md create mode 100644 tiup/tiup-component-cluster-enable.md create mode 100644 tiup/tiup-component-cluster-help.md create mode 100644 tiup/tiup-component-cluster-patch.md create mode 100644 tiup/tiup-component-cluster-reload.md create mode 100644 tiup/tiup-component-cluster-rename.md create mode 100644 tiup/tiup-component-dm-audit.md create mode 100644 tiup/tiup-component-dm-deploy.md create mode 100644 tiup/tiup-component-dm-destroy.md create mode 100644 tiup/tiup-component-dm-display.md create mode 100644 tiup/tiup-component-dm-edit-config.md create mode 100644 tiup/tiup-component-dm-help.md create mode 100644 tiup/tiup-component-dm-import.md create mode 100644 tiup/tiup-component-dm-list.md create mode 100644 tiup/tiup-component-dm-patch.md create mode 100644 tiup/tiup-component-dm-prune.md create mode 100644 tiup/tiup-component-dm-reload.md create mode 100644 tiup/tiup-component-dm-restart.md create mode 100644 tiup/tiup-component-dm-scale-in.md create mode 100644 tiup/tiup-component-dm-scale-out.md create mode 100644 tiup/tiup-component-dm-start.md create mode 100644 tiup/tiup-component-dm-stop.md create mode 100644 tiup/tiup-component-dm-upgrade.md create mode 100644 tiup/tiup-component-dm.md diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index 2ab93e5edf3f..bd761e1ad375 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -536,7 +536,7 @@ grafana_servers 约定了将 Grafana 服务部署到哪台机器上,同时可 > > 如果配置了 grafana_servers 的 dashboard_dir 字段,在执行 tiup cluster rename 命令进行集群重命名后,需要完成以下操作: > -> 1. 在本地的 dashboards 目录中,将 datasource 字段的值更新为新的集群名(datasource 是以集群名命名的) +> 1. 对于本地的 dashboards 目录中的 `*.json` 文件,将 datasource 字段的值更新为新的集群名(这是因为 datasource 是以集群名命名的) > 2. 执行 tiup cluster reload -R grafana 命令 以上字段中,这些字段在部署完成之后就不能再修改: diff --git a/tiup/tiup-component-cluster-audit.md b/tiup/tiup-component-cluster-audit.md new file mode 100644 index 000000000000..491e5c106c2c --- /dev/null +++ b/tiup/tiup-component-cluster-audit.md @@ -0,0 +1,33 @@ +--- +title: tiup cluster audit +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-audit/'] +--- + +# tiup cluster audit + +## 介绍 + +命令 `tiup cluster audit` 可以用于查看历史上对所有集群执行了什么命令,以及每个命令的执行日志。 + +## 语法 + +```sh +tiup cluster audit [audit-id] [flags] +``` + +- 若不填写 `[audit-id]` 则按时间倒序输出操作记录的表格,第一列为 audit-id +- 若填写 `[audit-id]` 则查看指定的 audit-id 的执行日志 + +## 选项 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +- 若指定 `[audit-id]`,则输出对应的执行日志 +- 若不指定 `[audit-id]` 则输出含有以下字段的表格: + - ID:该条记录对应的 audit-id + - Time:该条记录对应的命令执行时间 + - Command:该条记录对应的命令 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-check.md b/tiup/tiup-component-cluster-check.md index 6e78f10697cb..c2ca67ed3c11 100644 --- a/tiup/tiup-component-cluster-check.md +++ b/tiup/tiup-component-cluster-check.md @@ -181,7 +181,7 @@ tiup cluster check [flags] - 对于指定了 `--cluster` 的集群,密码为部署集群时拓扑文件中指定的用户的密码 - 对于未指定 `--cluster` 的集群,密码为 `-u/--user` 参数指定的用户的密码 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster-clean.md b/tiup/tiup-component-cluster-clean.md new file mode 100644 index 000000000000..3355d1068da7 --- /dev/null +++ b/tiup/tiup-component-cluster-clean.md @@ -0,0 +1,55 @@ +--- +title: tiup cluster clean +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-clean/'] +--- + +# tiup cluster clean + +## 介绍 + +在测试环境中,有时候需要将集群重置回刚部署的状态,即删除所有数据,命令 `tiup cluster clean` 可以很方便的做到这一点:它会停止集群,然后删除集群上的数据,重启集群之后,就能得到一个全新的集群了。 + +> **注意:** +> +> 该命令一定会先停止集群(即使选择只清理日志也是),生产环境请勿使用。 + +## 语法 + +```sh +tiup cluster clean [flags] +``` + +`` 为要清理的集群。 + +## 选项 + +### --all(boolean,默认 false) + +同时清理数据和日志,等价于同时指定 `--data` 和 `--log`,若不指定该选项,则必须至少指定以下选项之一: + +- --data:清理数据 +- --log:清理日志 + +### --data(boolean,默认 false) + +该选项开启数据清理,若不指定该选项,也不指定 `--all`,则不清理数据。 + +### --log(boolean,默认 false) + +该选项开启日志清理,若不指定该选项,也不指定 `--all`,则不清理日志。 + +### --ignore-node(StringArray,默认为空) + +指定不需要清理的节点,如需指定多个,重复使用多次该选项:`--ignore-node --ignore-node `。 + +### --ignore-role(StringArray,默认为空) + +指定不需要清理的角色,如需指定多个,重复使用多次该选项:`--ignore-role --ignore-role `。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +tiup-cluster 的执行日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-deploy.md b/tiup/tiup-component-cluster-deploy.md index 42c4f7e9322f..8bdb83944f4b 100644 --- a/tiup/tiup-component-cluster-deploy.md +++ b/tiup/tiup-component-cluster-deploy.md @@ -47,7 +47,7 @@ tiup cluster deploy [flags] 在部署集群时,tiup-cluster 会先检查拓扑文件中指定的用户名是否存在,如果不存在就会创建一个。指定 `--skip-create-user` 选项后不再检查用户是否存在,直接跳过创建步骤。 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster-destroy.md b/tiup/tiup-component-cluster-destroy.md new file mode 100644 index 000000000000..2d79755de6b7 --- /dev/null +++ b/tiup/tiup-component-cluster-destroy.md @@ -0,0 +1,44 @@ +--- +title: tiup cluster destroy +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-destroy/'] +--- + +# tiup cluster destroy + +## 介绍 + +当业务下线之后,如果想将集群占有的机器释放出来让给其他业务使用,需要清理掉集群上的数据以及部署的二进制文件。`tiup cluster destroy` 命令会执行以下操作销毁集群: + +- 停止集群 +- 对于每个服务,删除其数据目录,日志目录,部署目录 +- 如果各个服务的数据目录/部署目录的父目录是由 tiup-cluster 创建的,也一并删除 + +## 语法 + +```sh +tiup cluster destroy [flags] +``` + +`` 为要销毁的集群。 + +## 选项 + +### --force(boolean,默认 false) + +在某些情况下,有可能集群中的某些节点已经宕机,导致无法通过 ssh 连接到节点进行操作,这个时候可以通过 `--force` 选项忽略这些错误。 + +### --retain-node-data(StringArray,默认为空) + +指定需要保留数据的节点,如需指定多个,重复使用多次该选项:`--retain-node-data --retain-node-data `。 + +### --retain-role-data(StringArray,默认为空) + +指定需要保留数据的角色,如需指定多个,重复使用多次该选项:`--retain-role-data --retain-role-data `。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +tiup-cluster 的执行日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-disable.md b/tiup/tiup-component-cluster-disable.md new file mode 100644 index 000000000000..2c4527024789 --- /dev/null +++ b/tiup/tiup-component-cluster-disable.md @@ -0,0 +1,44 @@ +--- +title: tiup cluster disable +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-disable/'] +--- + +# tiup cluster disable + +## 介绍 + +命令 `tiup cluster disable` 由于关闭集群服务在机器重启后的自启动,该命令会到指定的节点上去执行 `systemctl disable ` 来关闭服务的自启。 + +## 语法 + +```sh +tiup cluster disable [flags] +``` + +`` 为要关闭自启的集群。 + +## 选项 + +### -N, --node(strings,默认为 [],未选中任何节点) + +指定要关闭自启的节点,该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将关闭他们的交集中的服务自启。 + +### -R, --role strings(strings,默认为 [],未选中任何角色) + +指定要关闭自启的角色,该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将关闭他们的交集中的服务自启。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +tiup-cluster 的执行日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-display.md b/tiup/tiup-component-cluster-display.md index 2ff3511d61a8..c1a774beffbe 100644 --- a/tiup/tiup-component-cluster-display.md +++ b/tiup/tiup-component-cluster-display.md @@ -39,7 +39,7 @@ tiup cluster display [flags] > > 若同时指定了 `-N, --node`,那么将查询他们的交集中的服务状态。 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster-edit-config.md b/tiup/tiup-component-cluster-edit-config.md new file mode 100644 index 000000000000..b7156cfb3e7c --- /dev/null +++ b/tiup/tiup-component-cluster-edit-config.md @@ -0,0 +1,34 @@ +--- +title: tiup cluster edit-config +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-edit-config/'] +--- + +# tiup cluster edit-config + +## 介绍 + +在部署集群之后,如果需要再调整集群服务的配置,则可以使用命令 `tiup cluster edit-config`,它会启动一个编辑器允许用户修改指定集群的[拓扑文件](/tiup/tiup-cluster-topology-reference.md)。 + +> **注意:** +> +> 1. 修改配置时不能增删机器,增删机器属于[集群扩容](/tiup/tiup-component-cluster-scale-out.md)和[集群缩容](/tiup/tiup-component-cluster-scale-in.md)的功能。 +> 2. 执行完该命令后配置只是在中控机上修改了,要应用配置需要执行 `tiup cluster relaod` 命令来重新加载。 + +## 语法 + +```sh +tiup cluster edit-config [flags] +``` + +`` 代表要操作的集群名。 + +## 选项 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +- 正常情况无输出 +- 若修改了不能修改的字段,则保存文件时报错并提示用户重新编辑,不能修改的字段参考[拓扑文件](/tiup/tiup-cluster-topology-reference.md)中的相关描述 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-enable.md b/tiup/tiup-component-cluster-enable.md new file mode 100644 index 000000000000..c1ad46a1aae8 --- /dev/null +++ b/tiup/tiup-component-cluster-enable.md @@ -0,0 +1,48 @@ +--- +title: tiup cluster enable +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-enable/'] +--- + +# tiup cluster enable + +## 介绍 + +命令 `tiup cluster enable` 由于设置集群服务在机器重启后的自启动,该命令会到指定的节点上去执行 `systemctl enable ` 来开启服务的自启。 + +> **注意:** +> +> 集群全部关机重启时,服务启动的顺序由节点的操作系统启动顺序决定,重启顺序不正确时,在某些情况下,重启后的集群仍然不能提供服务(比如先启动了 TiKV 但未启动 PD,systemd 重启 TiKV 多次仍未找到 PD 则会放弃)。 + +## 语法 + +```sh +tiup cluster enable [flags] +``` + +`` 为要启用自启的集群。 + +## 选项 + +### -N, --node(strings,默认为 [],未选中任何节点) + +指定要开启自启的节点,该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将开启他们的交集中的服务自启。 + +### -R, --role strings(strings,默认为 [],未选中任何角色) + +指定要开启自启的角色,该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将开启他们的交集中的服务自启。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +tiup-cluster 的执行日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-help.md b/tiup/tiup-component-cluster-help.md new file mode 100644 index 000000000000..35243eb8072e --- /dev/null +++ b/tiup/tiup-component-cluster-help.md @@ -0,0 +1,26 @@ +--- +title: tiup cluster help +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-help/'] +--- + +# tiup cluster help + +## 介绍 + +tiup-cluster 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得,基本上,`tiup cluster help ` 等价于 `tiup cluster --help`。 + +## 语法 + +```sh +tiup cluster help [command] [flags] +``` + +`[command]` 用于指定要查看哪个命令的帮助信息,若不指定,则查看 tiup-cluster 自身的帮助信息。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +`[command]` 或 tiup-cluster 的帮助信息。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-import.md b/tiup/tiup-component-cluster-import.md index 183c1be89201..448cd948567f 100644 --- a/tiup/tiup-component-cluster-import.md +++ b/tiup/tiup-component-cluster-import.md @@ -49,7 +49,7 @@ tiup cluster import [flags] 重命名导入的集群。默认集群名为 inventory 中指定的 cluster_name。 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster-list.md b/tiup/tiup-component-cluster-list.md index 2842998c3baa..659acfff8c56 100644 --- a/tiup/tiup-component-cluster-list.md +++ b/tiup/tiup-component-cluster-list.md @@ -21,7 +21,7 @@ tiup cluster list [flags] ## 选项 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster-patch.md b/tiup/tiup-component-cluster-patch.md new file mode 100644 index 000000000000..548b19cafcac --- /dev/null +++ b/tiup/tiup-component-cluster-patch.md @@ -0,0 +1,71 @@ +--- +title: tiup cluster patch +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-patch/'] +--- + +# tiup cluster patch + +## 介绍 + +在集群运行过程中,如果需要动态替换某个服务的二进制文件(即替换过程中保持集群可用),那么可以使用 `tiup cluster patch` 命令,它会完成以下几件事情: + +- 将用于替换的二进制包上传到目标机器 +- 如果目标服务是 TiKV, TiFlash 活着 Binlog 之类的存储服务,则先通过 API 下线节点 +- 停止目标服务 +- 解压二进制包,替换服务 +- 重启目标服务 + +## 语法 + +```sh +tiup cluster patch [flags] +``` + +- `` 代表要操作的集群名 +- `` 为用于替换的二进制包,其打包方式如下: + - 确定当前要替换的组件名称 `${component}` (tidb, tikv, pd...) 以及其版本 `${version}` (v4.0.0, v4.0.1 ...),以及其运行的平台 `${os}` (linux) 和 `${arch}` (amd64, arm64) + - 下载当前的组件包:`wget https://tiup-mirrors.pingcap.com/${component}-${version}-${os}-${arch}.tar.gz -O /tmp/${component}-${version}-${os}-${arch}.tar.gz` + - 建立临时打包目录:`mkdir -p /tmp/package && cd /tmp/package` + - 解压原来的二进制包:`tar xf /tmp/${component}-${version}-${os}-${arch}.tar.gz` + - 查看临时打包目录中的文件结构:`find .` + - 将要替换的二进制文件或配置文件复制到临时目录的对应位置 + - 重新打包 `tar czf /tmp/${component}-hotfix-${os}-${arch}.tar.gz *` + - 通过以上步骤之后,`/tmp/${component}-hotfix-${os}-${arch}.tar.gz` 就可以用于 patch 命令了 + +## 选项 + +### --overwrite(boolean,默认 false) + +对某个组件(比如 TiDB,TiKV)进行 patch 之后,会涉及到一个问题:以后在该集群扩容该组件时,是用原来的版本,还是用 patch 之后的二进制包?tiup-cluster 默认会用原来的版本,如果希望后续扩容的时候也使用 patch 之后的版本的话,就需要指定 `--overwrite` 选项。 + +### --transfer-timeout(uint,默认 300) + +在重启 PD 或 TiKV 时,会先将被重启节点的 leader 迁移到其他节点,迁移过程会需要一定时间,可以通过设置 `--transfer-timeout` 设置最长等待时间(单位为秒),超时之后会跳过等待直接重启服务。 + +> **注意:** +> +> 若出现跳过等待直接重启的情况,服务性能可能会出现抖动。 + +### -N, --node(strings,默认为 [],未选中任何节点) + +指定要替换的节点,该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将替换他们的交集中的服务。 + +### -R, --role strings(strings,默认为 [],未选中任何角色) + +指定要替换的角色,该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将替换他们的交集中的服务。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +tiup-cluster 的执行日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-prune.md b/tiup/tiup-component-cluster-prune.md index 50c4bddf0bce..0c01ceb66d0f 100644 --- a/tiup/tiup-component-cluster-prune.md +++ b/tiup/tiup-component-cluster-prune.md @@ -17,7 +17,7 @@ tiup cluster prune [flags] ## 选项 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster-reload.md b/tiup/tiup-component-cluster-reload.md new file mode 100644 index 000000000000..26321bbd3606 --- /dev/null +++ b/tiup/tiup-component-cluster-reload.md @@ -0,0 +1,73 @@ +--- +title: tiup cluster reload +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-reload/'] +--- + +# tiup cluster list + +## 介绍 + +在[修改集群配置](/tiup/tiup-component-cluster-edit-config.md)之后,需要通过 `tiup cluster reload` 命令让集群重新加载配置才会生效,该命令会将中控机的配置发布到服务运行的远端机器,并按照升级的流程按顺序重启服务,重启过程中集群仍然可用。 + +## 语法 + +```sh +tiup cluster reload [flags] +``` + +`` 代表要操作的集群名。 + +## 选项 + +### --force(boolean,默认 false) + +忽略 reload 过程中的错误,强制 reload。 + +### --transfer-timeout(uint,默认 300) + +在重启 PD 或 TiKV 时,会先将被重启节点的 leader 迁移到其他节点,迁移过程会需要一定时间,可以通过设置 `--transfer-timeout` 设置最长等待时间(单位为秒),超时之后会跳过等待直接重启服务。 + +> **注意:** +> +> 若出现跳过等待直接重启的情况,服务性能可能会出现抖动。 + +### --ignore-config-check(boolean,默认 false) + +在二进制文件部署之后,会对 TiDB,TiKV 和 PD 组件执行配置检查,检查方式为 ` --config-check `,其中 `` 为部署的二进制文件的路径,`` 为根据用户配置生成的配置文件。 + +如果想要跳过该项检查,可以使用该选项。 + +### -N, --node(strings,默认为 [],表示所有节点) + +指定要重启的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 + +> **注意:** +> +> 1. 若同时指定了 `-R, --role`,那么将重启他们的交集中的服务 +> 2. 若指定了选项 `--skip-restart`,则该选项无效 + +### -R, --role strings(strings,默认为 [],表示所有角色) + +指定要重启的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 + +> **注意:** +> +> 1. 若同时指定了 `-N, --node`,那么将重启他们的交集中的服务 +> 2. 若指定了选项 `--skip-restart`,则该选项无效 + +### --skip-restart(boolean,默认 false) + +命令 `tiup cluster reload` 会执行两个操作: + +- 刷新所有节点配置 +- 重启指定节点 + +该选项指定后仅刷新配置,不重启任何节点,这样刷新的配置也不会应用,需要等对应服务下次重启才会生效。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +tiup-cluster 的执行日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-rename.md b/tiup/tiup-component-cluster-rename.md new file mode 100644 index 000000000000..f00ed1746535 --- /dev/null +++ b/tiup/tiup-component-cluster-rename.md @@ -0,0 +1,36 @@ +--- +title: tiup cluster rename +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-rename/'] +--- + +# tiup cluster rename + +## 介绍 + +集群名字是[部署集群](/tiup/tiup-component-cluster-deploy.md)时指定的,在集群部署之后,如果想更改集群名字,可以通过 `tiup cluster rename` 命令来实现。 + +> **注意:** +> +> 如果配置了 grafana_servers 的 dashboard_dir 字段,在执行 tiup cluster rename 命令进行集群重命名后,需要完成以下操作: +> +> 1. 对于本地的 dashboards 目录中的 `*.json` 文件,将 datasource 字段的值更新为新的集群名(这是因为 datasource 是以集群名命名的) +> 2. 执行 tiup cluster reload -R grafana 命令 + +## 语法 + +```sh +tiup cluster rename [flags] +``` + +- `` 老的集群名 +- `` 新的集群名 + +## 选项 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +tiup-cluster 的执行日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-restart.md b/tiup/tiup-component-cluster-restart.md index 49461bcb00ae..a52355ffed6b 100644 --- a/tiup/tiup-component-cluster-restart.md +++ b/tiup/tiup-component-cluster-restart.md @@ -33,13 +33,13 @@ tiup cluster restart [flags] ### -R, --role strings(strings,默认为 [],表示所有角色) -指定要重启的节点,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 +指定要重启的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 > **注意:** > > 若同时指定了 `-N, --node`,那么将重启他们的交集中的服务。 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster-scale-out.md b/tiup/tiup-component-cluster-scale-out.md index fa2a77a8ea63..e8d39b229b56 100644 --- a/tiup/tiup-component-cluster-scale-out.md +++ b/tiup/tiup-component-cluster-scale-out.md @@ -42,7 +42,7 @@ tiup cluster scale-out [flags] 在扩容集群时,tiup-cluster 会先检查拓扑文件中指定的用户名是否存在,如果不存在就会创建一个。指定 `--skip-create-user` 选项后不再检查用户是否存在,直接跳过创建步骤。 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster-start.md b/tiup/tiup-component-cluster-start.md index f9ed1ab90fc9..8494e3146f99 100644 --- a/tiup/tiup-component-cluster-start.md +++ b/tiup/tiup-component-cluster-start.md @@ -29,13 +29,13 @@ tiup cluster start [flags] ### -R, --role strings(strings,默认为 [],表示所有角色) -指定要启动的节点,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 +指定要启动的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 > **注意:** > > 若同时指定了 `-N, --node`,那么将启动他们的交集中的服务。 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster-stop.md b/tiup/tiup-component-cluster-stop.md index 9fa315af3be0..e7b7d05cc10c 100644 --- a/tiup/tiup-component-cluster-stop.md +++ b/tiup/tiup-component-cluster-stop.md @@ -33,13 +33,13 @@ tiup cluster stop [flags] ### -R, --role strings(strings,默认为 [],表示所有角色) -指定要停止的节点,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 +指定要停止的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 > **注意:** > > 若同时指定了 `-N, --node`,那么将停止他们的交集中的服务。 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster-upgrade.md b/tiup/tiup-component-cluster-upgrade.md index 260aad474bd1..bfc9ac3fbcdf 100644 --- a/tiup/tiup-component-cluster-upgrade.md +++ b/tiup/tiup-component-cluster-upgrade.md @@ -42,7 +42,7 @@ tiup cluster upgrade [flags] 如果想要跳过该项检查,可以使用该选项。 -### --help(boolean,默认 false) +### -h, --help(boolean,默认 false) 输出帮助信息。 diff --git a/tiup/tiup-component-cluster.md b/tiup/tiup-component-cluster.md index 913e09dd7a04..2a069678e431 100644 --- a/tiup/tiup-component-cluster.md +++ b/tiup/tiup-component-cluster.md @@ -61,13 +61,13 @@ tiup cluster [command] [flags] - [scale-out](/tiup/tiup-component-cluster-scale-out.md):扩容指定集群 - [upgrade](/tiup/tiup-component-cluster-upgrade.md):升级指定集群 - [prune](/tiup/tiup-component-cluster-prune.md):销毁指定集群中状态为 Tombstone 的实例 -- edit-config:修改指定集群配置 -- reload:重载指定集群配置 -- patch:替换已部署集群的某个服务 -- rename:重命名集群 -- clean:删除指定集群数据 -- destroy:销毁指定集群 -- audit:查询集群操作审计日志 -- enable:开启指定集群或服务开机自启动 -- disable:关闭指定集群或服务开机自启动 -- help:输出帮助信息 \ No newline at end of file +- [edit-config](/tiup/tiup-component-cluster-edit-config.md):修改指定集群配置 +- [reload](/tiup/tiup-component-cluster-reload.md):重载指定集群配置 +- [patch](/tiup/tiup-component-cluster-patch.md):替换已部署集群的某个服务 +- [rename](/tiup/tiup-component-cluster-rename.md):重命名集群 +- [clean](/tiup/tiup-component-cluster-clean.md):删除指定集群数据 +- [destroy](/tiup/tiup-component-cluster-destroy.md):销毁指定集群 +- [audit](/tiup/tiup-component-cluster-audit.md):查询集群操作审计日志 +- [enable](/tiup/tiup-component-cluster-enable.md):开启指定集群或服务开机自启动 +- [disable](/tiup/tiup-component-cluster-disable.md):关闭指定集群或服务开机自启动 +- [help](/tiup/tiup-component-cluster-help.md):输出帮助信息 \ No newline at end of file diff --git a/tiup/tiup-component-dm-audit.md b/tiup/tiup-component-dm-audit.md new file mode 100644 index 000000000000..487224cbd60a --- /dev/null +++ b/tiup/tiup-component-dm-audit.md @@ -0,0 +1,33 @@ +--- +title: tiup dm audit +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-audit/'] +--- + +# tiup dm audit + +## 介绍 + +命令 `tiup dm audit` 可以用于查看历史上对所有集群执行了什么命令,以及每个命令的执行日志。 + +## 语法 + +```sh +tiup dm audit [audit-id] [flags] +``` + +- 若不填写 `[audit-id]` 则按时间倒序输出操作记录的表格,第一列为 audit-id +- 若填写 `[audit-id]` 则查看指定的 audit-id 的执行日志 + +## 选项 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +- 若指定 `[audit-id]`,则输出对应的执行日志 +- 若不指定 `[audit-id]` 则输出含有以下字段的表格: + - ID:该条记录对应的 audit-id + - Time:该条记录对应的命令执行时间 + - Command:该条记录对应的命令 \ No newline at end of file diff --git a/tiup/tiup-component-dm-deploy.md b/tiup/tiup-component-dm-deploy.md new file mode 100644 index 000000000000..e524b54ca8db --- /dev/null +++ b/tiup/tiup-component-dm-deploy.md @@ -0,0 +1,40 @@ +--- +title: tiup dm deploy +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-deploy/'] +--- + +# tiup dm deploy + +命令 `tiup dm deploy` 用于部署一个全新的集群。 + +## 语法 + +```sh +tiup dm deploy [flags] +``` + +- `` 表示新集群的名字,不能和现有集群同名 +- `` 为要部署的 DM 集群版本号,如 `v2.0.0` +- `` 为事先编写好的[拓扑文件](/tiup/tiup-dm-topology-reference.md) + +## 选项 + +### -u, --user(string,默认为当前执行命令的用户) + +指定连接目标机器的用户名,该用户在目标机器上需要有免密 sudo root 的权限。 + +### -i, --identity_file(string,默认 ~/.ssh/id_rsa) + +指定连接目标机器的密钥文件。 + +### -p, --password(boolean,默认 false) + +在连接目标机器时使用密码登陆,不可和 `-i/--identity_file` 同时使用。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +部署日志。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-destroy.md b/tiup/tiup-component-dm-destroy.md new file mode 100644 index 000000000000..b2fafb2cbec0 --- /dev/null +++ b/tiup/tiup-component-dm-destroy.md @@ -0,0 +1,32 @@ +--- +title: tiup dm destroy +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-destroy/'] +--- + +# tiup dm destroy + +## 介绍 + +当业务下线之后,如果想将集群占有的机器释放出来让给其他业务使用,需要清理掉集群上的数据以及部署的二进制文件。`tiup dm destroy` 命令会执行以下操作销毁集群: + +- 停止集群 +- 对于每个服务,删除其数据目录,日志目录,部署目录 +- 如果各个服务的数据目录/部署目录的父目录是由 tiup-dm 创建的,也一并删除 + +## 语法 + +```sh +tiup dm destroy [flags] +``` + +`` 为要销毁的集群。 + +## 选项 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +tiup-dm 的执行日志。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-display.md b/tiup/tiup-component-dm-display.md new file mode 100644 index 000000000000..0c7b86ab7438 --- /dev/null +++ b/tiup/tiup-component-dm-display.md @@ -0,0 +1,55 @@ +--- +title: tiup dm display +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-display/'] +--- + +# tiup dm display + +## 介绍 + +如果想查看集群中每个组件的运行状态,逐一登录到各个机器上查看显然很低效。因此,tiup-dm 提供了 `tiup dm display` 命令来高效完成这件工作。 + +## 语法 + +```sh +tiup dm display [flags] +``` + +`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-dm-list.md)。 + +## 选项 + +### -N, --node(strings,默认为 [],表示所有节点) + +指定要查询的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-dm-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将查询他们的交集中的服务状态。 + +### -R, --role strings(strings,默认为 [],表示所有角色) + +指定要查询的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-dm-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将查询他们的交集中的服务状态。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +- 集群名称 +- 集群版本 +- SSH 客户端类型 +- 含有以下字段的表格: + - ID:节点 ID,由 IP:PORT 构成 + - Role:该节点部署的服务角色(如 tidb, tikv 等) + - Host:该节点对应的机器 IP + - Ports:服务占用的端口号 + - OS/Arch:该节点的操作系统和机器架构 + - Status:该节点服务当前的状态 + - Data Dir:服务的数据目录,`-` 表示没有数据目录 + - Deploy Dir:服务的部署目录 \ No newline at end of file diff --git a/tiup/tiup-component-dm-edit-config.md b/tiup/tiup-component-dm-edit-config.md new file mode 100644 index 000000000000..7e828a178a60 --- /dev/null +++ b/tiup/tiup-component-dm-edit-config.md @@ -0,0 +1,34 @@ +--- +title: tiup dm edit-config +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-edit-config/'] +--- + +# tiup dm edit-config + +## 介绍 + +在部署集群之后,如果需要再调整集群服务的配置,则可以使用命令 `tiup dm edit-config`,它会启动一个编辑器允许用户修改指定集群的[拓扑文件](/tiup/tiup-dm-topology-reference.md)。 + +> **注意:** +> +> 1. 修改配置时不能增删机器,增删机器属于[集群扩容](/tiup/tiup-component-dm-scale-out.md)和[集群缩容](/tiup/tiup-component-dm-scale-in.md)的功能。 +> 2. 执行完该命令后配置只是在中控机上修改了,要应用配置需要执行 `tiup dm relaod` 命令来重新加载。 + +## 语法 + +```sh +tiup dm edit-config [flags] +``` + +`` 代表要操作的集群名。 + +## 选项 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +- 正常情况无输出 +- 若修改了不能修改的字段,则保存文件时报错并提示用户重新编辑,不能修改的字段参考[拓扑文件](/tiup/tiup-dm-topology-reference.md)中的相关描述 \ No newline at end of file diff --git a/tiup/tiup-component-dm-help.md b/tiup/tiup-component-dm-help.md new file mode 100644 index 000000000000..94f74ce59359 --- /dev/null +++ b/tiup/tiup-component-dm-help.md @@ -0,0 +1,26 @@ +--- +title: tiup dm help +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-help/'] +--- + +# tiup dm help + +## 介绍 + +tiup-dm 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得,基本上,`tiup dm help ` 等价于 `tiup dm --help`。 + +## 语法 + +```sh +tiup dm help [command] [flags] +``` + +`[command]` 用于指定要查看哪个命令的帮助信息,若不指定,则查看 tiup-dm 自身的帮助信息。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +`[command]` 或 tiup-dm 的帮助信息。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-import.md b/tiup/tiup-component-dm-import.md new file mode 100644 index 000000000000..fbd4448802d8 --- /dev/null +++ b/tiup/tiup-component-dm-import.md @@ -0,0 +1,53 @@ +--- +title: tiup dm import +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-import/'] +--- + +# tiup dm import + +## 介绍 + +在 DM 1.0 版本,集群基本是通过 TiDB Ansible 部署的,TiUP DM 提供了 `import` 命令导入 1.0 的集群并重新部署 2.0 的集群。 + +> **注意:** +> +> - 不支持导入 1.0 集群中的 DM Portal 组件 +> - 导入前请先停止原集群 +> - 对于需要升级到 2.0 的数据迁移任务,请不要执行 `stop-task` +> - 仅支持导入到 v2.0.0-rc.2 或更高版本 +> - `import` 命令用于将 DM 1.0 集群导入到全新的 2.0 集群。如果需要将数据迁移任务导入到已有的 2.0 集群,请参考 [TiDB Data Migration 1.0.x 到 2.0.x 手动升级](manually-upgrade-dm-1.0-to-2.0.md) +> - 部分组件生成的部署目录会跟原集群不一样,具体可以使用 `display` 命令查看 +> - 导入前运行 `tiup update --self && tiup update dm` 确认升级 TiUP DM 组件到最新版本 +> - 导入后集群中仅会有一个 DM-master 节点,可参考[扩容节点](/tiup/tiup-component-dm-scale-out.md)对 DM-master 进行扩容 + +## 语法 + +```sh +tiup dm import [flags] +``` + +## 选项 + +### -v, --cluster-version(string,required) + +重新部署的版本号,必须指定 v2.0.0-rc.2 或更高版本。 + +### -d, --dir string(string, 默认 当前目录) + +指定 TiDB Ansible 所在目录。 + +### --inventory string(string,默认 "inventory.ini") + +指定 ansible inventory 文件的名字。 + +### --rename(string,默认为空) + +重命名导入的集群。默认集群名为 inventory 中指定的 cluster_name。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +import 过程的 debug 信息。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-list.md b/tiup/tiup-component-dm-list.md new file mode 100644 index 000000000000..6c7f91b896f3 --- /dev/null +++ b/tiup/tiup-component-dm-list.md @@ -0,0 +1,35 @@ +--- +title: tiup dm list +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-list/'] +--- + +# tiup dm list + +## 介绍 + +tiup-dm 支持使用同一个中控机部署多套集群,而命令 `tiup dm list` 可以查看当前登陆的用户使用该中控机部署了哪些集群。 + +> **注意:** +> +> 部署的集群数据默认放在 `~/.tiup/storage/dm/clusters/` 目录下,因此在同一台中控机上,用户 A 部署的集群用户 B 是看不到的。 + +## 语法 + +```sh +tiup dm list [flags] +``` + +## 选项 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +输出含有以下字段的表格: +- Name:集群名字 +- User:部署用户 +- Version:集群版本 +- Path:集群部署数据在中控机上的路径 +- PrivateKey:连接集群的私钥所在路径 \ No newline at end of file diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md new file mode 100644 index 000000000000..00784223605a --- /dev/null +++ b/tiup/tiup-component-dm-patch.md @@ -0,0 +1,63 @@ +--- +title: tiup dm patch +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-patch/'] +--- + +# tiup dm patch + +## 介绍 + +在集群运行过程中,如果需要动态替换某个服务的二进制文件(即替换过程中保持集群可用),那么可以使用 `tiup dm patch` 命令,它会完成以下几件事情: + +- 将用于替换的二进制包上传到目标机器 +- 通过 API 下线节点 +- 停止目标服务 +- 解压二进制包,替换服务 +- 重启目标服务 + +## 语法 + +```sh +tiup dm patch [flags] +``` + +- `` 代表要操作的集群名 +- `` 为用于替换的二进制包,其打包方式如下: + - 确定当前要替换的组件名称 `${component}` (dm-master, dm-worker ...) 以及其版本 `${version}` (v2.0.0, v2.0.1 ...),以及其运行的平台 `${os}` (linux) 和 `${arch}` (amd64, arm64) + - 下载当前的组件包:`wget https://tiup-mirrors.pingcap.com/${component}-${version}-${os}-${arch}.tar.gz -O /tmp/${component}-${version}-${os}-${arch}.tar.gz` + - 建立临时打包目录:`mkdir -p /tmp/package && cd /tmp/package` + - 解压原来的二进制包:`tar xf /tmp/${component}-${version}-${os}-${arch}.tar.gz` + - 查看临时打包目录中的文件结构:`find .` + - 将要替换的二进制文件或配置文件复制到临时目录的对应位置 + - 重新打包 `tar czf /tmp/${component}-hotfix-${os}-${arch}.tar.gz *` + - 通过以上步骤之后,`/tmp/${component}-hotfix-${os}-${arch}.tar.gz` 就可以用于 patch 命令了 + +## 选项 + +### --overwrite(boolean,默认 false) + +对某个组件(比如 TiDB,TiKV)进行 patch 之后,会涉及到一个问题:以后在该集群扩容该组件时,是用原来的版本,还是用 patch 之后的二进制包?tiup-dm 默认会用原来的版本,如果希望后续扩容的时候也使用 patch 之后的版本的话,就需要指定 `--overwrite` 选项。 + +### -N, --node(strings,默认为 [],未选中任何节点) + +指定要替换的节点,该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-dm-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将替换他们的交集中的服务。 + +### -R, --role strings(strings,默认为 [],未选中任何角色) + +指定要替换的角色,该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-dm-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将替换他们的交集中的服务。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +tiup-dm 的执行日志。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-prune.md b/tiup/tiup-component-dm-prune.md new file mode 100644 index 000000000000..d9a8adac1961 --- /dev/null +++ b/tiup/tiup-component-dm-prune.md @@ -0,0 +1,26 @@ +--- +title: tiup dm prune +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-prune/'] +--- + +# tiup dm list + +## 介绍 + +在[缩容集群](/tiup/tiup-component-dm-scale-in.md)后,ETCD 中仍然会有少量元信息不会被清理,通常不清理这些信息不会导致问题,如果确实需要清理,可以手动执行 `tiup cluster prune` 命令清理。 + +## 语法 + +```sh +tiup dm prune [flags] +``` + +## 选项 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +清理过程的日志。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-reload.md b/tiup/tiup-component-dm-reload.md new file mode 100644 index 000000000000..6dd7c33ce4d2 --- /dev/null +++ b/tiup/tiup-component-dm-reload.md @@ -0,0 +1,55 @@ +--- +title: tiup dm reload +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-reload/'] +--- + +# tiup dm list + +## 介绍 + +在[修改集群配置](/tiup/tiup-component-dm-edit-config.md)之后,需要通过 `tiup dm reload` 命令让集群重新加载配置才会生效,该命令会将中控机的配置发布到服务运行的远端机器,并按照升级的流程按顺序重启服务,重启过程中集群仍然可用。 + +## 语法 + +```sh +tiup dm reload [flags] +``` + +`` 代表要操作的集群名。 + +## 选项 + +### -N, --node(strings,默认为 [],表示所有节点) + +指定要重启的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-dm-display.md)表格的第一列。 + +> **注意:** +> +> 1. 若同时指定了 `-R, --role`,那么将重启他们的交集中的服务 +> 2. 若指定了选项 `--skip-restart`,则该选项无效 + +### -R, --role strings(strings,默认为 [],表示所有角色) + +指定要重启的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-dm-display.md)表格的第二列。 + +> **注意:** +> +> 1. 若同时指定了 `-N, --node`,那么将重启他们的交集中的服务 +> 2. 若指定了选项 `--skip-restart`,则该选项无效 + +### --skip-restart(boolean,默认 false) + +命令 `tiup dm reload` 会执行两个操作: + +- 刷新所有节点配置 +- 重启指定节点 + +该选项指定后仅刷新配置,不重启任何节点,这样刷新的配置也不会应用,需要等对应服务下次重启才会生效。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +tiup-dm 的执行日志。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-restart.md b/tiup/tiup-component-dm-restart.md new file mode 100644 index 000000000000..2e1ba15d6f22 --- /dev/null +++ b/tiup/tiup-component-dm-restart.md @@ -0,0 +1,48 @@ +--- +title: tiup dm restart +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-restart/'] +--- + +# tiup dm restart + +## 介绍 + +命令 `tiup dm restart` 用于重启指定集群的所有服务或部分服务。 + +> **注意:** +> +> 重启过程中会有一段时间服务不可用。 + +## 语法 + +```sh +tiup dm restart [flags] +``` + +`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-dm-list.md)。 + +## 选项 + +### -N, --node(strings,默认为 [],表示所有节点) + +指定要重启的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-dm-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将重启他们的交集中的服务。 + +### -R, --role strings(strings,默认为 [],表示所有角色) + +指定要重启的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-dm-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将重启他们的交集中的服务。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +重启服务的日志。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-scale-in.md b/tiup/tiup-component-dm-scale-in.md new file mode 100644 index 000000000000..1bc3200dcdb7 --- /dev/null +++ b/tiup/tiup-component-dm-scale-in.md @@ -0,0 +1,36 @@ +--- +title: tiup dm scale-in +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-scale-in/'] +--- + +# tiup dm scale-in + +## 介绍 + +`tiup dm scale-in` 命令用于集群缩容,缩容即下线服务,最终会将指定的节点从集群中移除,并删除遗留的相关数据文件。 + +## 语法 + +```sh +tiup dm scale-in [flags] +``` + +`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-dm-list.md)。 + +## 选项 + +### -N, --node(strings,无默认值,必须非空) + +选择要缩容的节点,若缩容多个节点,以逗号分割。 + +### --force(boolean,默认 false) + +在某些情况下,有可能被缩容的节点宿主机已经宕机,导致无法通过 ssh 连接到节点进行操作,这个时候可以通过 `--force` 选项强制将其从集群中移除。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +缩容日志 \ No newline at end of file diff --git a/tiup/tiup-component-dm-scale-out.md b/tiup/tiup-component-dm-scale-out.md new file mode 100644 index 000000000000..c20745628639 --- /dev/null +++ b/tiup/tiup-component-dm-scale-out.md @@ -0,0 +1,41 @@ +--- +title: tiup dm scale-out +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-scale-out/'] +--- + +# tiup dm scale-out + +## 介绍 + +`tiup dm scale-out` 命令用于集群扩容,扩容的内部逻辑与部署类似,tiup-dm 组件会先建立新节点的 SSH 连接,在目标节点上创建必要的目录,然后执行部署并且启动服务。 + +## 语法 + +```sh +tiup dm scale-out [flags] +``` + +- `` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-dm-list.md) +- `` 为事先编写好的扩容[拓扑文件](/tiup/tiup-dm-topology-reference.md),该文件应当仅包含扩容部分的拓扑 + +## 选项 + +### -u, --user(string,默认为当前执行命令的用户) + +指定连接目标机器的用户名,该用户在目标机器上需要有免密 sudo root 的权限。 + +### -i, --identity_file(string,默认 ~/.ssh/id_rsa) + +指定连接目标机器的密钥文件。 + +### -p, --password(boolean,默认 false) + +在连接目标机器时使用密码登陆,不可和 `-i/--identity_file` 同时使用。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +扩容日志 \ No newline at end of file diff --git a/tiup/tiup-component-dm-start.md b/tiup/tiup-component-dm-start.md new file mode 100644 index 000000000000..0410c0bb94b0 --- /dev/null +++ b/tiup/tiup-component-dm-start.md @@ -0,0 +1,44 @@ +--- +title: tiup dm start +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-start/'] +--- + +# tiup dm start + +## 介绍 + +命令 `tiup dm start` 用于启动指定集群的所有或部分服务。 + +## 语法 + +```sh +tiup dm start [flags] +``` + +`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-dm-list.md)。 + +## 选项 + +### -N, --node(strings,默认为 [],表示所有节点) + +指定要启动的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-dm-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将启动他们的交集中的服务。 + +### -R, --role strings(strings,默认为 [],表示所有角色) + +指定要启动的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-dm-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将启动他们的交集中的服务。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +启动日志。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-stop.md b/tiup/tiup-component-dm-stop.md new file mode 100644 index 000000000000..4e9ae9317459 --- /dev/null +++ b/tiup/tiup-component-dm-stop.md @@ -0,0 +1,48 @@ +--- +title: tiup dm stop +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-stop/'] +--- + +# tiup dm stop + +## 介绍 + +命令 `tiup dm stop` 用于停止指定集群的所有服务或部分服务。 + +> **注意:** +> +> 核心服务停止后集群将无法提供服务。 + +## 语法 + +```sh +tiup dm stop [flags] +``` + +`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-dm-list.md)。 + +## 选项 + +### -N, --node(strings,默认为 [],表示所有节点) + +指定要停止的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-dm-display.md)表格的第一列。 + +> **注意:** +> +> 若同时指定了 `-R, --role`,那么将停止他们的交集中的服务。 + +### -R, --role strings(strings,默认为 [],表示所有角色) + +指定要停止的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-dm-display.md)表格的第二列。 + +> **注意:** +> +> 若同时指定了 `-N, --node`,那么将停止他们的交集中的服务。 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +停服务的日志。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-upgrade.md b/tiup/tiup-component-dm-upgrade.md new file mode 100644 index 000000000000..296c296b2e27 --- /dev/null +++ b/tiup/tiup-component-dm-upgrade.md @@ -0,0 +1,29 @@ +--- +title: tiup dm upgrade +aliases: ['/docs-cn/dev/tiup/tiup-component-dm-upgrade/'] +--- + +# tiup dm upgrade + +## 介绍 + +命令 `tiup dm upgrade` 用于将指定集群升级到特定版本。 + +## 语法 + +```sh +tiup dm upgrade [flags] +``` + +- `` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-dm-list.md)。 +- `` 为要升级到的目标版本,目前仅允许升级到比当前集群更高的版本,不允许升级到比当前集群更低的版本,即不允许降级。同时也不允许升级成 nightly 版本 + +## 选项 + +### -h, --help(boolean,默认 false) + +输出帮助信息。 + +## 输出 + +升级服务的日志。 \ No newline at end of file diff --git a/tiup/tiup-component-dm.md b/tiup/tiup-component-dm.md new file mode 100644 index 000000000000..7800c69043e9 --- /dev/null +++ b/tiup/tiup-component-dm.md @@ -0,0 +1,68 @@ +--- +title: TiUP DM +aliases: ['/docs-cn/dev/tiup/tiup-component-cluster/'] +--- + +# TiUP DM + +## 介绍 + +类似于 [TiUP Cluster](/tiup/tiup-component-cluster.md) 对 TiDB 集群的管理,TiUP DM 是用于对 DM 集群的日常运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 DM 集群;管理 DM 集群参数。 + +## 语法 + +```sh +tiup dm [command] [flags] +``` + +`[command]` 代表命令名字,支持的命令列表请参考下方命令清单。 + +## 选项 + +### --ssh (string,默认 builtin) + +通过哪种 ssh 客户端到远端(部署 TiDB 服务的机器)执行命令,支持以下几个值: + +- builtin:使用 tiup-cluster 内置的 easyssh 客户端 +- system:使用当前操作系统默认的 ssh 客户端 +- none:不使用 ssh 客户端,这种方式只支持部署到当前机器 + +### --ssh-timeout(uint,默认 5) + +设置 ssh 连接超时时间,单位为秒。 + +### --wait-timeout(uint,默认 120) + +运维过程中涉及到很多操作:指定 systemctl 启动/停止服务,等待端口上线/下线等,每个操作可能会消耗数秒,`--wait-timeout` 用于设置每个步骤的最长等待时间(单位为秒),超时后报错退出。 + +### -y, --yes (boolean,默认 false) + +跳过所有风险操作的二次确认,除非是使用脚本调用 TiUP,否则不推荐使用。 + +### -v, --version(boolean,默认 false) + +输出 tiup-dm 当前版本信息。 + +### -h, --help(boolean,默认 false) + +输出相关命令的帮助信息。 + +## 命令清单 + +- [import](/tiup/tiup-component-dm-import.md):导入 ansible 部署的 1.0 的 DM 集群 +- [deploy](/tiup/tiup-component-dm-deploy.md):根据指定拓扑部署集群 +- [list](/tiup/tiup-component-dm-list.md):查询已部署的集群列表 +- [display](/tiup/tiup-component-dm-display.md):展示指定集群状态 +- [start](/tiup/tiup-component-dm-start.md):启动指定集群 +- [stop](/tiup/tiup-component-dm-stop.md):停止指定集群 +- [restart](/tiup/tiup-component-dm-restart.md):重启指定集群 +- [scale-in](/tiup/tiup-component-dm-scale-in.md):缩容指定集群 +- [scale-out](/tiup/tiup-component-dm-scale-out.md):扩容指定集群 +- [upgrade](/tiup/tiup-component-dm-upgrade.md):升级指定集群 +- [prune](/tiup/tiup-component-dm-prune.md):销毁指定集群中状态为 Tombstone 的实例 +- [edit-config](/tiup/tiup-component-dm-edit-config.md):修改指定集群配置 +- [reload](/tiup/tiup-component-dm-reload.md):重载指定集群配置 +- [patch](/tiup/tiup-component-dm-patch.md):替换已部署集群的某个服务 +- [destroy](/tiup/tiup-component-dm-destroy.md):销毁指定集群 +- [audit](/tiup/tiup-component-dm-audit.md):查询集群操作审计日志 +- [help](/tiup/tiup-component-dm-help.md):输出帮助信息 \ No newline at end of file diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 089f98c226a3..0b9c1758bc2d 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -105,8 +105,8 @@ tiup [flags] [args...] # 运行组件 ## 组件清单 -- cluster:生产环境 TiDB 集群管理 -- dm:生产环境 DM 集群管理 +- [cluster](/tiup/tiup-component-cluster.md):生产环境 TiDB 集群管理 +- [dm](/tiup/tiup-component-dm.md):生产环境 DM 集群管理 - playground:本地集群体验 - bench:数据库压测 - ctl:TiDB 相关的控制工具 \ No newline at end of file From c330d88830683ac37014ce90a373b25e02a8e060 Mon Sep 17 00:00:00 2001 From: lucklove Date: Thu, 7 Jan 2021 18:25:58 +0800 Subject: [PATCH 16/56] Finish dm --- tiup/tiup-reference.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 0b9c1758bc2d..cee6cc6acbd7 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -106,7 +106,4 @@ tiup [flags] [args...] # 运行组件 ## 组件清单 - [cluster](/tiup/tiup-component-cluster.md):生产环境 TiDB 集群管理 -- [dm](/tiup/tiup-component-dm.md):生产环境 DM 集群管理 -- playground:本地集群体验 -- bench:数据库压测 -- ctl:TiDB 相关的控制工具 \ No newline at end of file +- [dm](/tiup/tiup-component-dm.md):生产环境 DM 集群管理 \ No newline at end of file From 186d4bcb92f874cd5b1e9df7714bab83a77d8b6e Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 11 Jan 2021 19:18:10 +0800 Subject: [PATCH 17/56] Address comment --- production-deployment-using-tiup.md | 2 +- telemetry.md | 4 +- tiup/tiup-cluster-topology-reference.md | 691 +++++++++++---------- tiup/tiup-cluster.md | 2 +- tiup/tiup-command-clean.md | 2 +- tiup/tiup-command-completion.md | 6 +- tiup/tiup-command-env.md | 2 +- tiup/tiup-command-help.md | 2 +- tiup/tiup-command-install.md | 2 +- tiup/tiup-command-mirror-clone.md | 2 +- tiup/tiup-command-mirror-genkey.md | 6 +- tiup/tiup-command-mirror-merge.md | 4 +- tiup/tiup-command-mirror-publish.md | 2 +- tiup/tiup-command-mirror-set.md | 4 +- tiup/tiup-command-telemetry.md | 14 +- tiup/tiup-command-uninstall.md | 6 +- tiup/tiup-command-update.md | 14 +- tiup/tiup-component-cluster-check.md | 4 +- tiup/tiup-component-cluster-clean.md | 2 +- tiup/tiup-component-cluster-deploy.md | 2 +- tiup/tiup-component-cluster-destroy.md | 4 +- tiup/tiup-component-cluster-disable.md | 2 +- tiup/tiup-component-cluster-display.md | 2 +- tiup/tiup-component-cluster-edit-config.md | 2 +- tiup/tiup-component-cluster-enable.md | 4 +- tiup/tiup-component-cluster-help.md | 2 +- tiup/tiup-component-cluster-import.md | 6 +- tiup/tiup-component-cluster-patch.md | 4 +- tiup/tiup-component-cluster-reload.md | 2 +- tiup/tiup-component-cluster-rename.md | 2 +- tiup/tiup-component-cluster-restart.md | 4 +- tiup/tiup-component-cluster-scale-in.md | 4 +- tiup/tiup-component-cluster-scale-out.md | 2 +- tiup/tiup-component-cluster-start.md | 2 +- tiup/tiup-component-cluster-stop.md | 4 +- tiup/tiup-component-cluster-upgrade.md | 2 +- tiup/tiup-component-cluster.md | 4 +- tiup/tiup-component-dm-destroy.md | 4 +- tiup/tiup-component-dm-edit-config.md | 2 +- tiup/tiup-component-dm-help.md | 2 +- tiup/tiup-component-dm-import.md | 4 +- tiup/tiup-component-dm-patch.md | 2 +- tiup/tiup-component-dm-prune.md | 4 +- tiup/tiup-component-dm-reload.md | 2 +- tiup/tiup-component-dm-restart.md | 2 +- tiup/tiup-component-dm-scale-in.md | 2 +- tiup/tiup-component-dm-stop.md | 2 +- tiup/tiup-component-dm.md | 4 +- tiup/tiup-dm-topology-reference.md | 308 ++++----- tiup/tiup-mirror-reference.md | 2 +- tiup/tiup-reference.md | 2 +- 51 files changed, 596 insertions(+), 571 deletions(-) diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index 1b3b951472c3..690559138d7d 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -5,7 +5,7 @@ aliases: ['/docs-cn/dev/production-deployment-using-tiup/','/docs-cn/dev/how-to/ # 使用 TiUP 部署 TiDB 集群 -[TiUP](https://github.com/pingcap/tiup) 是 TiDB 4.0 版本引入的集群运维工具,[TiUP cluster](https://github.com/pingcap/tiup/tree/master/components/cluster) 是 TiUP 提供的使用 Golang 编写的集群管理组件,通过 TiUP cluster 组件就可以进行日常的运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 TiDB 集群;管理 TiDB 集群参数。 +[TiUP](https://github.com/pingcap/tiup) 是 TiDB 4.0 版本引入的集群运维工具,[TiUP cluster](https://github.com/pingcap/tiup/tree/master/components/cluster) 是 TiUP 提供的使用 Golang 编写的集群管理组件,通过 TiUP cluster 组件就可以进行日常的运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 TiDB 集群、管理 TiDB 集群参数。 目前 TiUP 可以支持部署 TiDB、TiFlash、TiDB Binlog、TiCDC,以及监控系统。本文将介绍不同集群拓扑的具体部署步骤。 diff --git a/telemetry.md b/telemetry.md index 2c7fddb2b825..d6008120dd25 100644 --- a/telemetry.md +++ b/telemetry.md @@ -6,7 +6,7 @@ aliases: ['/docs-cn/dev/telemetry/'] # 遥测 -TiDB、TiUP 及 TiDB Dashboard 默认会收集使用情况信息,并将这些信息分享给 PingCAP 用于改善产品,例如,通过这些使用情况信息,PingCAP 可以了解常见的 TiDB 集群操作,从而确定新功能优先级。 +TiDB、TiUP 及 TiDB Dashboard 默认会收集使用情况信息,并将这些信息分享给 PingCAP 用于改善产品,例如,通过这些使用信息,PingCAP 可以了解常见的 TiDB 集群操作,从而确定新功能优先级。 ## 哪些使用情况信息会被收集? @@ -43,7 +43,7 @@ ADMIN SHOW TELEMETRY; ### TiUP -当 TiUP 遥测功能开启时,执行 TiUP 命令时将会将使用情况信息分享给 PingCAP,包括(但不限于): +当 TiUP 遥测功能开启时,执行 TiUP 命令时会将使用情况信息分享给 PingCAP,包括(但不限于): - 随机生成的遥测标示符 - TiUP 命令的执行情况,如命令执行是否成功、命令执行耗时等 diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index bd761e1ad375..8c34a20effa7 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -16,8 +16,8 @@ aliases: ['/docs-cn/dev/tiup/tiup-cluster-topology-reference/'] 一个 TiDB 集群的拓扑文件可能包含以下区块: - [global](/tiup/tiup-cluster-topology-reference.md#global):集群全局配置,其中一些是集群的默认值,可以在实例里面单独配置 -- [monitored](/tiup/tiup-cluster-topology-reference.md#monitored):监控服务配置,即 blackbox exporter 和 node exporter,每台机器上都会部署一个 node expoter 一个 blackbox exporter -- [server_configs](/tiup/tiup-cluster-topology-reference.md#server_configs):全局服务配置,针对每种组件配置其默认配置,这个配置可以在每个实例里单独覆盖,该配置用于生成服务的配置文件 +- [monitored](/tiup/tiup-cluster-topology-reference.md#monitored):监控服务配置,即 blackbox exporter 和 node exporter,每台机器上都会部署一个 node exporter 一个 blackbox exporter +- [server_configs](/tiup/tiup-cluster-topology-reference.md#server_configs):组件全局配置,可单独针对每个组件配置,若在实例中存在同名配置项,那么以实例中配置的为准 - [pd_servers](/tiup/tiup-cluster-topology-reference.md#pd_servers):PD 实例的配置,用来指定 PD 组件部署到哪些机器上 - [tidb_servers](/tiup/tiup-cluster-topology-reference.md#tidb_servers): TiDB 实例的配置,用来指定 TiDB 组件部署到哪些机器上 - [tikv_servers](/tiup/tiup-cluster-topology-reference.md#tikv_servers):TiKV 实例的配置,用来指定 TiKV 组件部署到哪些机器上 @@ -27,40 +27,41 @@ aliases: ['/docs-cn/dev/tiup/tiup-cluster-topology-reference/'] - [cdc_servers](/tiup/tiup-cluster-topology-reference.md#cdc_servers):CDC 实例的配置,用来指定 CDC 组件部署到哪些机器上 - [tispark_masters](/tiup/tiup-cluster-topology-reference.md#tispark_masters):TiSpark Master 实例的配置,用来指定 TiSpark Master 组件部署到哪台机器上,仅允许部署一个 TiSpark Master 节点 - [tispark_workers](/tiup/tiup-cluster-topology-reference.md#tispark_workers):TiSpark Worker 实例的配置,用来指定 TiSpark Worker 组件部署到哪些机器上 -- [monitoring_servers](/tiup/tiup-cluster-topology-reference.md#monitoring_servers):Prometheus 实例的配置,用来指定 Prometheus 部署在哪台机器上 +- [monitoring_servers](/tiup/tiup-cluster-topology-reference.md#monitoring_servers):用来指定 Prometheus 部署在哪机器上,TiUP 支持部署多台 Prometheus 实例,但真实投入使用的只有第一个 - [grafana_servers](/tiup/tiup-cluster-topology-reference.md#grafana_servers):Grafana 实例的配置,用来指定 Grafana 部署在哪台机器上 - [alertmanager_servers](/tiup/tiup-cluster-topology-reference.md#alertmanager_servers):Alertemanager 实例的配置,用来指定 Alertmanager 部署在哪些机器上 -### global - -global 区块集群的全局配置,包含以下字段: - -- user:以什么用户来启动部署的集群,默认值:"tidb",如果 `` 字段指定的用户在目标机器上不存在,会自动尝试创建 -- group:自动创建用户时指定用户所属的用户组,默认和 `` 字段值相同,若指定的组不存在,则自动创建 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,默认值:22 -- enable_tls:是否对集群启用 tls,启用之后集群之间,客户端与集群之间都必须用生成的 tls 证书链接,启用后无法关闭,默认值:false -- deploy_dir:每个组件的默认部署目录,默认值:"deploy",其应用规则如下: - - 如果 `` 为绝对路径,那么组件会部署到 `/-` 目录 - - 如果 `` 为相对路径,那么组件会部署到 `/home///-` 目录 - - 对于在自己的实例中设置了 `deploy_dir` 字段的组件实例,部署路径由实例中的 `deploy_dir` 决定 -- data_dir:默认数据目录, 默认值 "data",其应用规则如下: - - 如果 `` 为绝对路径,那么组件数据将放到 `/-` - - 如果 `` 为相对路径,那么组件数据将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 - - 对于在自己的实例中设置了 `data_dir` 字段的组件实例,数据路径由实例中的 `data_dir` 决定 -- log_dir:默认数据目录, 默认值 "log",其应用规则如下: - - 如果 `` 为绝对路径,那么组件日志将放到 `/-` - - 如果 `` 为相对路径,那么组件日志将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 - - 对于在自己的实例中设置了 `log_dir` 字段的组件实例,日志路径由实例中的 `log_dir` 决定 -- os:目标机器的操作系统,该字段决定了向目标机器推送适配哪个操作系统的组件,默认值:linux -- arch:目标机器的架构,该字段决定了向目标机器推送哪个平台的二进制包,支持 amd64 和 arm64,默认值 amd64 -- resource_control:运行时资源控制,该字段下所有配置都将写入 systemd 的 service 文件中,默认不限制,支持控制的资源: - - memory_limit: 限制运行时最大内存,例如 "2G" 表示最多使用 2G 内存 - - cpu_quota:限制运行时最大 CPU 占用率,例如 "200%" - - io_read_bandwidth_max:读磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" - - io_write_bandwidth_max:写磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" - - limit_core:控制 core dump 大小 - -global 配置示例: +### `global` + +`global` 区块为集群的全局配置,包含以下字段: + +- `user`:以什么用户来启动部署的集群,默认值:"tidb",如果 `` 字段指定的用户在目标机器上不存在,会自动尝试创建 +- `group`:自动创建用户时指定用户所属的用户组,默认和 `` 字段值相同,若指定的组不存在,则自动创建 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,默认值:22 +- `enable_tls`:是否对集群启用 TLS,启用之后组件之间、客户端与组件之间都必须使用生成的 TLS 证书链接,**启用后无法关闭**,默认值:false +- `deploy_dir`:每个组件的部署目录,默认值:"deploy",其应用规则如下: + - 如果在实例级别配置了绝对路径的 `deploy_dir`,那么实际部署目录为该实例设定的 `deploy_dir` + - 对于每个实例,如果用户未配置 `deploy_dir`,其默认值为相对路径 `-` + - 如果 `global.deploy_dir` 为绝对路径,那么组件会部署到 `/` 目录 + - 如果 `global.deploy_dir` 为相对路径,那么组件会部署到 `/home///` 目录 +- `data_dir`:数据目录, 默认值:"data",其应用规则如下: + - 如果在实例级别配置了绝对路径的 `data_dir`,那么实际数据目录为该实例设定的 `data_dir` + - 对于每个实例,如果用户未配置 `data_dir`,其默认值为 `` + - 如果 `data_dir` 为相对路径,那么组件数据将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 +- `log_dir`:数据目录, 默认值:"log",其应用规则如下: + - 如果在实例级别配置了绝对路径的 `log_dir`,那么实际日志目录为该实例设定的 `log_dir` + - 对于每个实例,如果用户未配置 `log_dir`,其默认值为 `` + - 如果 `log_dir` 为相对路径,那么组件日志将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 +- `os`:目标机器的操作系统,该字段决定了向目标机器推送适配哪个操作系统的组件,默认值:linux +- `arch`:目标机器的 CPU 架构,该字段决定了向目标机器推送哪个平台的二进制包,支持 amd64 和 arm64,默认值:amd64 +- `resource_control`:运行时资源控制,该字段下所有配置都将写入 systemd 的 service 文件中,默认不限制,支持控制的资源: + - `memory_limit`: 限制运行时最大内存,例如 "2G" 表示最多使用 2GB 内存 + - `cpu_quota`:限制运行时最大 CPU 占用率,例如 "200%" + - `io_read_bandwidth_max`:读磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" + - `io_write_bandwidth_max`:写磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" + - `limit_core`:控制 core dump 大小 + +`global` 配置示例: ```yaml global: @@ -69,17 +70,19 @@ global: memory_limit: "2G" ``` -### monitored +上述配置指定使用 tidb 用户启动集群,同时限制每个组件运行时最多只能使用 2GB 内存。 -monitored 用于配置目标机上的监控服务:node_exporter 和 blackbox_exporter,它包含这些字段: +### `monitored` -- node_exporter_port: node_exporter 的服务端口,默认值 9100 -- blackbox_exporter_port:blackbox_exporter 的服务端口,默认值 9115 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 +`monitored` 用于配置目标机上的监控服务:[node_exporter](https://github.com/prometheus/node_exporter) 和 [blackbox_exporter](https://github.com/prometheus/blackbox_exporter),它包含这些字段: -monitored 配置示例: +- `node_exporter_port`: node_exporter 的服务端口,默认值:9100 +- `blackbox_exporter_port`:blackbox_exporter 的服务端口,默认值:9115 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 + +`monitored` 配置示例: ```yaml monitored: @@ -87,20 +90,22 @@ monitored: blackbox_exporter_port: 9115 ``` -### server_configs +上述配置指定了 node_exporter 使用 9100 端口,blackbox_exporter 使用 9115 端口。 + +### `server_configs` -server_configs 用于配置服务,生成各组件的配置文件,类似 global 区块,该区块内的配置可以在具体的实例中被覆盖。主要包含以下字段: +`server_configs` 用于配置服务,生成各组件的配置文件,类似 global 区块,该区块内的配置可以在具体的实例中被覆盖。主要包含以下字段: -- tidb:TiDB 服务的相关配置,支持的所有配置请参考[TiDB 配置文件描述](/tidb-configuration-file.md) -- tikv:TiKV 服务的相关配置,支持的所有配置请参考[TiKV 配置文件描述](/tikv-configuration-file.md) -- pd:PD 服务的相关配置,支持的所有配置请参考[PD 配置文件描述](/pd-configuration-file.md) -- tiflash:TiFlash 服务的相关配置,支持的所有配置请参考[TiFlash 配置参数](/tiflash-configuration.md) -- tiflash_learner:每个 TiFlash 中内置了一个特殊的 TiKV,该配置用于配置这个特殊的 TiKV,一般不建议修改这个配置下的内容 -- pump:pump 服务相关配置,支持的所有配置请参考[TiDB Binlog 配置说明](/tidb-binlog-configuration-file.md#pump) -- drainer:drainer 服务相关配置,支持的所有配置请参考[TiDB Binlog 配置说明](/tidb-binlog-configuration-file.md#drainer) -- cdc:cdc 服务相关配置,支持的所有配置请参考[TiCDC 安装部署](/deploy-ticdc.md) +- `tidb`:TiDB 服务的相关配置,支持的完整配置请参考[TiDB 配置文件描述](/tidb-configuration-file.md) +- `tikv`:TiKV 服务的相关配置,支持的完整配置请参考[TiKV 配置文件描述](/tikv-configuration-file.md) +- `pd`:PD 服务的相关配置,支持的完整配置请参考[PD 配置文件描述](/pd-configuration-file.md) +- `tiflash`:TiFlash 服务的相关配置,支持的完整配置请参考[TiFlash 配置参数](/tiflash-configuration.md) +- `tiflash_learner`:每个 TiFlash 中内置了一个特殊的 TiKV,该配置项用于配置这个特殊的 TiKV,一般不建议修改这个配置项下的内容 +- `pump`:Pump 服务的相关配置,支持的完整配置请参考[TiDB Binlog 配置说明](/tidb-binlog-configuration-file.md#pump) +- `drainer`:Drainer 服务的相关配置,支持的完整配置请参考[TiDB Binlog 配置说明](/tidb-binlog-configuration-file.md#drainer) +- `cdc`:CDC 服务的相关配置,支持的完整配置请参考[TiCDC 安装部署](/deploy-ticdc.md) -server_configs 配置示例: +`server_configs` 配置示例: ```yaml server_configs: @@ -114,39 +119,41 @@ server_configs: readpool.unified.min-thread-count: 1 ``` -### pd_servers - -pd_servers 约定了将 PD 的服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: - -- host:部署到哪台机器,填 IP 地址,不可省略 -- listen_host:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 host 所指定的 IP -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- name:指定该 PD 实例的名字,不同实例的名字不能相同 -- client_port:指定 pd 的客户端链接端口,默认是 2379 -- peer_port:指定 pd 之间互相通信的端口,默认是 2380 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config:该字段配置规则和 server_configs 里的 pd 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 pd 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +上述配置指定了 TiDB 和 TiKV 的全局配置。 + +### `pd_servers` + +`pd_servers` 约定了将 PD 的服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: + +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `name`:指定该 PD 实例的名字,不同实例的名字必须唯一,否则无法部署 +- `client_port`:指定 PD 的客户端连接端口,默认是 2379 +- `peer_port`:指定 PD 之间互相通信的端口,默认是 2380 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 `pd` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `pd` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- listen_host -- name -- client_port -- peer_port -- deploy_dir -- data_dir -- log_dir -- arch -- os +- `host` +- `listen_host` +- `name` +- `client_port` +- `peer_port` +- `deploy_dir` +- `data_dir` +- `log_dir` +- `arch` +- `os` -pd_servers 配置示例: +`pd_servers` 配置示例: ```yaml pd_servers: @@ -157,35 +164,37 @@ pd_servers: - host: 10.0.1.12 ``` -### tidb_servers +上述配置指定了将 PD 部署到 `10.0.1.11` 和 `10.0.1.12`,并针对 `10.0.1.11` 的 PD 进行一些特殊配置。 + +### `tidb_servers` -tidb_servers 约定了将 TiDB 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: +`tidb_servers` 约定了将 TiDB 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- listen_host:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 host 所指定的 IP -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:TiDB 服务的监听端口,用于提供给 MySQL 客户端连接,默认 4000 -- status_port:TiDB 状态服务的监听端口,用于外部通过 http 请求查看 TiDB 服务的状态,默认 10080 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config:该字段配置规则和 server_configs 里的 tidb 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 tidb 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `port`:TiDB 服务的监听端口,用于提供给 MySQL 客户端连接,默认 4000 +- `status_port`:TiDB 状态服务的监听端口,用于外部通过 http 请求查看 TiDB 服务的状态,默认 10080 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 `tidb` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tidb` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `os`:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os +- `arch`:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- listen_host -- port -- status_port -- deploy_dir -- log_dir -- arch -- os +- `host` +- `listen_host` +- `port` +- `status_port` +- `deploy_dir` +- `log_dir` +- `arch` +- `os` -tidb_servers 配置示例: +`tidb_servers` 配置示例: ```yaml tidb_servers: @@ -196,37 +205,37 @@ tidb_servers: - host: 10.0.1.15 ``` -### tikv_servers +### `tikv_servers` -tikv_servers 约定了将 TiKV 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`tikv_servers` 约定了将 TiKV 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- listen_host:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 host 所指定的 IP -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:TiKV 服务的监听端口,默认 20160 -- status_port:TiKV 状态服务的监听端口,默认 20180 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config:该字段配置规则和 server_configs 里的 tikv 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 tikv 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `port`:TiKV 服务的监听端口,默认 20160 +- `status_port`:TiKV 状态服务的监听端口,默认 20180 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 server_configs 里的 tikv 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tikv` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `os`:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:host 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- listen_host -- port -- status_port -- deploy_dir -- data_dir -- log_dir -- arch -- os +- `host` +- `listen_host` +- `port` +- `status_port` +- `deploy_dir` +- `data_dir` +- `log_dir` +- `arch` +- `os` -tikv_servers 配置示例: +`tikv_servers` 配置示例: ```yaml tikv_servers: @@ -238,45 +247,45 @@ tikv_servers: server.labels: { zone: "zone1", host: "host2" } ``` -### tiflash_servers - -tiflash_servers 约定了将 TiFlash 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: - -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- tcp_port:TiFlash TCP 服务的端口,默认 9000 -- http_port:TiFlash HTTP 服务的端口,默认 8123 -- flash_service_port:TiFlash 提供服务的端口,TiDB 通过该端口从 TiFlash 读数据,默认 3930 -- metrics_port:TiFlash 的状态端口,用于输出 metric 数据,默认 8234 -- flash_proxy_port:内置 TiKV 的端口,默认 20170 -- flash_proxy_status_port:内置 TiKV 的状态端口,默认为 20292 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成,TiFlash 的数据目录支持多个,采用逗号分割 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- tmp_path: TiFlash 临时文件的存放路径,默认使用 [`path` 或者 `storage.latest.dir` 的第一个目录] + "/tmp" -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config:该字段配置规则和 server_configs 里的 tiflash 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 tiflash 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 -- learner_config:每个 TiFlash 中内置了一个特殊的 TiKV,该配置用于配置这个特殊的 TiKV,一般不建议修改这个配置下的内容 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control - -以上字段中,data_dir 在部署完成之后只能新增目录,而以下字段在部署完成之后就不能再修改: - -- host -- tcp_port -- http_port -- flash_service_port -- flash_proxy_port -- flash_proxy_status_port -- metrics_port -- deploy_dir -- log_dir -- tmp_path -- arch -- os - -tiflash_servers 配置示例: +### `tiflash_servers` + +`tiflash_servers` 约定了将 TiFlash 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: + +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 ssh_port +- `tcp_port`:TiFlash TCP 服务的端口,默认 9000 +- `http_port`:TiFlash HTTP 服务的端口,默认 8123 +- `flash_service_port`:TiFlash 提供服务的端口,TiDB 通过该端口从 TiFlash 读数据,默认 3930 +- `metrics_port`:TiFlash 的状态端口,用于输出 metric 数据,默认 8234 +- `flash_proxy_port`:内置 TiKV 的端口,默认 20170 +- `flash_proxy_status_port`:内置 TiKV 的状态端口,默认为 20292 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成,TiFlash 的数据目录支持多个,采用逗号分割 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `tmp_path`: TiFlash 临时文件的存放路径,默认使用 [`path` 或者 `storage.latest.dir` 的第一个目录] + "/tmp" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 `tiflash` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tiflash` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `learner_config`:每个 TiFlash 中内置了一个特殊的 TiKV,该配置项用于配置这个特殊的 TiKV,一般不建议修改这个配置项下的内容 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` + +以上字段中,`data_dir` 在部署完成之后只能新增目录,而以下字段在部署完成之后就不能再修改: + +- `host` +- `tcp_port` +- `http_port` +- `flash_service_port` +- `flash_proxy_port` +- `flash_proxy_status_port` +- `metrics_port` +- `deploy_dir` +- `log_dir` +- `tmp_path` +- `arch` +- `os` + +`tiflash_servers` 配置示例: ```yaml tiflash_servers: @@ -284,33 +293,33 @@ tiflash_servers: - host: 10.0.1.22 ``` -### pump_servers +### `pump_servers` -pump_servers 约定了将 Binlog 组件的 Pump 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`pump_servers` 约定了将 Binlog 组件的 Pump 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:Pump 服务的监听端口,默认 8250 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config:该字段配置规则和 server_configs 里的 pump 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 pump 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 ssh_port +- `port`:Pump 服务的监听端口,默认 8250 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 `pump` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `pump` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- port -- deploy_dir -- data_dir -- log_dir -- arch -- os +- `host` +- `port` +- `deploy_dir` +- `data_dir` +- `log_dir` +- `arch` +- `os` -pump_servers 配置示例: +`pump_servers` 配置示例: ```yaml pump_servers: @@ -320,35 +329,35 @@ pump_servers: - host: 10.0.1.22 ``` -### drainer_servers +### `drainer_servers` -drainer_servers 约定了将 Binlog 组件的 Drainer 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`drainer_servers` 约定了将 Binlog 组件的 Drainer 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:Drainer 服务的监听端口,默认 8249 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- commit_ts:Drainer 启动的时候会去读取 checkpoint,如果读取不到,就会使用该字段做为初次启动开始的同步时间点,该字段默认为 -1(从 PD 总获取最新时间戳作为 commit_ts) -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config:该字段配置规则和 server_configs 里的 drainer 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 drainer 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `port`:Drainer 服务的监听端口,默认 8249 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `commit_ts`:Drainer 启动的时候会去读取 checkpoint,如果读取不到,就会使用该字段做为初次启动开始的同步时间点,该字段默认为 -1(从 PD 总获取最新时间戳作为 commit_ts) +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 `drainer` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `drainer` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- port -- deploy_dir -- data_dir -- log_dir -- commit_ts -- arch -- os +- `host` +- `port` +- `deploy_dir` +- `data_dir` +- `log_dir` +- `commit_ts` +- `arch` +- `os` -drainer_servers 配置示例: +`drainer_servers` 配置示例: ```yaml drainer_servers: @@ -366,35 +375,35 @@ drainer_servers: tbl-name: audit ``` -### cdc_servers +### `cdc_servers` -cdc_servers 约定了将 CDC 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`cdc_servers` 约定了将 CDC 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:CDC 服务的监听端口,默认 8300 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- gc-ttl:TiCDC 在 PD 设置的服务级别 GC safepoint 的 TTL (Time To Live) 时长,单位为秒,默认值为 86400,即 24 小时 -- tz:TiCDC 服务使用的时区。TiCDC 在内部转换 timestamp 等时间数据类型和向下游同步数据时使用该时区,默认为进程运行本地时区。 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config:该字段配置规则和 server_configs 里的 cdc 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `port`:CDC 服务的监听端口,默认 8300 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `gc-ttl`:TiCDC 在 PD 设置的服务级别 GC safepoint 的 TTL (Time To Live) 时长,单位为秒,默认值为 86400,即 24 小时 +- `tz`:TiCDC 服务使用的时区。TiCDC 在内部转换 timestamp 等时间数据类型和向下游同步数据时使用该时区,默认为进程运行本地时区。 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 `cdc` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- port -- deploy_dir -- log_dir -- gc-ttl -- tz -- arch -- os +- `host` +- `port` +- `deploy_dir` +- `log_dir` +- `gc-ttl` +- `tz` +- `arch` +- `os` -cdc_servers 配置示例: +`cdc_servers` 配置示例: ```yaml cdc_servers: @@ -403,33 +412,33 @@ cdc_servers: - host: 10.0.1.21 ``` -### tispark_masters +### `tispark_masters` -tispark_masters 约定了将 TiSpark 的 master 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`tispark_masters` 约定了将 TiSpark 的 master 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- listen_host:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 host 所指定的 IP -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:Spark 的监听端口,节点之前通讯用,默认 7077 -- web_port:Spark 的网页端口,提供网页服务,可查看任务情况,默认 8080 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- java_home:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 JAVA_HOME -- spark_config:用于配置 TiSpark 服务,生成配置文件下发到 host 指定的机器 -- spark_env:配置 Spark 启动时的环境变量 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 ssh_port +- `port`:Spark 的监听端口,节点之前通讯用,默认 7077 +- `web_port`:Spark 的网页端口,提供网页服务,可查看任务情况,默认 8080 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `java_home`:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 JAVA_HOME +- `spark_config`:用于配置 TiSpark 服务,生成配置文件下发到 `host` 指定的机器 +- `spark_env`:配置 Spark 启动时的环境变量 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- listen_host -- port -- web_port -- deploy_dir -- arch -- os +- `host` +- `listen_host` +- `port` +- `web_port` +- `deploy_dir` +- `arch` +- `os` -tispark_masters 配置示例: +`tispark_masters` 配置示例: ```yaml tispark_masters: @@ -450,31 +459,31 @@ tispark_masters: - host: 10.0.1.22 ``` -### tispark_workers +### `tispark_workers` -tispark_workers 约定了将 TiSpark 的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`tispark_workers `约定了将 TiSpark 的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- listen_host:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 host 所指定的 IP -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:Spark 的监听端口,节点之前通讯用,默认 7077 -- web_port:Spark 的网页端口,提供网页服务,可查看任务情况,默认 8080 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- java_home:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 JAVA_HOME -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `port`:Spark 的监听端口,节点之前通讯用,默认 7077 +- `web_port`:Spark 的网页端口,提供网页服务,可查看任务情况,默认 8080 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `java_home`:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 JAVA_HOME +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- listen_host -- port -- web_port -- deploy_dir -- arch -- os +- `host` +- `listen_host` +- `port` +- `web_port` +- `deploy_dir` +- `arch` +- `os` -tispark_workers 配置示例: +`tispark_workers` 配置示例: ```yaml tispark_workers: @@ -482,34 +491,34 @@ tispark_workers: - host: 10.0.1.23 ``` -### monitoring_servers +### `monitoring_servers` -monitoring_servers 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`monitoring_servers` 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:指定 Prometheus 提供服务的端口,默认是 9090 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- storage_retention:Prometheus 监控数据保留时间,默认 "15d" -- rule_dir:该字段指定一个本地目录,该目录中应当含有完整的 *.rules.yml 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 ssh_port +- `port`:指定 Prometheus 提供服务的端口,默认是 9090 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `storage_retention`:Prometheus 监控数据保留时间,默认 "15d" +- `rule_dir`:该字段指定一个本地目录,该目录中应当含有完整的 *.rules.yml 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- port -- deploy_dir -- data_dir -- log_dir -- arch -- os +- `host` +- `port` +- `deploy_dir` +- `data_dir` +- `log_dir` +- `arch` +- `os` -monitoring_servers 配置示例: +`monitoring_servers` 配置示例: ```yaml monitoring_servers: @@ -517,37 +526,37 @@ monitoring_servers: rule_dir: /local/rule/dir ``` -### grafana_servers +### `grafana_servers` -grafana_servers 约定了将 Grafana 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`grafana_servers` 约定了将 Grafana 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:指定 Grafana 提供服务的端口,默认是 3000 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- username:Grafana 登陆界面的用户名 -- password:Grafana 对应的密码 -- dashboard_dir:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `port`:指定 Grafana 提供服务的端口,默认是 3000 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `username`:Grafana 登陆界面的用户名 +- `password`:Grafana 对应的密码 +- `dashboard_dir`:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` > **注意:** > -> 如果配置了 grafana_servers 的 dashboard_dir 字段,在执行 tiup cluster rename 命令进行集群重命名后,需要完成以下操作: +> 如果配置了 `grafana_servers` 的 `dashboard_dir` 字段,在执行 `tiup cluster rename` 命令进行集群重命名后,需要完成以下操作: > > 1. 对于本地的 dashboards 目录中的 `*.json` 文件,将 datasource 字段的值更新为新的集群名(这是因为 datasource 是以集群名命名的) -> 2. 执行 tiup cluster reload -R grafana 命令 +> 2. 执行 `tiup cluster reload -R grafana` 命令 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- port -- deploy_dir -- arch -- os +- `host` +- `port` +- `deploy_dir` +- `arch` +- `os` -grafana_servers 配置示例: +`grafana_servers` 配置示例: ```yaml grafana_servers: @@ -555,35 +564,35 @@ grafana_servers: dashboard_dir: /local/dashboard/dir ``` -### alertmanager_servers +### `alertmanager_servers` -alertmanager_servers 约定了将 Alertmanager 服务部署到哪些机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`alertmanager_servers` 约定了将 Alertmanager 服务部署到哪些机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- web_port:指定 Alertmanager 提供网页服务的端口,默认是 9093 -- cluster_port:指定 Alertmanger 和 其他 Alertmanager 通讯的端口,默认是 9094 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config_file:该字段指定一个本地文件,该文件会在集群配置初始化阶段被传输到目标机器上,作为 Alertmanager 的配置 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `web_port`:指定 Alertmanager 提供网页服务的端口,默认是 9093 +- `cluster_port`:指定 Alertmanger 和 其他 Alertmanager 通讯的端口,默认是 9094 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config_file`:该字段指定一个本地文件,该文件会在集群配置初始化阶段被传输到目标机器上,作为 Alertmanager 的配置 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- web_port -- cluster_port -- deploy_dir -- data_dir -- log_dir -- arch -- os +- `host` +- `web_port` +- `cluster_port` +- `deploy_dir` +- `data_dir` +- `log_dir` +- `arch` +- `os` -alertmanager_servers 配置示例: +`alertmanager_servers` 配置示例: ```yaml alertmanager_servers: @@ -591,4 +600,4 @@ alertmanager_servers: config_file: /local/config/file - host: 10.0.1.12 config_file: /local/config/file -``` \ No newline at end of file +``` diff --git a/tiup/tiup-cluster.md b/tiup/tiup-cluster.md index d810b278c505..813b4cec7fc8 100644 --- a/tiup/tiup-cluster.md +++ b/tiup/tiup-cluster.md @@ -216,7 +216,7 @@ Status 列用 `Up` 或者 `Down` 表示该服务是否正常。对于 PD 组件 > > 本节只展示缩容命令的语法示例,线上扩缩容具体步骤可参考[使用 TiUP 扩容缩容 TiDB 集群](/scale-tidb-using-tiup.md)。 -缩容即下线服务,最终会将指定的节点从集群中移除,并删除遗留的相关数据文件。 +缩容即下线服务,最终会将指定的节点从集群中移除,并删除遗留的相关文件。 由于 TiKV 和 TiDB Binlog 组件的下线是异步的(需要先通过 API 执行移除操作)并且下线过程耗时较长(需要持续观察节点是否已经下线成功),所以对 TiKV 和 TiDB Binlog 组件做了特殊处理: diff --git a/tiup/tiup-command-clean.md b/tiup/tiup-command-clean.md index 7b7aa9c2f844..aaeeba1fa3f7 100644 --- a/tiup/tiup-command-clean.md +++ b/tiup/tiup-command-clean.md @@ -15,7 +15,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-clean/'] tiup clean [name] [flags] ``` -`[name]` 代表 [status 命令](/tiup/tiup-command-status.md)输出的 `Name` 字段。若省略 ``,则必须配合 `--all` 使用。 +`[name]` 取值为 [status 命令](/tiup/tiup-command-status.md)输出的 `Name` 字段。若省略 ``,则必须配合 `--all` 使用。 ## 选项 diff --git a/tiup/tiup-command-completion.md b/tiup/tiup-command-completion.md index 4aab051b84a7..027adb44b62a 100644 --- a/tiup/tiup-command-completion.md +++ b/tiup/tiup-command-completion.md @@ -12,7 +12,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-completion/'] 如果是 bash,需要提前安装好 bash-completion: - macOS 的安装方式为:`brew install bash-completion` 或者 `brew install bash-completion@2`(Bash 4.1+) -- Linux 的安装方式为:使用包管理器安装 `bash-completion` 包 +- Linux 的安装方式为:使用包管理器安装 `bash-completion` 包,例如 `yum install bash-completion` 或者 `apt install bash-completion` ## 语法 @@ -29,11 +29,11 @@ tiup completion 将自动补全代码写入一个文件,并且在 .bash_profile 中 source 之: ```sh -tiup completion bash > ~/.completion.bash.inc +tiup completion bash > ~/.tiup.completion.bash printf " # tiup shell completion -source '$HOME/.completion.bash.inc' +source '$HOME/.tiup.completion.bash' " >> $HOME/.bash_profile source $HOME/.bash_profile diff --git a/tiup/tiup-command-env.md b/tiup/tiup-command-env.md index 09990913586f..662f169b9cc9 100644 --- a/tiup/tiup-command-env.md +++ b/tiup/tiup-command-env.md @@ -26,4 +26,4 @@ tiup env [name1...N] - 若未指定 `[name1...N]`,则输出 "{key}"="{value}" 列表 - 若指定了 `[name1...N]`,则按顺序输出 "{value}" 列表 -以上输出若 value 为空则代表其未设置,TiUP 会采用默认行为。 \ No newline at end of file +以上输出若 value 为空则代表其值未设置,TiUP 会采用默认行为。 \ No newline at end of file diff --git a/tiup/tiup-command-help.md b/tiup/tiup-command-help.md index fc73fe6d109e..514f871a8820 100644 --- a/tiup/tiup-command-help.md +++ b/tiup/tiup-command-help.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-help/'] ## 介绍 -TiUP 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得,基本上,`tiup help ` 等价于 `tiup --help`。 +TiUP 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得。基本上,`tiup help ` 等价于 `tiup --help`。 ## 语法 diff --git a/tiup/tiup-command-install.md b/tiup/tiup-command-install.md index 67d3779d1ce5..59aa750c96e3 100644 --- a/tiup/tiup-command-install.md +++ b/tiup/tiup-command-install.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-install/'] ## 介绍 -命令 `tiup install` 用于安装一个或多个组件,它会从镜像仓库中下载特定版本的组件包,并在本地的 TiUP 数据目录中解压,以便后续使用 TiUP 运行该组件。 +命令 `tiup install` 用于安装一个或多个组件,它会从镜像仓库中下载特定版本的组件包,并在本地的 TiUP 数据目录中解压,以便后续使用。另外,当 TiUP 运行一个组件不存在的时候,会尝试先下载该组件,再自动运行,若不存在则报错。 ## 语法 diff --git a/tiup/tiup-command-mirror-clone.md b/tiup/tiup-command-mirror-clone.md index 7746f240f3d3..42d537c4f489 100644 --- a/tiup/tiup-command-mirror-clone.md +++ b/tiup/tiup-command-mirror-clone.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-clone/'] ## 介绍 -命令 `tiup mirror clone` 用于从一个已经存在的镜像上克隆或部分克隆出一个新的镜像,新的镜像和旧的镜像组件/部分组件相同,但使用的密钥不同。 +命令 `tiup mirror clone` 用于从一个已经存在的镜像上克隆或部分克隆出一个新的镜像,新旧镜像的组件/部分组件相同,但使用的签名密钥不同。 ## 语法 diff --git a/tiup/tiup-command-mirror-genkey.md b/tiup/tiup-command-mirror-genkey.md index 476d7e6ccfb5..9f39f8c4d2d6 100644 --- a/tiup/tiup-command-mirror-genkey.md +++ b/tiup/tiup-command-mirror-genkey.md @@ -29,7 +29,7 @@ tiup mirror genkey [flags] ### -n, --name(string,默认 private) -密钥的名字,该名字决定最终生成的文件名,生成的私钥文件路径为:${TIUP_HOME}/keys/{name}.json,其中 `TIUP_HOME` 为 TiUP 的家目录,`name` 为 `-n/--name` 指定的密钥名字。 +密钥的名字,该名字决定最终生成的文件名,生成的私钥文件路径为:`${TIUP_HOME}/keys/{name}.json`,其中 `TIUP_HOME` 为 TiUP 的家目录,默认路径为 `$HOME/.tiup`,`name` 为 `-n/--name` 指定的密钥名字。 ### -p, --public(boolean,默认 false) @@ -45,7 +45,7 @@ tiup mirror genkey [flags] - 若未指定 `-p/--public`: - 若指定的密钥已存在:`Key already exists, skipped` - - 若指定的密钥不存在:`private key have been write to ${TIUP_HOME}/keys/{name}.json` + - 若指定的密钥不存在:`private key have been write to `${TIUP_HOME}/keys/{name}.json`` - 若指定 `-p/--public`: - - 若指定的密钥不存在:`Error: open ${TIUP_HOME}/keys/{name}.json: no such file or directory` + - 若指定的密钥不存在:`Error: open `${TIUP_HOME}/keys/{name}.json`: no such file or directory` - 若指定的密钥存在:输出该密钥对应的公钥内容 diff --git a/tiup/tiup-command-mirror-merge.md b/tiup/tiup-command-mirror-merge.md index 1c4cd0302491..f1032e250974 100644 --- a/tiup/tiup-command-mirror-merge.md +++ b/tiup/tiup-command-mirror-merge.md @@ -7,12 +7,12 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-merge/'] ## 介绍 -命令 `tiup mirror merge` 用于合并一个或多个镜像到当前镜像。在合并之前,需要使用命令 [tiup mirror set](/tiup/tiup-command-mirror-set.md) 指定当一个有权限发布组件的前镜像。 +命令 `tiup mirror merge` 用于合并一个或多个镜像到当前镜像。 执行此命令需要满足几个条件: - 目标镜像的所有组件的管理员 ID 必须在当前镜像中存在 -- 执行该命令的用户的 `${TIUP_HOME}/keys` 目录中有上述管理员 ID 在当前镜像中对应的所有的私钥 +- 执行该命令的用户的 `${TIUP_HOME}/keys` 目录中有上述管理员 ID 在当前镜像中对应的所有的私钥(可以使用命令 [tiup mirror set](/tiup/tiup-command-mirror-set.md) 将当前镜像切换成目前有权限修改的镜像) ## 语法 diff --git a/tiup/tiup-command-mirror-publish.md b/tiup/tiup-command-mirror-publish.md index 1963645ae799..71f08b23cc1c 100644 --- a/tiup/tiup-command-mirror-publish.md +++ b/tiup/tiup-command-mirror-publish.md @@ -17,7 +17,7 @@ tiup mirror publish [flags] 各个参数解释如下: -- ``:组件名,如 ,建议使用符合正则 `^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$` 的字符串 +- ``:组件名,如 `tidb`,建议使用符合正则 `^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$` 的字符串 - ``:当前正在发布的版本,需要符合 [Semantic Versioning](https://semver.org/) - ``:`.tar.gz` 包的本地路径,需要将组件的可执行文件及依赖放在该包中,由 TiUP 上传到镜像 - ``:组件的可执行文件在 `` 中的位置 diff --git a/tiup/tiup-command-mirror-set.md b/tiup/tiup-command-mirror-set.md index 16c1b6d65531..a04173129661 100644 --- a/tiup/tiup-command-mirror-set.md +++ b/tiup/tiup-command-mirror-set.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-set/'] ## 介绍 -命令 `tiup mirror set` 用于切换当前镜像,支持本地文件系统镜像和远程网络镜像两种镜像。 +命令 `tiup mirror set` 用于切换当前镜像,支持本地文件系统和远程网络两种镜像。 官方镜像为 `https://tiup-mirrors.pingcap.com` @@ -20,7 +20,7 @@ tiup mirror set [flags] `` 为镜像地址,可以有两种形式: - 网络地址:http 或者 https 开头,如 http://172.16.5.5:8080,https://tiup-mirrors.pingcap.com 等 -- 本地文件路径:镜像目录的绝对路径 +- 本地文件路径:镜像目录的绝对路径,比如 /path/to/local-tiup-mirror ## 选项 diff --git a/tiup/tiup-command-telemetry.md b/tiup/tiup-command-telemetry.md index 37d04f890435..3477dcecfa5b 100644 --- a/tiup/tiup-command-telemetry.md +++ b/tiup/tiup-command-telemetry.md @@ -7,16 +7,26 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-telemetry/'] ## 介绍 -TiDB、TiUP 及 TiDB Dashboard 默认会收集使用情况信息,并将这些信息分享给 PingCAP 用于改善产品,例如,通过这些使用情况信息,PingCAP 可以了解常见的 TiDB 集群操作,从而确定新功能优先级。 +TiDB、TiUP 及 TiDB Dashboard 默认会收集使用情况信息,并将这些信息分享给 PingCAP 用于改善产品,例如,通过这些使用信息,PingCAP 可以了解常见的 TiDB 集群操作,从而确定新功能优先级。 -当 TiUP 遥测功能开启时,执行 TiUP 命令时将会将使用情况信息分享给 PingCAP,包括(但不限于): +当 TiUP 遥测功能开启时,执行 TiUP 命令时会将使用情况信息分享给 PingCAP,包括(但不限于): - 随机生成的遥测标示符 - TiUP 命令的执行情况,如命令执行是否成功、命令执行耗时等 - 使用 TiUP 进行部署的情况,如部署的目标机器硬件信息、组件版本号、修改过的部署配置名称等 +以下信息不会被分享: + +- 集群的准确名字 +- 集群的拓扑结构 +- 集群的配置文件 + TiUP 使用命令 `tiup telemetry` 来控制遥测。 +> **注意:** +> +> 该功能默认是打开的。 + ## 语法 ```sh diff --git a/tiup/tiup-command-uninstall.md b/tiup/tiup-command-uninstall.md index b7e3deb6e9b7..f2e10432aadc 100644 --- a/tiup/tiup-command-uninstall.md +++ b/tiup/tiup-command-uninstall.md @@ -15,7 +15,9 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-uninstall/'] tiup uninstall : [component2...N] [flags] ``` -`` 表示要卸载的组件名字,`` 表示要卸载的版本,如果省略,则表示卸载该组件的全部已安装版本,因为安全原因,省略 `` 时必须加上选项 `--all` 明确表示需要卸载该组件的所有版本。`[component2...N]` 表示可指定卸载多个组件或版本。 +- `` 表示要卸载的组件名字 +- `` 表示要卸载的版本,如果省略,则表示卸载该组件的全部已安装版本,因为安全原因,省略 `` 时必须加上选项 `--all` 明确表示需要卸载该组件的所有版本 +- `[component2...N]` 表示可指定卸载多个组件或版本 ## 选项 @@ -25,7 +27,7 @@ tiup uninstall : [component2...N] [flags] ### --self(boolean,默认 false) -卸载 TiUP 自身:删除所有从镜像上下载过来的数据,但会保留 TiUP 及其组件产生的数据,数据存放在 TIUP_HOME 指定的文件夹中,若未设置过 TIUP_HOME,则默认值为 ~/.tiup/。 +卸载 TiUP 自身:删除所有从镜像上下载过来的数据,但会保留 TiUP 及其组件产生的数据,数据存放在 `TIUP_HOME` 环境变量指定的目录中,若未设置过 `TIUP_HOME`,则默认值为 `~/.tiup/`。 ## 输出 diff --git a/tiup/tiup-command-update.md b/tiup/tiup-command-update.md index eefdca957b53..d1ff98225f32 100644 --- a/tiup/tiup-command-update.md +++ b/tiup/tiup-command-update.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-update/'] ## 介绍 -命令 `tiup update` 用于升级已安装的组件。 +命令 `tiup update` 用于升级已安装的组件或者自身。 ## 语法 @@ -15,23 +15,25 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-update/'] tiup update [component1][:version] [component2..N] [flags] ``` -`[component1]` 表示要升级的组件名字,`[version]` 表示要卸载的版本,如果省略,则表示升级到该组件的最新稳定版本,`[component2...N]` 表示可指定升级多个组件或版本。如果一个组件也不指定:即 `[component1][:version] [component2..N]` 为空,则需要配合使用 `--all` 选项或 `--self` 选项。 +- `[component1]` 表示要升级的组件名字 +- `[version]` 表示要卸载的版本,如果省略,则表示升级到该组件的最新稳定版本 +- `[component2...N]` 表示可指定升级多个组件或版本。如果一个组件也不指定:即 `[component1][:version] [component2..N]` 为空,则需要配合使用 `--all` 选项或 `--self` 选项。 -升级操作不会删除旧的版本,仍然可以在执行时指定旧版本。 +升级操作不会删除旧的版本,仍然可以在执行时指定旧版本使用。 ## 选项 ### --all (boolean, 默认 false) -升级所有已安装的组件,若未指定任何组件,则必须指定该选项为 `true`。 +若未指定任何组件,则必须指定该选项。 ### --force (boolean, 默认 false) -若指定的组件版本已经安装,则不进行升级操作,指定该参数可忽略已安装版本强制升级。 +若指定的组件版本已经安装,则默认跳过升级操作,指定该参数可强制升级已安装版本。 ### --nightly (boolean, 默认 false) -将指定组件升级到 nightly:等价于 `tiup update :nightly`。 +将指定组件升级到 nightly 版本:等价于 `tiup update :nightly`。 ### --self (boolean,默认 false) diff --git a/tiup/tiup-component-cluster-check.md b/tiup/tiup-component-cluster-check.md index c2ca67ed3c11..8cff47ce3296 100644 --- a/tiup/tiup-component-cluster-check.md +++ b/tiup/tiup-component-cluster-check.md @@ -23,7 +23,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-check/'] ### 系统时间 -检查部署机系统时间是否同步:将部署机系统时间与中控机对比,偏差超出某一阈值后报错。 +检查部署器系统时间是否同步:将部署机系统时间与中控机对比,偏差超出某一阈值(500ms)后报错。 ### 时间同步服务 @@ -86,7 +86,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-check/'] ### CPU 核心数 -检查部署机 CPU 信息:建议生产级群 CPU 逻辑核心数 >= 16 +检查部署机 CPU 信息:建议生产集群 CPU 逻辑核心数 >= 16 > **注意:** > diff --git a/tiup/tiup-component-cluster-clean.md b/tiup/tiup-component-cluster-clean.md index 3355d1068da7..61d693b9d527 100644 --- a/tiup/tiup-component-cluster-clean.md +++ b/tiup/tiup-component-cluster-clean.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-clean/'] ## 介绍 -在测试环境中,有时候需要将集群重置回刚部署的状态,即删除所有数据,命令 `tiup cluster clean` 可以很方便的做到这一点:它会停止集群,然后删除集群上的数据,重启集群之后,就能得到一个全新的集群了。 +在测试环境中,有时候需要将集群重置回刚部署的状态,即删除所有数据,命令 `tiup cluster clean` 可以很方便的做到这一点:它会停止集群,然后删除集群上的数据,额外重启集群之后,就能得到一个全新的集群了。 > **注意:** > diff --git a/tiup/tiup-component-cluster-deploy.md b/tiup/tiup-component-cluster-deploy.md index 8bdb83944f4b..921777f0e059 100644 --- a/tiup/tiup-component-cluster-deploy.md +++ b/tiup/tiup-component-cluster-deploy.md @@ -33,7 +33,7 @@ tiup cluster deploy [flags] ### --ignore-config-check(boolean,默认 false) -在二进制文件部署之后,会对 TiDB,TiKV 和 PD 组件执行配置检查,检查方式为 ` --config-check `,其中 `` 为部署的二进制文件的路径,`` 为根据用户配置生成的配置文件。 +在组件二进制文件部署之后,会对 TiDB,TiKV 和 PD 组件执行配置检查,检查方式为 ` --config-check `,其中 `` 为部署的二进制文件的路径,`` 为根据用户配置生成的配置文件。 如果想要跳过该项检查,可以使用该选项。 diff --git a/tiup/tiup-component-cluster-destroy.md b/tiup/tiup-component-cluster-destroy.md index 2d79755de6b7..fb1616078dcd 100644 --- a/tiup/tiup-component-cluster-destroy.md +++ b/tiup/tiup-component-cluster-destroy.md @@ -10,7 +10,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-destroy/'] 当业务下线之后,如果想将集群占有的机器释放出来让给其他业务使用,需要清理掉集群上的数据以及部署的二进制文件。`tiup cluster destroy` 命令会执行以下操作销毁集群: - 停止集群 -- 对于每个服务,删除其数据目录,日志目录,部署目录 +- 对于每个服务,删除其日志目录,部署目录,数据目录 - 如果各个服务的数据目录/部署目录的父目录是由 tiup-cluster 创建的,也一并删除 ## 语法 @@ -19,7 +19,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-destroy/'] tiup cluster destroy [flags] ``` -`` 为要销毁的集群。 +`` 为要销毁的集群名字。 ## 选项 diff --git a/tiup/tiup-component-cluster-disable.md b/tiup/tiup-component-cluster-disable.md index 2c4527024789..75a16a1a5a95 100644 --- a/tiup/tiup-component-cluster-disable.md +++ b/tiup/tiup-component-cluster-disable.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-disable/'] ## 介绍 -命令 `tiup cluster disable` 由于关闭集群服务在机器重启后的自启动,该命令会到指定的节点上去执行 `systemctl disable ` 来关闭服务的自启。 +命令 `tiup cluster disable` 用于关闭集群服务所在机器重启之后的自启动,该命令会到指定的节点上去执行 `systemctl disable ` 来关闭服务的自启动。 ## 语法 diff --git a/tiup/tiup-component-cluster-display.md b/tiup/tiup-component-cluster-display.md index c1a774beffbe..d50c54bd5c8c 100644 --- a/tiup/tiup-component-cluster-display.md +++ b/tiup/tiup-component-cluster-display.md @@ -15,7 +15,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-display/'] tiup cluster display [flags] ``` -`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 +`` 为要操作的集群名字,如果忘记集群名字可通过[集群列表](/tiup/tiup-component-cluster-list.md)查看。 ## 选项 diff --git a/tiup/tiup-component-cluster-edit-config.md b/tiup/tiup-component-cluster-edit-config.md index b7156cfb3e7c..10c5e13994a6 100644 --- a/tiup/tiup-component-cluster-edit-config.md +++ b/tiup/tiup-component-cluster-edit-config.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-edit-config/'] ## 介绍 -在部署集群之后,如果需要再调整集群服务的配置,则可以使用命令 `tiup cluster edit-config`,它会启动一个编辑器允许用户修改指定集群的[拓扑文件](/tiup/tiup-cluster-topology-reference.md)。 +在部署集群之后,如果需要再调整集群服务的配置,则可以使用命令 `tiup cluster edit-config`,它会启动一个编辑器(默认为 $EDITOR 环境变量指定的值,当 EDITOR 环境变量不存在时,使用 vi 打开)允许用户修改指定集群的[拓扑文件](/tiup/tiup-cluster-topology-reference.md)。 > **注意:** > diff --git a/tiup/tiup-component-cluster-enable.md b/tiup/tiup-component-cluster-enable.md index c1ad46a1aae8..b38588cd0c1d 100644 --- a/tiup/tiup-component-cluster-enable.md +++ b/tiup/tiup-component-cluster-enable.md @@ -7,11 +7,11 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-enable/'] ## 介绍 -命令 `tiup cluster enable` 由于设置集群服务在机器重启后的自启动,该命令会到指定的节点上去执行 `systemctl enable ` 来开启服务的自启。 +命令 `tiup cluster enable` 用于设置集群服务在机器重启后的自启动,该命令会到指定的节点上去执行 `systemctl enable ` 来开启服务的自启。 > **注意:** > -> 集群全部关机重启时,服务启动的顺序由节点的操作系统启动顺序决定,重启顺序不正确时,在某些情况下,重启后的集群仍然不能提供服务(比如先启动了 TiKV 但未启动 PD,systemd 重启 TiKV 多次仍未找到 PD 则会放弃)。 +> 集群全部关机重启时,服务启动的顺序由节点的操作系统启动顺序决定。重启顺序不正确时,在某些情况下,重启后的集群仍然不能提供服务(比如先启动了 TiKV 但未启动 PD,systemd 重启 TiKV 多次仍未找到 PD 则会放弃)。 ## 语法 diff --git a/tiup/tiup-component-cluster-help.md b/tiup/tiup-component-cluster-help.md index 35243eb8072e..3fe436753785 100644 --- a/tiup/tiup-component-cluster-help.md +++ b/tiup/tiup-component-cluster-help.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-help/'] ## 介绍 -tiup-cluster 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得,基本上,`tiup cluster help ` 等价于 `tiup cluster --help`。 +tiup-cluster 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得。基本上,`tiup cluster help ` 等价于 `tiup cluster --help`。 ## 语法 diff --git a/tiup/tiup-component-cluster-import.md b/tiup/tiup-component-cluster-import.md index 448cd948567f..319566e40267 100644 --- a/tiup/tiup-component-cluster-import.md +++ b/tiup/tiup-component-cluster-import.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-import/'] ## 介绍 -在 TiDB 4.0 以前的版本,集群基本是通过 TiDB Ansible 部署的,TiUP Cluster 提供了 `import` 命令用于让这些集群过渡到 TiUP Cluster 组件接管。 +在 TiDB 4.0 以前的版本,集群基本是通过 TiDB Ansible 部署的,TiUP Cluster 提供了 `import` 命令用于让这些集群过渡到 tiup-cluster 组件接管。 > **注意:** > @@ -39,7 +39,7 @@ tiup cluster import [flags] ### --inventory string(string,默认 "inventory.ini") -指定 ansible inventory 文件的名字。 +指定 Ansible inventory 文件的名字。 ### --no-backup(boolean,默认 false) @@ -55,4 +55,4 @@ tiup cluster import [flags] ## 输出 -import 过程的 debug 信息。 \ No newline at end of file +import 过程的日志信息。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-patch.md b/tiup/tiup-component-cluster-patch.md index 548b19cafcac..d0dd7cbd57e9 100644 --- a/tiup/tiup-component-cluster-patch.md +++ b/tiup/tiup-component-cluster-patch.md @@ -10,10 +10,10 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-patch/'] 在集群运行过程中,如果需要动态替换某个服务的二进制文件(即替换过程中保持集群可用),那么可以使用 `tiup cluster patch` 命令,它会完成以下几件事情: - 将用于替换的二进制包上传到目标机器 -- 如果目标服务是 TiKV, TiFlash 活着 Binlog 之类的存储服务,则先通过 API 下线节点 +- 如果目标服务是 TiKV, TiFlash 或者 Binlog 之类的存储服务,则先通过 API 下线节点 - 停止目标服务 - 解压二进制包,替换服务 -- 重启目标服务 +- 启动目标服务 ## 语法 diff --git a/tiup/tiup-component-cluster-reload.md b/tiup/tiup-component-cluster-reload.md index 26321bbd3606..edfc535b2aff 100644 --- a/tiup/tiup-component-cluster-reload.md +++ b/tiup/tiup-component-cluster-reload.md @@ -33,7 +33,7 @@ tiup cluster reload [flags] ### --ignore-config-check(boolean,默认 false) -在二进制文件部署之后,会对 TiDB,TiKV 和 PD 组件执行配置检查,检查方式为 ` --config-check `,其中 `` 为部署的二进制文件的路径,`` 为根据用户配置生成的配置文件。 +在组件二进制文件部署之后,会对 TiDB,TiKV 和 PD 组件执行配置检查,检查方式为 ` --config-check `,其中 `` 为部署的二进制文件的路径,`` 为根据用户配置生成的配置文件。 如果想要跳过该项检查,可以使用该选项。 diff --git a/tiup/tiup-component-cluster-rename.md b/tiup/tiup-component-cluster-rename.md index f00ed1746535..16bef8d19b41 100644 --- a/tiup/tiup-component-cluster-rename.md +++ b/tiup/tiup-component-cluster-rename.md @@ -11,7 +11,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-rename/'] > **注意:** > -> 如果配置了 grafana_servers 的 dashboard_dir 字段,在执行 tiup cluster rename 命令进行集群重命名后,需要完成以下操作: +> 如果配置了 grafana_servers 的 dashboard_dir 字段,在执行 tiup cluster rename 命令进行集群重命名后,需要额外做以下操作: > > 1. 对于本地的 dashboards 目录中的 `*.json` 文件,将 datasource 字段的值更新为新的集群名(这是因为 datasource 是以集群名命名的) > 2. 执行 tiup cluster reload -R grafana 命令 diff --git a/tiup/tiup-component-cluster-restart.md b/tiup/tiup-component-cluster-restart.md index a52355ffed6b..f02af4445733 100644 --- a/tiup/tiup-component-cluster-restart.md +++ b/tiup/tiup-component-cluster-restart.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-restart/'] ## 介绍 -命令 `tiup cluster restart` 用于重启指定集群的所有服务或部分服务。 +命令 `tiup cluster restart` 用于重启指定集群的所有或部分服务。 > **注意:** > @@ -19,7 +19,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-restart/'] tiup cluster restart [flags] ``` -`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 +`` 为要操作的集群名字,如果忘记集群名字可通过[集群列表](/tiup/tiup-component-cluster-list.md)查看。 ## 选项 diff --git a/tiup/tiup-component-cluster-scale-in.md b/tiup/tiup-component-cluster-scale-in.md index 263d9c10f8c7..b670e2f6e18c 100644 --- a/tiup/tiup-component-cluster-scale-in.md +++ b/tiup/tiup-component-cluster-scale-in.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-scale-in/'] ## 介绍 -`tiup cluster scale-in` 命令用于集群缩容,缩容即下线服务,最终会将指定的节点从集群中移除,并删除遗留的相关数据文件。 +`tiup cluster scale-in` 命令用于集群缩容,缩容即下线服务,最终会将指定的节点从集群中移除,并删除遗留的相关文件。 由于 TiKV,TiFlash 和 TiDB Binlog 组件的下线是异步的(需要先通过 API 执行移除操作)并且下线过程耗时较长(需要持续观察节点是否已经下线成功),所以对 TiKV,TiFlash 和 TiDB Binlog 组件做了特殊处理: @@ -28,7 +28,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-scale-in/'] tiup cluster scale-in [flags] ``` -`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 +`` 为要操作的集群名字,如果忘记集群名字可通过[集群列表](/tiup/tiup-component-cluster-list.md)查看。 ## 选项 diff --git a/tiup/tiup-component-cluster-scale-out.md b/tiup/tiup-component-cluster-scale-out.md index e8d39b229b56..84f67218ba95 100644 --- a/tiup/tiup-component-cluster-scale-out.md +++ b/tiup/tiup-component-cluster-scale-out.md @@ -15,7 +15,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-scale-out/'] tiup cluster scale-out [flags] ``` -- `` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md) +- `` 为要操作的集群名字,如果忘记集群名字可通过[集群列表](/tiup/tiup-component-cluster-list.md)查看 - `` 为事先编写好的扩容[拓扑文件](/tiup/tiup-cluster-topology-reference.md),该文件应当仅包含扩容部分的拓扑 ## 选项 diff --git a/tiup/tiup-component-cluster-start.md b/tiup/tiup-component-cluster-start.md index 8494e3146f99..e26203bccf45 100644 --- a/tiup/tiup-component-cluster-start.md +++ b/tiup/tiup-component-cluster-start.md @@ -15,7 +15,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-start/'] tiup cluster start [flags] ``` -`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 +`` 为要操作的集群名字,如果忘记集群名字可通过[集群列表](/tiup/tiup-component-cluster-list.md)查看。 ## 选项 diff --git a/tiup/tiup-component-cluster-stop.md b/tiup/tiup-component-cluster-stop.md index e7b7d05cc10c..2f5cb4fe4262 100644 --- a/tiup/tiup-component-cluster-stop.md +++ b/tiup/tiup-component-cluster-stop.md @@ -19,7 +19,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-stop/'] tiup cluster stop [flags] ``` -`` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 +`` 为要操作的集群名字,如果忘记集群名字可通过[集群列表](/tiup/tiup-component-cluster-list.md)查看。 ## 选项 @@ -45,4 +45,4 @@ tiup cluster stop [flags] ## 输出 -停服务的日志。 \ No newline at end of file +停止服务的日志。 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-upgrade.md b/tiup/tiup-component-cluster-upgrade.md index bfc9ac3fbcdf..50ac5f1c9bff 100644 --- a/tiup/tiup-component-cluster-upgrade.md +++ b/tiup/tiup-component-cluster-upgrade.md @@ -15,7 +15,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-upgrade/'] tiup cluster upgrade [flags] ``` -- `` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-cluster-list.md)。 +- `` 为要操作的集群名字,如果忘记集群名字可通过[集群列表](/tiup/tiup-component-cluster-list.md)查看。 - `` 为要升级到的目标版本,目前仅允许升级到比当前集群更高的版本,不允许升级到比当前集群更低的版本,即不允许降级。同时也不允许升级成 nightly 版本 ## 选项 diff --git a/tiup/tiup-component-cluster.md b/tiup/tiup-component-cluster.md index 2a069678e431..1b1578dece5c 100644 --- a/tiup/tiup-component-cluster.md +++ b/tiup/tiup-component-cluster.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster/'] ## 介绍 -TiUP Cluster 是 TiUP 提供的使用 Golang 编写的集群管理组件,通过 TiUP cluster 组件就可以进行日常的运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 TiDB 集群;管理 TiDB 集群参数。 +TiUP Cluster 是 TiUP 提供的使用 Golang 编写的集群管理组件,通过 TiUP cluster 组件就可以进行日常的运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 TiDB 集群、管理 TiDB 集群参数。 ## 语法 @@ -21,7 +21,7 @@ tiup cluster [command] [flags] ### --ssh (string,默认 builtin) -通过哪种 ssh 客户端到远端(部署 TiDB 服务的机器)执行命令,支持以下几个值: +指定 SSH 客户端连接远端(部署 TiDB 服务的机器)执行命令,支持以下几个值: - builtin:使用 tiup-cluster 内置的 easyssh 客户端 - system:使用当前操作系统默认的 ssh 客户端 diff --git a/tiup/tiup-component-dm-destroy.md b/tiup/tiup-component-dm-destroy.md index b2fafb2cbec0..dd19efaaeafa 100644 --- a/tiup/tiup-component-dm-destroy.md +++ b/tiup/tiup-component-dm-destroy.md @@ -10,7 +10,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-dm-destroy/'] 当业务下线之后,如果想将集群占有的机器释放出来让给其他业务使用,需要清理掉集群上的数据以及部署的二进制文件。`tiup dm destroy` 命令会执行以下操作销毁集群: - 停止集群 -- 对于每个服务,删除其数据目录,日志目录,部署目录 +- 对于每个服务,删除其日志目录,部署目录,数据目录 - 如果各个服务的数据目录/部署目录的父目录是由 tiup-dm 创建的,也一并删除 ## 语法 @@ -19,7 +19,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-dm-destroy/'] tiup dm destroy [flags] ``` -`` 为要销毁的集群。 +`` 为要销毁的集群名字。 ## 选项 diff --git a/tiup/tiup-component-dm-edit-config.md b/tiup/tiup-component-dm-edit-config.md index 7e828a178a60..c203d92a8234 100644 --- a/tiup/tiup-component-dm-edit-config.md +++ b/tiup/tiup-component-dm-edit-config.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-dm-edit-config/'] ## 介绍 -在部署集群之后,如果需要再调整集群服务的配置,则可以使用命令 `tiup dm edit-config`,它会启动一个编辑器允许用户修改指定集群的[拓扑文件](/tiup/tiup-dm-topology-reference.md)。 +在部署集群之后,如果需要再调整集群服务的配置,则可以使用命令 `tiup dm edit-config`,它会启动一个编辑器(默认为 $EDITOR 环境变量指定的值,当 EDITOR 环境变量不存在时,使用 vi 打开)允许用户修改指定集群的[拓扑文件](/tiup/tiup-dm-topology-reference.md)。 > **注意:** > diff --git a/tiup/tiup-component-dm-help.md b/tiup/tiup-component-dm-help.md index 94f74ce59359..8c74165c170f 100644 --- a/tiup/tiup-component-dm-help.md +++ b/tiup/tiup-component-dm-help.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-dm-help/'] ## 介绍 -tiup-dm 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得,基本上,`tiup dm help ` 等价于 `tiup dm --help`。 +tiup-dm 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得。基本上,`tiup dm help ` 等价于 `tiup dm --help`。 ## 语法 diff --git a/tiup/tiup-component-dm-import.md b/tiup/tiup-component-dm-import.md index fbd4448802d8..350052c368ad 100644 --- a/tiup/tiup-component-dm-import.md +++ b/tiup/tiup-component-dm-import.md @@ -38,7 +38,7 @@ tiup dm import [flags] ### --inventory string(string,默认 "inventory.ini") -指定 ansible inventory 文件的名字。 +指定 Ansible inventory 文件的名字。 ### --rename(string,默认为空) @@ -50,4 +50,4 @@ tiup dm import [flags] ## 输出 -import 过程的 debug 信息。 \ No newline at end of file +import 过程的日志信息。 \ No newline at end of file diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index 00784223605a..a5cd92194544 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -13,7 +13,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-dm-patch/'] - 通过 API 下线节点 - 停止目标服务 - 解压二进制包,替换服务 -- 重启目标服务 +- 启动目标服务 ## 语法 diff --git a/tiup/tiup-component-dm-prune.md b/tiup/tiup-component-dm-prune.md index d9a8adac1961..3961fdb766ed 100644 --- a/tiup/tiup-component-dm-prune.md +++ b/tiup/tiup-component-dm-prune.md @@ -3,11 +3,11 @@ title: tiup dm prune aliases: ['/docs-cn/dev/tiup/tiup-component-dm-prune/'] --- -# tiup dm list +# tiup dm prune ## 介绍 -在[缩容集群](/tiup/tiup-component-dm-scale-in.md)后,ETCD 中仍然会有少量元信息不会被清理,通常不清理这些信息不会导致问题,如果确实需要清理,可以手动执行 `tiup cluster prune` 命令清理。 +在[缩容集群](/tiup/tiup-component-dm-scale-in.md)后,ETCD 中仍然会有少量元信息不会被清理,通常不会有问题,如果确实需要清理,可以手动执行 `tiup cluster prune` 命令清理。 ## 语法 diff --git a/tiup/tiup-component-dm-reload.md b/tiup/tiup-component-dm-reload.md index 6dd7c33ce4d2..ed5014b5c306 100644 --- a/tiup/tiup-component-dm-reload.md +++ b/tiup/tiup-component-dm-reload.md @@ -3,7 +3,7 @@ title: tiup dm reload aliases: ['/docs-cn/dev/tiup/tiup-component-dm-reload/'] --- -# tiup dm list +# tiup dm reload ## 介绍 diff --git a/tiup/tiup-component-dm-restart.md b/tiup/tiup-component-dm-restart.md index 2e1ba15d6f22..af5db545ff1d 100644 --- a/tiup/tiup-component-dm-restart.md +++ b/tiup/tiup-component-dm-restart.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-dm-restart/'] ## 介绍 -命令 `tiup dm restart` 用于重启指定集群的所有服务或部分服务。 +命令 `tiup dm restart` 用于重启指定集群的所有或部分服务。 > **注意:** > diff --git a/tiup/tiup-component-dm-scale-in.md b/tiup/tiup-component-dm-scale-in.md index 1bc3200dcdb7..53b0c1ceeb15 100644 --- a/tiup/tiup-component-dm-scale-in.md +++ b/tiup/tiup-component-dm-scale-in.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-dm-scale-in/'] ## 介绍 -`tiup dm scale-in` 命令用于集群缩容,缩容即下线服务,最终会将指定的节点从集群中移除,并删除遗留的相关数据文件。 +`tiup dm scale-in` 命令用于集群缩容,缩容即下线服务,最终会将指定的节点从集群中移除,并删除遗留的相关文件。 ## 语法 diff --git a/tiup/tiup-component-dm-stop.md b/tiup/tiup-component-dm-stop.md index 4e9ae9317459..699bb7b8625a 100644 --- a/tiup/tiup-component-dm-stop.md +++ b/tiup/tiup-component-dm-stop.md @@ -45,4 +45,4 @@ tiup dm stop [flags] ## 输出 -停服务的日志。 \ No newline at end of file +停止服务的日志。 \ No newline at end of file diff --git a/tiup/tiup-component-dm.md b/tiup/tiup-component-dm.md index 7800c69043e9..7da01017704f 100644 --- a/tiup/tiup-component-dm.md +++ b/tiup/tiup-component-dm.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster/'] ## 介绍 -类似于 [TiUP Cluster](/tiup/tiup-component-cluster.md) 对 TiDB 集群的管理,TiUP DM 是用于对 DM 集群的日常运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 DM 集群;管理 DM 集群参数。 +类似于 [TiUP Cluster](/tiup/tiup-component-cluster.md) 对 TiDB 集群的管理,TiUP DM 是用于对 DM 集群的日常运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 DM 集群、管理 DM 集群参数。 ## 语法 @@ -21,7 +21,7 @@ tiup dm [command] [flags] ### --ssh (string,默认 builtin) -通过哪种 ssh 客户端到远端(部署 TiDB 服务的机器)执行命令,支持以下几个值: +指定 SSH 客户端连接远端(部署 TiDB 服务的机器)执行命令,支持以下几个值: - builtin:使用 tiup-cluster 内置的 easyssh 客户端 - system:使用当前操作系统默认的 ssh 客户端 diff --git a/tiup/tiup-dm-topology-reference.md b/tiup/tiup-dm-topology-reference.md index b23c3a524f02..76721fda3941 100644 --- a/tiup/tiup-dm-topology-reference.md +++ b/tiup/tiup-dm-topology-reference.md @@ -16,43 +16,43 @@ aliases: ['/docs-cn/dev/tiup/tiup-dm-topology-reference/'] 一个 DM 集群的拓扑文件可能包含以下区块: - [global](/tiup/tiup-dm-topology-reference.md#global):集群全局配置,其中一些是集群的默认值,可以在实例里面单独配置 -- [server_configs](/tiup/tiup-dm-topology-reference.md#server_configs):全局服务配置,针对每种组件配置其默认配置,这个配置可以在每个实例里单独覆盖,该配置用于生成服务的配置文件 +- [server_configs](/tiup/tiup-dm-topology-reference.md#server_configs):组件全局配置,可单独针对每个组件配置,若在实例中存在同名配置项,那么以实例中配置的为准 - [master_servers](/tiup/tiup-dm-topology-reference.md#master_servers):DM master 实例的配置,用来指定 DM 组件的 master 服务部署到哪些机器上 - [worker_servers](/tiup/tiup-dm-topology-reference.md#worker_servers):DM worker 实例的配置,用来指定 DM 组件的 worker 服务部署到哪些机器上 -- [monitoring_servers](/tiup/tiup-cluster-topology-reference.md#monitoring_servers):Prometheus 实例的配置,用来指定 Prometheus 部署在哪台机器上 +- [monitoring_servers](/tiup/tiup-cluster-topology-reference.md#monitoring_servers):用来指定 Prometheus 部署在哪机器上,TiUP 支持部署多台 Prometheus 实例,但真实投入使用的只有第一个 - [grafana_servers](/tiup/tiup-cluster-topology-reference.md#grafana_servers):Grafana 实例的配置,用来指定 Grafana 部署在哪台机器上 - [alertmanager_servers](/tiup/tiup-cluster-topology-reference.md#alertmanager_servers):Alertemanager 实例的配置,用来指定 Alertmanager 部署在哪些机器上 -### global - -global 区块集群的全局配置,包含以下字段: - -- user:以什么用户来启动部署的集群,默认值:"tidb",如果 `` 字段指定的用户在目标机器上不存在,会自动尝试创建 -- group:自动创建用户时指定用户所属的用户组,默认和 `` 字段值相同,若指定的组不存在,则自动创建 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,默认值:22 -- enable_tls:是否对集群启用 tls,启用之后集群之间,客户端与集群之间都必须用生成的 tls 证书链接,启用后无法关闭,默认值:false -- deploy_dir:每个组件的默认部署目录,默认值:"deploy",其应用规则如下: - - 如果 `` 为绝对路径,那么组件会部署到 `/-` 目录 - - 如果 `` 为相对路径,那么组件会部署到 `/home///-` 目录 - - 对于在自己的实例中设置了 `deploy_dir` 字段的组件实例,部署路径由实例中的 `deploy_dir` 决定 -- data_dir:默认数据目录, 默认值 "data",其应用规则如下: - - 如果 `` 为绝对路径,那么组件数据将放到 `/-` - - 如果 `` 为相对路径,那么组件数据将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 - - 对于在自己的实例中设置了 `data_dir` 字段的组件实例,数据路径由实例中的 `data_dir` 决定 -- log_dir:默认数据目录, 默认值 "log",其应用规则如下: - - 如果 `` 为绝对路径,那么组件日志将放到 `/-` - - 如果 `` 为相对路径,那么组件日志将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 - - 对于在自己的实例中设置了 `log_dir` 字段的组件实例,日志路径由实例中的 `log_dir` 决定 -- os:目标机器的操作系统,该字段决定了向目标机器推送适配哪个操作系统的组件,默认值:linux -- arch:目标机器的架构,该字段决定了向目标机器推送哪个平台的二进制包,支持 amd64 和 arm64,默认值 amd64 -- resource_control:运行时资源控制,该字段下所有配置都将写入 systemd 的 service 文件中,默认不限制,支持控制的资源: - - memory_limit: 限制运行时最大内存,例如 "2G" 表示最多使用 2G 内存 - - cpu_quota:限制运行时最大 CPU 占用率,例如 "200%" - - io_read_bandwidth_max:读磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" - - io_write_bandwidth_max:写磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" - - limit_core:控制 core dump 大小 - -global 配置示例: +### `global` + +`global` 区块为集群的全局配置,包含以下字段: + +- `user`:以什么用户来启动部署的集群,默认值:"tidb",如果 `` 字段指定的用户在目标机器上不存在,会自动尝试创建 +- `group`:自动创建用户时指定用户所属的用户组,默认和 `` 字段值相同,若指定的组不存在,则自动创建 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,默认值:22 +- `deploy_dir`:每个组件的部署目录,默认值:"deploy",其应用规则如下: + - 如果在实例级别配置了绝对路径的 `deploy_dir`,那么实际部署目录为该实例设定的 `deploy_dir` + - 对于每个实例,如果用户未配置 `deploy_dir`,其默认值为相对路径 `-` + - 如果 `global.deploy_dir` 为绝对路径,那么组件会部署到 `/` 目录 + - 如果 `global.deploy_dir` 为相对路径,那么组件会部署到 `/home///` 目录 +- `data_dir`:数据目录, 默认值:"data",其应用规则如下: + - 如果在实例级别配置了绝对路径的 `data_dir`,那么实际数据目录为该实例设定的 `data_dir` + - 对于每个实例,如果用户未配置 `data_dir`,其默认值为 `` + - 如果 `data_dir` 为相对路径,那么组件数据将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 +- `log_dir`:数据目录, 默认值:"log",其应用规则如下: + - 如果在实例级别配置了绝对路径的 `log_dir`,那么实际日志目录为该实例设定的 `log_dir` + - 对于每个实例,如果用户未配置 `log_dir`,其默认值为 `` + - 如果 `log_dir` 为相对路径,那么组件日志将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 +- `os`:目标机器的操作系统,该字段决定了向目标机器推送适配哪个操作系统的组件,默认值:linux +- `arch`:目标机器的 CPU 架构,该字段决定了向目标机器推送哪个平台的二进制包,支持 amd64 和 arm64,默认值:amd64 +- `resource_control`:运行时资源控制,该字段下所有配置都将写入 systemd 的 service 文件中,默认不限制,支持控制的资源: + - `memory_limit`: 限制运行时最大内存,例如 "2G" 表示最多使用 2GB 内存 + - `cpu_quota`:限制运行时最大 CPU 占用率,例如 "200%" + - `io_read_bandwidth_max`:读磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" + - `io_write_bandwidth_max`:写磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" + - `limit_core`:控制 core dump 大小 + +`global` 配置示例: ```yaml global: @@ -61,14 +61,16 @@ global: memory_limit: "2G" ``` -### server_configs +上述配置指定使用 tidb 用户启动集群,同时限制每个组件运行时最多只能使用 2GB 内存。 -server_configs 用于配置服务,生成各组件的配置文件,类似 global 区块,该区块内的配置可以在具体的实例中被覆盖。主要包含以下字段: +### `server_configs` -- master:DM master 服务的相关配置,支持的所有配置请参考[DM-master 配置文件介绍](https://docs.pingcap.com/zh/tidb-data-migration/stable/dm-master-configuration-file) -- worker:DM worker 服务的相关配置,支持的所有配置请参考[DM-worker 配置文件介绍](https://docs.pingcap.com/zh/tidb-data-migration/stable/dm-worker-configuration-file) +`server_configs` 用于配置服务,生成各组件的配置文件,类似 `global` 区块,该区块内的配置可以在具体的实例中被覆盖。主要包含以下字段: -server_configs 配置示例: +- `master`:DM master 服务的相关配置,支持的完整配置请参考[DM-master 配置文件介绍](https://docs.pingcap.com/zh/tidb-data-migration/stable/dm-master-configuration-file) +- `worker`:DM worker 服务的相关配置,支持的完整配置请参考[DM-worker 配置文件介绍](https://docs.pingcap.com/zh/tidb-data-migration/stable/dm-worker-configuration-file) + +`server_configs` 配置示例: ```yaml server_configs: @@ -81,39 +83,39 @@ server_configs: log-level: info ``` -## master_servers - -master_servers 约定了将 DM 组件的 master 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: - -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- name:指定该 DM master 实例的名字,不同实例的名字不能相同 -- port:指定 DM master 提供给服务的端口,默认 8261 -- peer_port:指定 DM master 之间互相通信的端口,默认是 8291 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config:该字段配置规则和 server_configs 里的 master 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 master 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +## `master_servers` + +`master_servers` 约定了将 DM 组件的 master 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: + +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `name`:指定该 DM master 实例的名字,不同实例的名字必须唯一,否则无法部署 +- `port`:指定 DM master 提供给服务的端口,默认 8261 +- `peer_port`:指定 DM master 之间互相通信的端口,默认是 8291 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 master 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 master 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` - v1_source_path:从 v1.0.x 升级时,可指定该目录,该目录中应当存放有 V1 的源的配置文件 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- name -- port -- peer_port -- deploy_dir -- data_dir -- log_dir -- arch -- os -- v1_source_path +- `host` +- `name` +- `port` +- `peer_port` +- `deploy_dir` +- `data_dir` +- `log_dir` +- `arch` +- `os` +- `v1_source_path` -master_servers 配置示例: +`master_servers` 配置示例: ```yaml master_servers: @@ -138,35 +140,35 @@ master_servers: name: master3 ``` -## worker_servers +## `worker_servers` -worker_servers 约定了将 DM 组件的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: +`worker_servers` 约定了将 DM 组件的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- name:指定该 DM worker 实例的名字,不同实例的名字不能相同 -- port:指定 DM master 提供给服务的端口,默认 8262 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config:该字段配置规则和 server_configs 里的 worker 配置规则相同,若配置了该字段,会将该字段内容和 server_configs 里的 worker 内容合并(若字段冲突,以该字段为准),然后生成配置文件下发到 host 指定的机器 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `name`:指定该 DM worker 实例的名字,不同实例的名字必须唯一,否则无法部署 +- `port`:指定 DM master 提供给服务的端口,默认 8262 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 worker 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 worker 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- name -- port -- deploy_dir -- data_dir -- log_dir -- arch -- os +- `host` +- `name` +- `port` +- `deploy_dir` +- `data_dir` +- `log_dir` +- `arch` +- `os` -worker_servers 配置示例: +`worker_servers` 配置示例: ```yaml worker_servers: @@ -182,34 +184,34 @@ worker_servers: - host: 10.0.1.19 ``` -### monitoring_servers +### `monitoring_servers` -monitoring_servers 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`monitoring_servers` 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:指定 Prometheus 提供服务的端口,默认是 9090 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- storage_retention:Prometheus 监控数据保留时间,默认 "15d" -- rule_dir:该字段指定一个本地目录,该目录中应当含有完整的 *.rules.yml 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `port`:指定 Prometheus 提供服务的端口,默认是 9090 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `storage_retention`:Prometheus 监控数据保留时间,默认 "15d" +- `rule_dir`:该字段指定一个本地目录,该目录中应当含有完整的 *.rules.yml 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- port -- deploy_dir -- data_dir -- log_dir -- arch -- os +- `host` +- `port` +- `deploy_dir` +- `data_dir` +- `log_dir` +- `arch` +- `os` -monitoring_servers 配置示例: +`monitoring_servers` 配置示例: ```yaml monitoring_servers: @@ -217,37 +219,37 @@ monitoring_servers: rule_dir: /local/rule/dir ``` -### grafana_servers +### `grafana_servers` -grafana_servers 约定了将 Grafana 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`grafana_servers` 约定了将 Grafana 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- port:指定 Grafana 提供服务的端口,默认是 3000 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- username:Grafana 登陆界面的用户名 -- password:Grafana 对应的密码 -- dashboard_dir:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `port`:指定 Grafana 提供服务的端口,默认是 3000 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `username`:Grafana 登陆界面的用户名 +- `password`:Grafana 对应的密码 +- `dashboard_dir`:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global `中的 `resource_control` > **注意:** > -> 如果配置了 grafana_servers 的 dashboard_dir 字段,在执行 tiup cluster rename 命令进行集群重命名后,需要完成以下操作: +> 如果配置了 `grafana_servers` 的 `dashboard_dir` 字段,在执行 `tiup cluster rename` 命令进行集群重命名后,需要完成以下操作: > > 1. 在本地的 dashboards 目录中,将 datasource 字段的值更新为新的集群名(datasource 是以集群名命名的) -> 2. 执行 tiup cluster reload -R grafana 命令 +> 2. 执行 `tiup cluster reload -R grafana` 命令 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- port -- deploy_dir -- arch -- os +- `host` +- `port` +- `deploy_dir` +- `arch` +- `os` -grafana_servers 配置示例: +`grafana_servers` 配置示例: ```yaml grafana_servers: @@ -255,35 +257,35 @@ grafana_servers: dashboard_dir: /local/dashboard/dir ``` -### alertmanager_servers +### `alertmanager_servers` -alertmanager_servers 约定了将 Alertmanager 服务部署到哪些机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`alertmanager_servers` 约定了将 Alertmanager 服务部署到哪些机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: -- host:部署到哪台机器,填 IP 地址,不可省略 -- ssh_port:指定连目标机器进行操作的时候默认连哪个 ssh 端口,若不指定,则使用 global 区块中的 ssh_port -- web_port:指定 Alertmanager 提供网页服务的端口,默认是 9093 -- cluster_port:指定 Alertmanger 和 其他 Alertmanager 通讯的端口,默认是 9094 -- deploy_dir:指定部署目录,若不指定,则按照 global 中配置的 deploy_dir 生成 -- data_dir:指定数据目录,若不指定,则按照 global 中配置的 data_dir 生成 -- log_dir:指定日志目录,若不指定,则按照 global 中配置的 log_dir 生成 -- numa_node:给改实例分配 numa 节点,如果指定了该参数,需要确保目标机装了numactl,在指定该参数的情况下会通过 numactl 分配 cpubind 和 membind。这个参数类型是一个 string,里面填 numa 节点 id,比如 "0,1" -- config_file:该字段指定一个本地文件,该文件会在集群配置初始化阶段被传输到目标机器上,作为 Alertmanager 的配置 -- os:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- arch:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch -- resource_control:针对该服务的资源控制,所配置了该字段,会将该字段和 global 中的 resource_control 内容合并(若字段冲突,以该字段为准),然后生成 systemd 配置文件下发到 host 指定机器。resource_control 的配置规则同 global 中的 resource_control +- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` +- `web_port`:指定 Alertmanager 提供网页服务的端口,默认是 9093 +- `cluster_port`:指定 Alertmanger 和 其他 Alertmanager 通讯的端口,默认是 9094 +- `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 +- `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 +- `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `config_file`:该字段指定一个本地文件,该文件会在集群配置初始化阶段被传输到目标机器上,作为 Alertmanager 的配置 +- `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,这些字段在部署完成之后就不能再修改: -- host -- web_port -- cluster_port -- deploy_dir -- data_dir -- log_dir -- arch -- os +- `host` +- `web_port` +- `cluster_port` +- `deploy_dir` +- `data_dir` +- `log_dir` +- `arch` +- `os` -alertmanager_servers 配置示例: +`alertmanager_servers` 配置示例: ```yaml alertmanager_servers: diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index 25a8b743c23e..ddd004aa3cb5 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-mirror-reference/'] ## 介绍 -TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件的元信息。镜像可以以以下两种形式存在: +TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件的元信息。镜像有两种存在形式: - 本地磁盘上的目录:用于服务本地的 TiUP 客户端,文档中将称之为本地镜像 - 基于远程的磁盘目录启动的 HTTP 镜像:服务远程的 TiUP 客户端,文档中将称之为远程镜像 diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index cee6cc6acbd7..3caff4ec6687 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -31,7 +31,7 @@ TiUP 集成了一系列的子命令用于组件管理和镜像管理。 区别于命令,组件具有以下特点: - 动态从镜像中取得 -- 本身是一个二进制程序 +- 本身是一个或一组二进制程序 - 有自己的命令及子命令 ### 镜像 From f508d7bc9810438f9c83d01bf4cff4c8a4e654aa Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 11 Jan 2021 19:54:54 +0800 Subject: [PATCH 18/56] Fix lint --- tiup/tiup-cluster-topology-reference.md | 2 +- tiup/tiup-command-list.md | 8 ++++---- tiup/tiup-command-mirror-genkey.md | 8 ++++---- tiup/tiup-command-mirror-modify.md | 4 ++-- tiup/tiup-command-mirror-publish.md | 4 ++-- tiup/tiup-command-mirror-rotate.md | 8 ++++---- tiup/tiup-command-mirror-set.md | 2 +- tiup/tiup-command-mirror-sign.md | 3 +-- tiup/tiup-command-status.md | 1 + tiup/tiup-component-cluster-audit.md | 6 +++--- tiup/tiup-component-cluster-check.md | 3 ++- tiup/tiup-component-cluster-display.md | 16 ++++++++-------- tiup/tiup-component-cluster-list.md | 1 + tiup/tiup-component-cluster-patch.md | 16 ++++++++-------- tiup/tiup-component-cluster-scale-in.md | 16 ++++++++-------- tiup/tiup-component-dm-audit.md | 6 +++--- tiup/tiup-component-dm-display.md | 16 ++++++++-------- tiup/tiup-component-dm-list.md | 1 + tiup/tiup-component-dm-patch.md | 16 ++++++++-------- tiup/tiup-dm-topology-reference.md | 2 +- tiup/tiup-mirror-reference.md | 8 +++++--- tiup/tiup-reference.md | 1 - 22 files changed, 76 insertions(+), 72 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index 8c34a20effa7..dbf09ee1b29d 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -461,7 +461,7 @@ tispark_masters: ### `tispark_workers` -`tispark_workers `约定了将 TiSpark 的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`tispark_workers`约定了将 TiSpark 的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: - `host`:部署到哪台机器,填 IP 地址,不可省略 - `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` diff --git a/tiup/tiup-command-list.md b/tiup/tiup-command-list.md index efd5b38ee7e2..c77ea8bee477 100644 --- a/tiup/tiup-command-list.md +++ b/tiup/tiup-command-list.md @@ -34,8 +34,8 @@ tiup list [component] [flags] ## 输出 - 若未指定 `[component]` - - 若指定 --verbose:输出 `组件名(Name)`,`已安装版本(Installed)`, `组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 - - 若不指定 --verbose:输出 `组件名(Name)`,`组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 + - 若指定 --verbose:输出 `组件名(Name)`,`已安装版本(Installed)`, `组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 + - 若不指定 --verbose:输出 `组件名(Name)`,`组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 - 若指定 `[component]` - - 若 `[component]` 存在:输出 `版本(Version)`,`是否已安装(Installed)`,`发布时间(Release)`,`支持的平台(Platforms)` 构成的版本信息列表 - - 若 `[component]` 不存在:报错 `failed to fetch component: unknown component` \ No newline at end of file + - 若 `[component]` 存在:输出 `版本(Version)`,`是否已安装(Installed)`,`发布时间(Release)`,`支持的平台(Platforms)` 构成的版本信息列表 + - 若 `[component]` 不存在:报错 `failed to fetch component: unknown component` \ No newline at end of file diff --git a/tiup/tiup-command-mirror-genkey.md b/tiup/tiup-command-mirror-genkey.md index 9f39f8c4d2d6..0a7cea982b3a 100644 --- a/tiup/tiup-command-mirror-genkey.md +++ b/tiup/tiup-command-mirror-genkey.md @@ -44,8 +44,8 @@ tiup mirror genkey [flags] ## 输出 - 若未指定 `-p/--public`: - - 若指定的密钥已存在:`Key already exists, skipped` - - 若指定的密钥不存在:`private key have been write to `${TIUP_HOME}/keys/{name}.json`` + - 若指定的密钥已存在:`Key already exists, skipped` + - 若指定的密钥不存在:`private key have been write to ${TIUP_HOME}/keys/{name}.json` - 若指定 `-p/--public`: - - 若指定的密钥不存在:`Error: open `${TIUP_HOME}/keys/{name}.json`: no such file or directory` - - 若指定的密钥存在:输出该密钥对应的公钥内容 + - 若指定的密钥不存在:`Error: open ${TIUP_HOME}/keys/{name}.json: no such file or directory` + - 若指定的密钥存在:输出该密钥对应的公钥内容 diff --git a/tiup/tiup-command-mirror-modify.md b/tiup/tiup-command-mirror-modify.md index 7abc3233d9d8..97f401e1bb4a 100644 --- a/tiup/tiup-command-mirror-modify.md +++ b/tiup/tiup-command-mirror-modify.md @@ -53,5 +53,5 @@ tiup mirror modify [:version] [flags] - 若成功:无输出 - 若该组件管理员无权修改目标组件: - - 若使用远程镜像:`Error: The server refused, make sure you have access to this component` - - 若使用本地镜像:`Error: the signature is not correct` \ No newline at end of file + - 若使用远程镜像:`Error: The server refused, make sure you have access to this component` + - 若使用本地镜像:`Error: the signature is not correct` \ No newline at end of file diff --git a/tiup/tiup-command-mirror-publish.md b/tiup/tiup-command-mirror-publish.md index 71f08b23cc1c..f9aeec14aa31 100644 --- a/tiup/tiup-command-mirror-publish.md +++ b/tiup/tiup-command-mirror-publish.md @@ -68,5 +68,5 @@ tiup mirror publish [flags] - 若成功:无输出 - 若该组件管理员无权修改目标组件: - - 若使用远程镜像:`Error: The server refused, make sure you have access to this component` - - 若使用本地镜像:`Error: the signature is not correct` \ No newline at end of file + - 若使用远程镜像:`Error: The server refused, make sure you have access to this component` + - 若使用本地镜像:`Error: the signature is not correct` \ No newline at end of file diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md index 8fb58885ed5e..306dad35ae62 100644 --- a/tiup/tiup-command-mirror-rotate.md +++ b/tiup/tiup-command-mirror-rotate.md @@ -11,10 +11,10 @@ TiUP 的镜像中有一个非常重要的文件:root.json,里面记录了整 - N 个管理员的签名,对于官方镜像, N 为 5,默认初始化的镜像 N 为 3 - 用于验证以下文件的公钥: - - root.json - - index.json - - snapshot.json - - timestamp.json + - root.json + - index.json + - snapshot.json + - timestamp.json - 过期时间,对于官方镜像,为 root.json 创建时间后延一年 关于镜像的详细介绍可以参考[镜像说明](/tiup/tiup-mirror-reference.md)。 diff --git a/tiup/tiup-command-mirror-set.md b/tiup/tiup-command-mirror-set.md index a04173129661..5089e8719319 100644 --- a/tiup/tiup-command-mirror-set.md +++ b/tiup/tiup-command-mirror-set.md @@ -19,7 +19,7 @@ tiup mirror set [flags] `` 为镜像地址,可以有两种形式: -- 网络地址:http 或者 https 开头,如 http://172.16.5.5:8080,https://tiup-mirrors.pingcap.com 等 +- 网络地址:http 或者 https 开头,如 `http://172.16.5.5:8080`,`https://tiup-mirrors.pingcap.com` 等 - 本地文件路径:镜像目录的绝对路径,比如 /path/to/local-tiup-mirror ## 选项 diff --git a/tiup/tiup-command-mirror-sign.md b/tiup/tiup-command-mirror-sign.md index 46cde1f6011a..e308e405f8d0 100644 --- a/tiup/tiup-command-mirror-sign.md +++ b/tiup/tiup-command-mirror-sign.md @@ -9,7 +9,6 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-sign/'] 命令 `tiup mirror sign` 用于对[镜像](/tiup/tiup-mirror-reference.md)中定义的元信息文件(*.json)进行签名,这些文件可能储存在本地文件系统,也可以放在远端使用 http 协议提供签名入口。 - ## 语法 ```sh @@ -18,7 +17,7 @@ tiup mirror sign [flags] `` 为被签名的文件地址,可以有两种地址: -- 网络地址:http 或者 https 开头,如 http://172.16.5.5:8080/rotate/root.json +- 网络地址:http 或者 https 开头,如 `http://172.16.5.5:8080/rotate/root.json` - 本地文件路径:相对路径或绝对路径均可 如果是网络地址,该地址必须提供以下功能: diff --git a/tiup/tiup-command-status.md b/tiup/tiup-command-status.md index eee7e5946446..1b427bc72210 100644 --- a/tiup/tiup-command-status.md +++ b/tiup/tiup-command-status.md @@ -12,6 +12,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-status/'] > **使用限制:** > > 只能查询到以下两种组件的信息: +> > 1. 尚在运行的组件 > 2. 通过 `tiup -T/--tag` 指定 tag 运行的组件 diff --git a/tiup/tiup-component-cluster-audit.md b/tiup/tiup-component-cluster-audit.md index 491e5c106c2c..027623d326b5 100644 --- a/tiup/tiup-component-cluster-audit.md +++ b/tiup/tiup-component-cluster-audit.md @@ -28,6 +28,6 @@ tiup cluster audit [audit-id] [flags] - 若指定 `[audit-id]`,则输出对应的执行日志 - 若不指定 `[audit-id]` 则输出含有以下字段的表格: - - ID:该条记录对应的 audit-id - - Time:该条记录对应的命令执行时间 - - Command:该条记录对应的命令 \ No newline at end of file + - ID:该条记录对应的 audit-id + - Time:该条记录对应的命令执行时间 + - Command:该条记录对应的命令 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-check.md b/tiup/tiup-component-cluster-check.md index 8cff47ce3296..a5ed9dcc9b09 100644 --- a/tiup/tiup-component-cluster-check.md +++ b/tiup/tiup-component-cluster-check.md @@ -68,7 +68,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-check/'] 检查 FirewallD 服务是否启用:建议用户禁用 FirewallD 或为 TiDB 集群各服务添加允许规则。 -### irqbalance +### irqbalance 检查 irqbalance 服务是否启用:建议用户启用 irqbalance 服务。 @@ -178,6 +178,7 @@ tiup cluster check [flags] ### -p, --password(boolean,默认 false) 在连接目标机器时使用密码登陆: + - 对于指定了 `--cluster` 的集群,密码为部署集群时拓扑文件中指定的用户的密码 - 对于未指定 `--cluster` 的集群,密码为 `-u/--user` 参数指定的用户的密码 diff --git a/tiup/tiup-component-cluster-display.md b/tiup/tiup-component-cluster-display.md index d50c54bd5c8c..de7f847efd17 100644 --- a/tiup/tiup-component-cluster-display.md +++ b/tiup/tiup-component-cluster-display.md @@ -50,11 +50,11 @@ tiup cluster display [flags] - SSH 客户端类型 - Dashboard 地址 - 含有以下字段的表格: - - ID:节点 ID,由 IP:PORT 构成 - - Role:该节点部署的服务角色(如 tidb, tikv 等) - - Host:该节点对应的机器 IP - - Ports:服务占用的端口号 - - OS/Arch:该节点的操作系统和机器架构 - - Status:该节点服务当前的状态 - - Data Dir:服务的数据目录,`-` 表示没有数据目录 - - Deploy Dir:服务的部署目录 \ No newline at end of file + - ID:节点 ID,由 IP:PORT 构成 + - Role:该节点部署的服务角色(如 tidb, tikv 等) + - Host:该节点对应的机器 IP + - Ports:服务占用的端口号 + - OS/Arch:该节点的操作系统和机器架构 + - Status:该节点服务当前的状态 + - Data Dir:服务的数据目录,`-` 表示没有数据目录 + - Deploy Dir:服务的部署目录 \ No newline at end of file diff --git a/tiup/tiup-component-cluster-list.md b/tiup/tiup-component-cluster-list.md index 659acfff8c56..8c12b69fe5d3 100644 --- a/tiup/tiup-component-cluster-list.md +++ b/tiup/tiup-component-cluster-list.md @@ -28,6 +28,7 @@ tiup cluster list [flags] ## 输出 输出含有以下字段的表格: + - Name:集群名字 - User:部署用户 - Version:集群版本 diff --git a/tiup/tiup-component-cluster-patch.md b/tiup/tiup-component-cluster-patch.md index d0dd7cbd57e9..b8557c06680e 100644 --- a/tiup/tiup-component-cluster-patch.md +++ b/tiup/tiup-component-cluster-patch.md @@ -23,14 +23,14 @@ tiup cluster patch [flags] - `` 代表要操作的集群名 - `` 为用于替换的二进制包,其打包方式如下: - - 确定当前要替换的组件名称 `${component}` (tidb, tikv, pd...) 以及其版本 `${version}` (v4.0.0, v4.0.1 ...),以及其运行的平台 `${os}` (linux) 和 `${arch}` (amd64, arm64) - - 下载当前的组件包:`wget https://tiup-mirrors.pingcap.com/${component}-${version}-${os}-${arch}.tar.gz -O /tmp/${component}-${version}-${os}-${arch}.tar.gz` - - 建立临时打包目录:`mkdir -p /tmp/package && cd /tmp/package` - - 解压原来的二进制包:`tar xf /tmp/${component}-${version}-${os}-${arch}.tar.gz` - - 查看临时打包目录中的文件结构:`find .` - - 将要替换的二进制文件或配置文件复制到临时目录的对应位置 - - 重新打包 `tar czf /tmp/${component}-hotfix-${os}-${arch}.tar.gz *` - - 通过以上步骤之后,`/tmp/${component}-hotfix-${os}-${arch}.tar.gz` 就可以用于 patch 命令了 + - 确定当前要替换的组件名称 `${component}` (tidb, tikv, pd...) 以及其版本 `${version}` (v4.0.0, v4.0.1 ...),以及其运行的平台 `${os}` (linux) 和 `${arch}` (amd64, arm64) + - 下载当前的组件包:`wget https://tiup-mirrors.pingcap.com/${component}-${version}-${os}-${arch}.tar.gz -O /tmp/${component}-${version}-${os}-${arch}.tar.gz` + - 建立临时打包目录:`mkdir -p /tmp/package && cd /tmp/package` + - 解压原来的二进制包:`tar xf /tmp/${component}-${version}-${os}-${arch}.tar.gz` + - 查看临时打包目录中的文件结构:`find .` + - 将要替换的二进制文件或配置文件复制到临时目录的对应位置 + - 重新打包 `tar czf /tmp/${component}-hotfix-${os}-${arch}.tar.gz *` + - 通过以上步骤之后,`/tmp/${component}-hotfix-${os}-${arch}.tar.gz` 就可以用于 patch 命令了 ## 选项 diff --git a/tiup/tiup-component-cluster-scale-in.md b/tiup/tiup-component-cluster-scale-in.md index b670e2f6e18c..722d958aee9f 100644 --- a/tiup/tiup-component-cluster-scale-in.md +++ b/tiup/tiup-component-cluster-scale-in.md @@ -12,15 +12,15 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-scale-in/'] 由于 TiKV,TiFlash 和 TiDB Binlog 组件的下线是异步的(需要先通过 API 执行移除操作)并且下线过程耗时较长(需要持续观察节点是否已经下线成功),所以对 TiKV,TiFlash 和 TiDB Binlog 组件做了特殊处理: - 对 TiKV,TiFlash 及 Binlog 组件的操作: - - tiup-cluster 通过 API 将其下线后直接退出而不等待下线完成 - - 执行 `tiup cluster display` 查看下线节点的状态,等待其状态变为 Tombstone - - 执行 `tiup cluster prune` 命令清理 Tombstone 节点,该命令会执行以下操作: - - 停止已经下线掉的节点的服务 - - 清理已经下线掉的节点的相关数据文件 - - 更新集群的拓扑,移除已经下线掉的节点 + - tiup-cluster 通过 API 将其下线后直接退出而不等待下线完成 + - 执行 `tiup cluster display` 查看下线节点的状态,等待其状态变为 Tombstone + - 执行 `tiup cluster prune` 命令清理 Tombstone 节点,该命令会执行以下操作: + - 停止已经下线掉的节点的服务 + - 清理已经下线掉的节点的相关数据文件 + - 更新集群的拓扑,移除已经下线掉的节点 - 对其他组件的操作 - - 下线 PD 组件时,会通过 API 将指定节点从集群中删除掉(这个过程很快),然后停掉指定 PD 的服务并且清除该节点的相关数据文件 - - 下线其他组件时,直接停止并且清除节点的相关数据文件 + - 下线 PD 组件时,会通过 API 将指定节点从集群中删除掉(这个过程很快),然后停掉指定 PD 的服务并且清除该节点的相关数据文件 + - 下线其他组件时,直接停止并且清除节点的相关数据文件 ## 语法 diff --git a/tiup/tiup-component-dm-audit.md b/tiup/tiup-component-dm-audit.md index 487224cbd60a..3e755123af36 100644 --- a/tiup/tiup-component-dm-audit.md +++ b/tiup/tiup-component-dm-audit.md @@ -28,6 +28,6 @@ tiup dm audit [audit-id] [flags] - 若指定 `[audit-id]`,则输出对应的执行日志 - 若不指定 `[audit-id]` 则输出含有以下字段的表格: - - ID:该条记录对应的 audit-id - - Time:该条记录对应的命令执行时间 - - Command:该条记录对应的命令 \ No newline at end of file + - ID:该条记录对应的 audit-id + - Time:该条记录对应的命令执行时间 + - Command:该条记录对应的命令 \ No newline at end of file diff --git a/tiup/tiup-component-dm-display.md b/tiup/tiup-component-dm-display.md index 0c7b86ab7438..dbf85edc88ad 100644 --- a/tiup/tiup-component-dm-display.md +++ b/tiup/tiup-component-dm-display.md @@ -45,11 +45,11 @@ tiup dm display [flags] - 集群版本 - SSH 客户端类型 - 含有以下字段的表格: - - ID:节点 ID,由 IP:PORT 构成 - - Role:该节点部署的服务角色(如 tidb, tikv 等) - - Host:该节点对应的机器 IP - - Ports:服务占用的端口号 - - OS/Arch:该节点的操作系统和机器架构 - - Status:该节点服务当前的状态 - - Data Dir:服务的数据目录,`-` 表示没有数据目录 - - Deploy Dir:服务的部署目录 \ No newline at end of file + - ID:节点 ID,由 IP:PORT 构成 + - Role:该节点部署的服务角色(如 tidb, tikv 等) + - Host:该节点对应的机器 IP + - Ports:服务占用的端口号 + - OS/Arch:该节点的操作系统和机器架构 + - Status:该节点服务当前的状态 + - Data Dir:服务的数据目录,`-` 表示没有数据目录 + - Deploy Dir:服务的部署目录 \ No newline at end of file diff --git a/tiup/tiup-component-dm-list.md b/tiup/tiup-component-dm-list.md index 6c7f91b896f3..a38edba6a3aa 100644 --- a/tiup/tiup-component-dm-list.md +++ b/tiup/tiup-component-dm-list.md @@ -28,6 +28,7 @@ tiup dm list [flags] ## 输出 输出含有以下字段的表格: + - Name:集群名字 - User:部署用户 - Version:集群版本 diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index a5cd92194544..64e59ccd8b91 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -23,14 +23,14 @@ tiup dm patch [flags] - `` 代表要操作的集群名 - `` 为用于替换的二进制包,其打包方式如下: - - 确定当前要替换的组件名称 `${component}` (dm-master, dm-worker ...) 以及其版本 `${version}` (v2.0.0, v2.0.1 ...),以及其运行的平台 `${os}` (linux) 和 `${arch}` (amd64, arm64) - - 下载当前的组件包:`wget https://tiup-mirrors.pingcap.com/${component}-${version}-${os}-${arch}.tar.gz -O /tmp/${component}-${version}-${os}-${arch}.tar.gz` - - 建立临时打包目录:`mkdir -p /tmp/package && cd /tmp/package` - - 解压原来的二进制包:`tar xf /tmp/${component}-${version}-${os}-${arch}.tar.gz` - - 查看临时打包目录中的文件结构:`find .` - - 将要替换的二进制文件或配置文件复制到临时目录的对应位置 - - 重新打包 `tar czf /tmp/${component}-hotfix-${os}-${arch}.tar.gz *` - - 通过以上步骤之后,`/tmp/${component}-hotfix-${os}-${arch}.tar.gz` 就可以用于 patch 命令了 + - 确定当前要替换的组件名称 `${component}` (dm-master, dm-worker ...) 以及其版本 `${version}` (v2.0.0, v2.0.1 ...),以及其运行的平台 `${os}` (linux) 和 `${arch}` (amd64, arm64) + - 下载当前的组件包:`wget https://tiup-mirrors.pingcap.com/${component}-${version}-${os}-${arch}.tar.gz -O /tmp/${component}-${version}-${os}-${arch}.tar.gz` + - 建立临时打包目录:`mkdir -p /tmp/package && cd /tmp/package` + - 解压原来的二进制包:`tar xf /tmp/${component}-${version}-${os}-${arch}.tar.gz` + - 查看临时打包目录中的文件结构:`find .` + - 将要替换的二进制文件或配置文件复制到临时目录的对应位置 + - 重新打包 `tar czf /tmp/${component}-hotfix-${os}-${arch}.tar.gz *` + - 通过以上步骤之后,`/tmp/${component}-hotfix-${os}-${arch}.tar.gz` 就可以用于 patch 命令了 ## 选项 diff --git a/tiup/tiup-dm-topology-reference.md b/tiup/tiup-dm-topology-reference.md index 76721fda3941..2b40f300b860 100644 --- a/tiup/tiup-dm-topology-reference.md +++ b/tiup/tiup-dm-topology-reference.md @@ -232,7 +232,7 @@ monitoring_servers: - `username`:Grafana 登陆界面的用户名 - `password`:Grafana 对应的密码 - `dashboard_dir`:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global `中的 `resource_control` +- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global`中的 `resource_control` > **注意:** > diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index ddd004aa3cb5..34784488e07f 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -8,12 +8,14 @@ aliases: ['/docs-cn/dev/tiup/tiup-mirror-reference/'] ## 介绍 TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件的元信息。镜像有两种存在形式: + - 本地磁盘上的目录:用于服务本地的 TiUP 客户端,文档中将称之为本地镜像 - 基于远程的磁盘目录启动的 HTTP 镜像:服务远程的 TiUP 客户端,文档中将称之为远程镜像 ## 镜像的创建与更新 镜像可以通过以下两种方式创建: + - 通过命令 `tiup mirror init` 从零生成 - 通过命令 `tiup mirrir clone` 从已有镜像克隆 @@ -302,11 +304,11 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 - 客户端安装时随 binary 附带了一个 root.json - 客户端运行时以已有的 root.json 为基础,做如下操作: - 1. 获取 root.json 中的 version,记为 N - 2. 向镜像请求 {N+1}.root.json,若成功,使用 root.json 中记录的公钥验证该文件是否合法 + 1. 获取 root.json 中的 version,记为 N + 2. 向镜像请求 {N+1}.root.json,若成功,使用 root.json 中记录的公钥验证该文件是否合法 - 向镜像请求 timestamp.json,并使用 root.json 中记录的公钥验证该文件是否合法 - 检查 timestamp.json 中记录的 snapshot.json 的 checksum 和本地的 snapshot.json 的 checksum 是否吻合 - - 若不吻合,则向镜像请求最新的 snapshot.json 并使用 root.json 中记录的公钥验证该文件是否合法 + - 若不吻合,则向镜像请求最新的 snapshot.json 并使用 root.json 中记录的公钥验证该文件是否合法 - 对于 index.json 文件,从 snapshot.json 中获取其版本号 N,并请求 {N}.index.json,然后使用 root.json 中记录的公钥验证该文件是否合法 - 对于组件(如 tidb.json,tikv.json),从 snapshot.json 中获取其版本号 N,并请求 {N}.{component}.json,然后使用 index.json 中记录的公钥验证该文件是否合法 - 对于组件 tar 文件,从 {component}.json 中获取其 url 及 checksum,请求 url 得到 tar 包,并验证 checksum 是否正确 \ No newline at end of file diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 3caff4ec6687..4561ac8447ac 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -23,7 +23,6 @@ TiUP 的使用围绕命令,组件,镜像这几个核心概念进行,我们 - 可以带有子命令 - 可以带有参数及选项(flags) - TiUP 集成了一系列的子命令用于组件管理和镜像管理。 ### 组件 From 00c69e7e0195909ef785af71281c869e8ad661bc Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 11 Jan 2021 20:12:27 +0800 Subject: [PATCH 19/56] Fix link --- tiup/tiup-cluster-topology-reference.md | 8 ++++---- tiup/tiup-component-cluster-deploy.md | 2 +- tiup/tiup-component-cluster-scale-out.md | 2 +- tiup/tiup-component-dm-import.md | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index dbf09ee1b29d..ba24b91f0095 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -99,11 +99,11 @@ monitored: - `tidb`:TiDB 服务的相关配置,支持的完整配置请参考[TiDB 配置文件描述](/tidb-configuration-file.md) - `tikv`:TiKV 服务的相关配置,支持的完整配置请参考[TiKV 配置文件描述](/tikv-configuration-file.md) - `pd`:PD 服务的相关配置,支持的完整配置请参考[PD 配置文件描述](/pd-configuration-file.md) -- `tiflash`:TiFlash 服务的相关配置,支持的完整配置请参考[TiFlash 配置参数](/tiflash-configuration.md) +- `tiflash`:TiFlash 服务的相关配置,支持的完整配置请参考[TiFlash 配置参数](/tiflash/tiflash-configuration.md) - `tiflash_learner`:每个 TiFlash 中内置了一个特殊的 TiKV,该配置项用于配置这个特殊的 TiKV,一般不建议修改这个配置项下的内容 -- `pump`:Pump 服务的相关配置,支持的完整配置请参考[TiDB Binlog 配置说明](/tidb-binlog-configuration-file.md#pump) -- `drainer`:Drainer 服务的相关配置,支持的完整配置请参考[TiDB Binlog 配置说明](/tidb-binlog-configuration-file.md#drainer) -- `cdc`:CDC 服务的相关配置,支持的完整配置请参考[TiCDC 安装部署](/deploy-ticdc.md) +- `pump`:Pump 服务的相关配置,支持的完整配置请参考[TiDB Binlog 配置说明](/tidb-binlog/tidb-binlog-configuration-file.md#pump) +- `drainer`:Drainer 服务的相关配置,支持的完整配置请参考[TiDB Binlog 配置说明](/tidb-binlog/tidb-binlog-configuration-file.md#drainer) +- `cdc`:CDC 服务的相关配置,支持的完整配置请参考[TiCDC 安装部署](/ticdc/deploy-ticdc.md) `server_configs` 配置示例: diff --git a/tiup/tiup-component-cluster-deploy.md b/tiup/tiup-component-cluster-deploy.md index 921777f0e059..8277940d809a 100644 --- a/tiup/tiup-component-cluster-deploy.md +++ b/tiup/tiup-component-cluster-deploy.md @@ -39,7 +39,7 @@ tiup cluster deploy [flags] ### --no-labels(boolean,默认 false) -当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology.labels.md))。 +当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology-labels.md))。 但是对于测试环境,可能并不在意是否将一个 region 的副本调度到了同一台机器上,这个时候可以使用 `--no-labels` 来绕过检查。 diff --git a/tiup/tiup-component-cluster-scale-out.md b/tiup/tiup-component-cluster-scale-out.md index 84f67218ba95..8d52c7089694 100644 --- a/tiup/tiup-component-cluster-scale-out.md +++ b/tiup/tiup-component-cluster-scale-out.md @@ -34,7 +34,7 @@ tiup cluster scale-out [flags] ### --no-labels(boolean,默认 false) -当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology.labels.md))。 +当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology-labels.md))。 但是对于测试环境,可能并不在意是否将一个 region 的副本调度到了同一台机器上,这个时候可以使用 `--no-labels` 来绕过检查。 diff --git a/tiup/tiup-component-dm-import.md b/tiup/tiup-component-dm-import.md index 350052c368ad..9cad86037b09 100644 --- a/tiup/tiup-component-dm-import.md +++ b/tiup/tiup-component-dm-import.md @@ -15,7 +15,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-dm-import/'] > - 导入前请先停止原集群 > - 对于需要升级到 2.0 的数据迁移任务,请不要执行 `stop-task` > - 仅支持导入到 v2.0.0-rc.2 或更高版本 -> - `import` 命令用于将 DM 1.0 集群导入到全新的 2.0 集群。如果需要将数据迁移任务导入到已有的 2.0 集群,请参考 [TiDB Data Migration 1.0.x 到 2.0.x 手动升级](manually-upgrade-dm-1.0-to-2.0.md) +> - `import` 命令用于将 DM 1.0 集群导入到全新的 2.0 集群。如果需要将数据迁移任务导入到已有的 2.0 集群,请参考 [TiDB Data Migration 1.0.x 到 2.0.x 手动升级](https://docs.pingcap.com/zh/tidb-data-migration/stable/manually-upgrade-dm-1.0-to-2.0) > - 部分组件生成的部署目录会跟原集群不一样,具体可以使用 `display` 命令查看 > - 导入前运行 `tiup update --self && tiup update dm` 确认升级 TiUP DM 组件到最新版本 > - 导入后集群中仅会有一个 DM-master 节点,可参考[扩容节点](/tiup/tiup-component-dm-scale-out.md)对 DM-master 进行扩容 From 8022482439b35c3fb36ec4574ba53473945afeb0 Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 11 Jan 2021 20:24:38 +0800 Subject: [PATCH 20/56] Fix lint --- tiup/tiup-command-mirror-grant.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-command-mirror-grant.md b/tiup/tiup-command-mirror-grant.md index 9df90062dd12..a4b88ae51953 100644 --- a/tiup/tiup-command-mirror-grant.md +++ b/tiup/tiup-command-mirror-grant.md @@ -31,7 +31,7 @@ tiup mirror grant [flags] 一个密钥只能被一个组件管理员使用。 -### -n, --name(string,默认 ) +### -n, --name(string,默认 ``) 指定组件管理员的名字,该名字会展示在组件列表的 `Owner` 字段上,若未指定 `-n/--name` 则使用 `` 作为组件管理员名字。 From 5c09de58b33491d7feebdc3517dc96daff92d69c Mon Sep 17 00:00:00 2001 From: lucklove Date: Wed, 20 Jan 2021 15:09:41 +0800 Subject: [PATCH 21/56] Remove unused aliases --- tiup/tiup-cluster-topology-reference.md | 1 - tiup/tiup-command-clean.md | 1 - tiup/tiup-command-completion.md | 1 - tiup/tiup-command-env.md | 1 - tiup/tiup-command-help.md | 1 - tiup/tiup-command-install.md | 1 - tiup/tiup-command-list.md | 1 - tiup/tiup-command-mirror-clone.md | 1 - tiup/tiup-command-mirror-genkey.md | 1 - tiup/tiup-command-mirror-grant.md | 1 - tiup/tiup-command-mirror-init.md | 1 - tiup/tiup-command-mirror-merge.md | 1 - tiup/tiup-command-mirror-modify.md | 1 - tiup/tiup-command-mirror-publish.md | 1 - tiup/tiup-command-mirror-rotate.md | 1 - tiup/tiup-command-mirror-set.md | 1 - tiup/tiup-command-mirror-sign.md | 1 - tiup/tiup-command-mirror.md | 1 - tiup/tiup-command-status.md | 1 - tiup/tiup-command-telemetry.md | 1 - tiup/tiup-command-uninstall.md | 1 - tiup/tiup-command-update.md | 1 - tiup/tiup-component-cluster-audit.md | 1 - tiup/tiup-component-cluster-check.md | 1 - tiup/tiup-component-cluster-clean.md | 1 - tiup/tiup-component-cluster-deploy.md | 1 - tiup/tiup-component-cluster-destroy.md | 1 - tiup/tiup-component-cluster-disable.md | 1 - tiup/tiup-component-cluster-display.md | 1 - tiup/tiup-component-cluster-edit-config.md | 1 - tiup/tiup-component-cluster-enable.md | 1 - tiup/tiup-component-cluster-help.md | 1 - tiup/tiup-component-cluster-import.md | 1 - tiup/tiup-component-cluster-list.md | 1 - tiup/tiup-component-cluster-patch.md | 1 - tiup/tiup-component-cluster-prune.md | 1 - tiup/tiup-component-cluster-reload.md | 1 - tiup/tiup-component-cluster-rename.md | 1 - tiup/tiup-component-cluster-restart.md | 1 - tiup/tiup-component-cluster-scale-in.md | 1 - tiup/tiup-component-cluster-scale-out.md | 1 - tiup/tiup-component-cluster-start.md | 1 - tiup/tiup-component-cluster-stop.md | 1 - tiup/tiup-component-cluster-upgrade.md | 1 - tiup/tiup-component-cluster.md | 1 - tiup/tiup-component-dm-audit.md | 1 - tiup/tiup-component-dm-deploy.md | 1 - tiup/tiup-component-dm-destroy.md | 1 - tiup/tiup-component-dm-display.md | 1 - tiup/tiup-component-dm-edit-config.md | 1 - tiup/tiup-component-dm-help.md | 1 - tiup/tiup-component-dm-import.md | 1 - tiup/tiup-component-dm-list.md | 1 - tiup/tiup-component-dm-patch.md | 1 - tiup/tiup-component-dm-prune.md | 1 - tiup/tiup-component-dm-reload.md | 1 - tiup/tiup-component-dm-restart.md | 1 - tiup/tiup-component-dm-scale-in.md | 1 - tiup/tiup-component-dm-scale-out.md | 1 - tiup/tiup-component-dm-start.md | 1 - tiup/tiup-component-dm-stop.md | 1 - tiup/tiup-component-dm.md | 1 - tiup/tiup-dm-topology-reference.md | 1 - tiup/tiup-mirror-reference.md | 1 - tiup/tiup-reference.md | 1 - 65 files changed, 65 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index ba24b91f0095..1063806ba882 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -1,6 +1,5 @@ --- title: tiup cluster topology reference -aliases: ['/docs-cn/dev/tiup/tiup-cluster-topology-reference/'] --- # tiup cluster topology reference diff --git a/tiup/tiup-command-clean.md b/tiup/tiup-command-clean.md index aaeeba1fa3f7..e7b2d096a01d 100644 --- a/tiup/tiup-command-clean.md +++ b/tiup/tiup-command-clean.md @@ -1,6 +1,5 @@ --- title: tiup clean -aliases: ['/docs-cn/dev/tiup/tiup-command-clean/'] --- # tiup clean diff --git a/tiup/tiup-command-completion.md b/tiup/tiup-command-completion.md index 027adb44b62a..4d22b53da833 100644 --- a/tiup/tiup-command-completion.md +++ b/tiup/tiup-command-completion.md @@ -1,6 +1,5 @@ --- title: tiup completion -aliases: ['/docs-cn/dev/tiup/tiup-command-completion/'] --- # tiup completion diff --git a/tiup/tiup-command-env.md b/tiup/tiup-command-env.md index 662f169b9cc9..9b48db479932 100644 --- a/tiup/tiup-command-env.md +++ b/tiup/tiup-command-env.md @@ -1,6 +1,5 @@ --- title: tiup env -aliases: ['/docs-cn/dev/tiup/tiup-command-env/'] --- # tiup env diff --git a/tiup/tiup-command-help.md b/tiup/tiup-command-help.md index 514f871a8820..95b3a5a764a1 100644 --- a/tiup/tiup-command-help.md +++ b/tiup/tiup-command-help.md @@ -1,6 +1,5 @@ --- title: tiup help -aliases: ['/docs-cn/dev/tiup/tiup-command-help/'] --- # tiup help diff --git a/tiup/tiup-command-install.md b/tiup/tiup-command-install.md index 59aa750c96e3..716c738c10be 100644 --- a/tiup/tiup-command-install.md +++ b/tiup/tiup-command-install.md @@ -1,6 +1,5 @@ --- title: tiup install -aliases: ['/docs-cn/dev/tiup/tiup-command-install/'] --- # tiup install diff --git a/tiup/tiup-command-list.md b/tiup/tiup-command-list.md index c77ea8bee477..c2efbba39c08 100644 --- a/tiup/tiup-command-list.md +++ b/tiup/tiup-command-list.md @@ -1,6 +1,5 @@ --- title: tiup list -aliases: ['/docs-cn/dev/tiup/tiup-command-list/'] --- # tiup list diff --git a/tiup/tiup-command-mirror-clone.md b/tiup/tiup-command-mirror-clone.md index 42d537c4f489..b59861a5916b 100644 --- a/tiup/tiup-command-mirror-clone.md +++ b/tiup/tiup-command-mirror-clone.md @@ -1,6 +1,5 @@ --- title: tiup mirror clone -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-clone/'] --- # tiup mirror clone diff --git a/tiup/tiup-command-mirror-genkey.md b/tiup/tiup-command-mirror-genkey.md index 0a7cea982b3a..e326e13abc79 100644 --- a/tiup/tiup-command-mirror-genkey.md +++ b/tiup/tiup-command-mirror-genkey.md @@ -1,6 +1,5 @@ --- title: tiup mirror genkey -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-genkey/'] --- # tiup mirror genkey diff --git a/tiup/tiup-command-mirror-grant.md b/tiup/tiup-command-mirror-grant.md index a4b88ae51953..11a9e2cc97d0 100644 --- a/tiup/tiup-command-mirror-grant.md +++ b/tiup/tiup-command-mirror-grant.md @@ -1,6 +1,5 @@ --- title: tiup mirror grant -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-grant/'] --- # tiup mirror grant diff --git a/tiup/tiup-command-mirror-init.md b/tiup/tiup-command-mirror-init.md index 23004fe86f17..fd78234604bc 100644 --- a/tiup/tiup-command-mirror-init.md +++ b/tiup/tiup-command-mirror-init.md @@ -1,6 +1,5 @@ --- title: tiup mirror init -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-init/'] --- # tiup mirror init diff --git a/tiup/tiup-command-mirror-merge.md b/tiup/tiup-command-mirror-merge.md index f1032e250974..d9fecc02fa43 100644 --- a/tiup/tiup-command-mirror-merge.md +++ b/tiup/tiup-command-mirror-merge.md @@ -1,6 +1,5 @@ --- title: tiup mirror merge -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-merge/'] --- # tiup mirror merge diff --git a/tiup/tiup-command-mirror-modify.md b/tiup/tiup-command-mirror-modify.md index 97f401e1bb4a..00574da1f4df 100644 --- a/tiup/tiup-command-mirror-modify.md +++ b/tiup/tiup-command-mirror-modify.md @@ -1,6 +1,5 @@ --- title: tiup mirror modify -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-modify/'] --- # tiup mirror modify diff --git a/tiup/tiup-command-mirror-publish.md b/tiup/tiup-command-mirror-publish.md index f9aeec14aa31..60dd5bffe927 100644 --- a/tiup/tiup-command-mirror-publish.md +++ b/tiup/tiup-command-mirror-publish.md @@ -1,6 +1,5 @@ --- title: tiup mirror publish -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-publish/'] --- # tiup mirror publish diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md index 306dad35ae62..15c6a461795b 100644 --- a/tiup/tiup-command-mirror-rotate.md +++ b/tiup/tiup-command-mirror-rotate.md @@ -1,6 +1,5 @@ --- title: tiup mirror rotate -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-rotate/'] --- # tiup mirror rotate diff --git a/tiup/tiup-command-mirror-set.md b/tiup/tiup-command-mirror-set.md index 5089e8719319..edbf14e67bfe 100644 --- a/tiup/tiup-command-mirror-set.md +++ b/tiup/tiup-command-mirror-set.md @@ -1,6 +1,5 @@ --- title: tiup mirror set -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-set/'] --- # tiup mirror set diff --git a/tiup/tiup-command-mirror-sign.md b/tiup/tiup-command-mirror-sign.md index e308e405f8d0..160718842cf0 100644 --- a/tiup/tiup-command-mirror-sign.md +++ b/tiup/tiup-command-mirror-sign.md @@ -1,6 +1,5 @@ --- title: tiup mirror sign -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-sign/'] --- # tiup mirror sign diff --git a/tiup/tiup-command-mirror.md b/tiup/tiup-command-mirror.md index 10d642c87b9b..6215813e9ed9 100644 --- a/tiup/tiup-command-mirror.md +++ b/tiup/tiup-command-mirror.md @@ -1,6 +1,5 @@ --- title: tiup mirror -aliases: ['/docs-cn/dev/tiup/tiup-command-mirror/'] --- # tiup mirror diff --git a/tiup/tiup-command-status.md b/tiup/tiup-command-status.md index 1b427bc72210..66825a954c81 100644 --- a/tiup/tiup-command-status.md +++ b/tiup/tiup-command-status.md @@ -1,6 +1,5 @@ --- title: tiup status -aliases: ['/docs-cn/dev/tiup/tiup-command-status/'] --- # tiup status diff --git a/tiup/tiup-command-telemetry.md b/tiup/tiup-command-telemetry.md index 3477dcecfa5b..ea11ba4647eb 100644 --- a/tiup/tiup-command-telemetry.md +++ b/tiup/tiup-command-telemetry.md @@ -1,6 +1,5 @@ --- title: tiup telemetry -aliases: ['/docs-cn/dev/tiup/tiup-command-telemetry/'] --- # tiup telemetry diff --git a/tiup/tiup-command-uninstall.md b/tiup/tiup-command-uninstall.md index f2e10432aadc..68e247098e37 100644 --- a/tiup/tiup-command-uninstall.md +++ b/tiup/tiup-command-uninstall.md @@ -1,6 +1,5 @@ --- title: tiup uninstall -aliases: ['/docs-cn/dev/tiup/tiup-command-uninstall/'] --- # tiup uninstall diff --git a/tiup/tiup-command-update.md b/tiup/tiup-command-update.md index d1ff98225f32..855be2617dea 100644 --- a/tiup/tiup-command-update.md +++ b/tiup/tiup-command-update.md @@ -1,6 +1,5 @@ --- title: tiup update -aliases: ['/docs-cn/dev/tiup/tiup-command-update/'] --- # tiup update diff --git a/tiup/tiup-component-cluster-audit.md b/tiup/tiup-component-cluster-audit.md index 027623d326b5..88935bcb9432 100644 --- a/tiup/tiup-component-cluster-audit.md +++ b/tiup/tiup-component-cluster-audit.md @@ -1,6 +1,5 @@ --- title: tiup cluster audit -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-audit/'] --- # tiup cluster audit diff --git a/tiup/tiup-component-cluster-check.md b/tiup/tiup-component-cluster-check.md index a5ed9dcc9b09..85b09797248b 100644 --- a/tiup/tiup-component-cluster-check.md +++ b/tiup/tiup-component-cluster-check.md @@ -1,6 +1,5 @@ --- title: tiup cluster check -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-check/'] --- # tiup cluster check diff --git a/tiup/tiup-component-cluster-clean.md b/tiup/tiup-component-cluster-clean.md index 61d693b9d527..84c437432204 100644 --- a/tiup/tiup-component-cluster-clean.md +++ b/tiup/tiup-component-cluster-clean.md @@ -1,6 +1,5 @@ --- title: tiup cluster clean -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-clean/'] --- # tiup cluster clean diff --git a/tiup/tiup-component-cluster-deploy.md b/tiup/tiup-component-cluster-deploy.md index 8277940d809a..dee6ffe11862 100644 --- a/tiup/tiup-component-cluster-deploy.md +++ b/tiup/tiup-component-cluster-deploy.md @@ -1,6 +1,5 @@ --- title: tiup cluster deploy -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-deploy/'] --- # tiup cluster deploy diff --git a/tiup/tiup-component-cluster-destroy.md b/tiup/tiup-component-cluster-destroy.md index fb1616078dcd..ec959286ef24 100644 --- a/tiup/tiup-component-cluster-destroy.md +++ b/tiup/tiup-component-cluster-destroy.md @@ -1,6 +1,5 @@ --- title: tiup cluster destroy -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-destroy/'] --- # tiup cluster destroy diff --git a/tiup/tiup-component-cluster-disable.md b/tiup/tiup-component-cluster-disable.md index 75a16a1a5a95..f61518ecec5e 100644 --- a/tiup/tiup-component-cluster-disable.md +++ b/tiup/tiup-component-cluster-disable.md @@ -1,6 +1,5 @@ --- title: tiup cluster disable -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-disable/'] --- # tiup cluster disable diff --git a/tiup/tiup-component-cluster-display.md b/tiup/tiup-component-cluster-display.md index de7f847efd17..307362a59f2f 100644 --- a/tiup/tiup-component-cluster-display.md +++ b/tiup/tiup-component-cluster-display.md @@ -1,6 +1,5 @@ --- title: tiup cluster display -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-display/'] --- # tiup cluster display diff --git a/tiup/tiup-component-cluster-edit-config.md b/tiup/tiup-component-cluster-edit-config.md index 10c5e13994a6..b6714ba8cc75 100644 --- a/tiup/tiup-component-cluster-edit-config.md +++ b/tiup/tiup-component-cluster-edit-config.md @@ -1,6 +1,5 @@ --- title: tiup cluster edit-config -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-edit-config/'] --- # tiup cluster edit-config diff --git a/tiup/tiup-component-cluster-enable.md b/tiup/tiup-component-cluster-enable.md index b38588cd0c1d..85c0a678547a 100644 --- a/tiup/tiup-component-cluster-enable.md +++ b/tiup/tiup-component-cluster-enable.md @@ -1,6 +1,5 @@ --- title: tiup cluster enable -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-enable/'] --- # tiup cluster enable diff --git a/tiup/tiup-component-cluster-help.md b/tiup/tiup-component-cluster-help.md index 3fe436753785..6c0b72bbe29a 100644 --- a/tiup/tiup-component-cluster-help.md +++ b/tiup/tiup-component-cluster-help.md @@ -1,6 +1,5 @@ --- title: tiup cluster help -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-help/'] --- # tiup cluster help diff --git a/tiup/tiup-component-cluster-import.md b/tiup/tiup-component-cluster-import.md index 319566e40267..8e3013716609 100644 --- a/tiup/tiup-component-cluster-import.md +++ b/tiup/tiup-component-cluster-import.md @@ -1,6 +1,5 @@ --- title: tiup cluster import -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-import/'] --- # tiup cluster import diff --git a/tiup/tiup-component-cluster-list.md b/tiup/tiup-component-cluster-list.md index 8c12b69fe5d3..cae896fc504f 100644 --- a/tiup/tiup-component-cluster-list.md +++ b/tiup/tiup-component-cluster-list.md @@ -1,6 +1,5 @@ --- title: tiup cluster list -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-list/'] --- # tiup cluster list diff --git a/tiup/tiup-component-cluster-patch.md b/tiup/tiup-component-cluster-patch.md index b8557c06680e..1f3efeee547e 100644 --- a/tiup/tiup-component-cluster-patch.md +++ b/tiup/tiup-component-cluster-patch.md @@ -1,6 +1,5 @@ --- title: tiup cluster patch -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-patch/'] --- # tiup cluster patch diff --git a/tiup/tiup-component-cluster-prune.md b/tiup/tiup-component-cluster-prune.md index 0c01ceb66d0f..0ea3e8e0ab3d 100644 --- a/tiup/tiup-component-cluster-prune.md +++ b/tiup/tiup-component-cluster-prune.md @@ -1,6 +1,5 @@ --- title: tiup cluster prune -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-prune/'] --- # tiup cluster list diff --git a/tiup/tiup-component-cluster-reload.md b/tiup/tiup-component-cluster-reload.md index edfc535b2aff..6085acb990fe 100644 --- a/tiup/tiup-component-cluster-reload.md +++ b/tiup/tiup-component-cluster-reload.md @@ -1,6 +1,5 @@ --- title: tiup cluster reload -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-reload/'] --- # tiup cluster list diff --git a/tiup/tiup-component-cluster-rename.md b/tiup/tiup-component-cluster-rename.md index 16bef8d19b41..d7699b2bf287 100644 --- a/tiup/tiup-component-cluster-rename.md +++ b/tiup/tiup-component-cluster-rename.md @@ -1,6 +1,5 @@ --- title: tiup cluster rename -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-rename/'] --- # tiup cluster rename diff --git a/tiup/tiup-component-cluster-restart.md b/tiup/tiup-component-cluster-restart.md index f02af4445733..2657e45c5a33 100644 --- a/tiup/tiup-component-cluster-restart.md +++ b/tiup/tiup-component-cluster-restart.md @@ -1,6 +1,5 @@ --- title: tiup cluster restart -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-restart/'] --- # tiup cluster restart diff --git a/tiup/tiup-component-cluster-scale-in.md b/tiup/tiup-component-cluster-scale-in.md index 722d958aee9f..7bdc97585872 100644 --- a/tiup/tiup-component-cluster-scale-in.md +++ b/tiup/tiup-component-cluster-scale-in.md @@ -1,6 +1,5 @@ --- title: tiup cluster scale-in -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-scale-in/'] --- # tiup cluster scale-in diff --git a/tiup/tiup-component-cluster-scale-out.md b/tiup/tiup-component-cluster-scale-out.md index 8d52c7089694..79722394ad28 100644 --- a/tiup/tiup-component-cluster-scale-out.md +++ b/tiup/tiup-component-cluster-scale-out.md @@ -1,6 +1,5 @@ --- title: tiup cluster scale-out -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-scale-out/'] --- # tiup cluster scale-out diff --git a/tiup/tiup-component-cluster-start.md b/tiup/tiup-component-cluster-start.md index e26203bccf45..5b873f149e33 100644 --- a/tiup/tiup-component-cluster-start.md +++ b/tiup/tiup-component-cluster-start.md @@ -1,6 +1,5 @@ --- title: tiup cluster start -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-start/'] --- # tiup cluster start diff --git a/tiup/tiup-component-cluster-stop.md b/tiup/tiup-component-cluster-stop.md index 2f5cb4fe4262..6a579e95ffab 100644 --- a/tiup/tiup-component-cluster-stop.md +++ b/tiup/tiup-component-cluster-stop.md @@ -1,6 +1,5 @@ --- title: tiup cluster stop -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-stop/'] --- # tiup cluster stop diff --git a/tiup/tiup-component-cluster-upgrade.md b/tiup/tiup-component-cluster-upgrade.md index 50ac5f1c9bff..f6e3ecb88701 100644 --- a/tiup/tiup-component-cluster-upgrade.md +++ b/tiup/tiup-component-cluster-upgrade.md @@ -1,6 +1,5 @@ --- title: tiup cluster upgrade -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-upgrade/'] --- # tiup cluster upgrade diff --git a/tiup/tiup-component-cluster.md b/tiup/tiup-component-cluster.md index 1b1578dece5c..d3fd6a8288c9 100644 --- a/tiup/tiup-component-cluster.md +++ b/tiup/tiup-component-cluster.md @@ -1,6 +1,5 @@ --- title: TiUP Cluster -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster/'] --- # TiUP Cluster diff --git a/tiup/tiup-component-dm-audit.md b/tiup/tiup-component-dm-audit.md index 3e755123af36..225efe491136 100644 --- a/tiup/tiup-component-dm-audit.md +++ b/tiup/tiup-component-dm-audit.md @@ -1,6 +1,5 @@ --- title: tiup dm audit -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-audit/'] --- # tiup dm audit diff --git a/tiup/tiup-component-dm-deploy.md b/tiup/tiup-component-dm-deploy.md index e524b54ca8db..fd53e26e56b9 100644 --- a/tiup/tiup-component-dm-deploy.md +++ b/tiup/tiup-component-dm-deploy.md @@ -1,6 +1,5 @@ --- title: tiup dm deploy -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-deploy/'] --- # tiup dm deploy diff --git a/tiup/tiup-component-dm-destroy.md b/tiup/tiup-component-dm-destroy.md index dd19efaaeafa..7af39c826116 100644 --- a/tiup/tiup-component-dm-destroy.md +++ b/tiup/tiup-component-dm-destroy.md @@ -1,6 +1,5 @@ --- title: tiup dm destroy -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-destroy/'] --- # tiup dm destroy diff --git a/tiup/tiup-component-dm-display.md b/tiup/tiup-component-dm-display.md index dbf85edc88ad..a5d34acd9321 100644 --- a/tiup/tiup-component-dm-display.md +++ b/tiup/tiup-component-dm-display.md @@ -1,6 +1,5 @@ --- title: tiup dm display -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-display/'] --- # tiup dm display diff --git a/tiup/tiup-component-dm-edit-config.md b/tiup/tiup-component-dm-edit-config.md index c203d92a8234..497150fd37a6 100644 --- a/tiup/tiup-component-dm-edit-config.md +++ b/tiup/tiup-component-dm-edit-config.md @@ -1,6 +1,5 @@ --- title: tiup dm edit-config -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-edit-config/'] --- # tiup dm edit-config diff --git a/tiup/tiup-component-dm-help.md b/tiup/tiup-component-dm-help.md index 8c74165c170f..114f9a25f4ab 100644 --- a/tiup/tiup-component-dm-help.md +++ b/tiup/tiup-component-dm-help.md @@ -1,6 +1,5 @@ --- title: tiup dm help -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-help/'] --- # tiup dm help diff --git a/tiup/tiup-component-dm-import.md b/tiup/tiup-component-dm-import.md index 9cad86037b09..c69920dfae94 100644 --- a/tiup/tiup-component-dm-import.md +++ b/tiup/tiup-component-dm-import.md @@ -1,6 +1,5 @@ --- title: tiup dm import -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-import/'] --- # tiup dm import diff --git a/tiup/tiup-component-dm-list.md b/tiup/tiup-component-dm-list.md index a38edba6a3aa..1f6ae556dc79 100644 --- a/tiup/tiup-component-dm-list.md +++ b/tiup/tiup-component-dm-list.md @@ -1,6 +1,5 @@ --- title: tiup dm list -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-list/'] --- # tiup dm list diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index 64e59ccd8b91..a81051f6c2b5 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -1,6 +1,5 @@ --- title: tiup dm patch -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-patch/'] --- # tiup dm patch diff --git a/tiup/tiup-component-dm-prune.md b/tiup/tiup-component-dm-prune.md index 3961fdb766ed..c1e4a84843f8 100644 --- a/tiup/tiup-component-dm-prune.md +++ b/tiup/tiup-component-dm-prune.md @@ -1,6 +1,5 @@ --- title: tiup dm prune -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-prune/'] --- # tiup dm prune diff --git a/tiup/tiup-component-dm-reload.md b/tiup/tiup-component-dm-reload.md index ed5014b5c306..5eeca5c51912 100644 --- a/tiup/tiup-component-dm-reload.md +++ b/tiup/tiup-component-dm-reload.md @@ -1,6 +1,5 @@ --- title: tiup dm reload -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-reload/'] --- # tiup dm reload diff --git a/tiup/tiup-component-dm-restart.md b/tiup/tiup-component-dm-restart.md index af5db545ff1d..efac15b97e1b 100644 --- a/tiup/tiup-component-dm-restart.md +++ b/tiup/tiup-component-dm-restart.md @@ -1,6 +1,5 @@ --- title: tiup dm restart -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-restart/'] --- # tiup dm restart diff --git a/tiup/tiup-component-dm-scale-in.md b/tiup/tiup-component-dm-scale-in.md index 53b0c1ceeb15..1429fa375394 100644 --- a/tiup/tiup-component-dm-scale-in.md +++ b/tiup/tiup-component-dm-scale-in.md @@ -1,6 +1,5 @@ --- title: tiup dm scale-in -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-scale-in/'] --- # tiup dm scale-in diff --git a/tiup/tiup-component-dm-scale-out.md b/tiup/tiup-component-dm-scale-out.md index c20745628639..7d13b1280625 100644 --- a/tiup/tiup-component-dm-scale-out.md +++ b/tiup/tiup-component-dm-scale-out.md @@ -1,6 +1,5 @@ --- title: tiup dm scale-out -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-scale-out/'] --- # tiup dm scale-out diff --git a/tiup/tiup-component-dm-start.md b/tiup/tiup-component-dm-start.md index 0410c0bb94b0..60f4803f40c2 100644 --- a/tiup/tiup-component-dm-start.md +++ b/tiup/tiup-component-dm-start.md @@ -1,6 +1,5 @@ --- title: tiup dm start -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-start/'] --- # tiup dm start diff --git a/tiup/tiup-component-dm-stop.md b/tiup/tiup-component-dm-stop.md index 699bb7b8625a..433e8ccbb69e 100644 --- a/tiup/tiup-component-dm-stop.md +++ b/tiup/tiup-component-dm-stop.md @@ -1,6 +1,5 @@ --- title: tiup dm stop -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-stop/'] --- # tiup dm stop diff --git a/tiup/tiup-component-dm.md b/tiup/tiup-component-dm.md index 7da01017704f..3e429e934c88 100644 --- a/tiup/tiup-component-dm.md +++ b/tiup/tiup-component-dm.md @@ -1,6 +1,5 @@ --- title: TiUP DM -aliases: ['/docs-cn/dev/tiup/tiup-component-cluster/'] --- # TiUP DM diff --git a/tiup/tiup-dm-topology-reference.md b/tiup/tiup-dm-topology-reference.md index 2b40f300b860..5edb3f1c9757 100644 --- a/tiup/tiup-dm-topology-reference.md +++ b/tiup/tiup-dm-topology-reference.md @@ -1,6 +1,5 @@ --- title: tiup dm topology reference -aliases: ['/docs-cn/dev/tiup/tiup-dm-topology-reference/'] --- # tiup dm topology reference diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index 34784488e07f..aad14ba009ab 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -1,6 +1,5 @@ --- title: tiup mirror reference -aliases: ['/docs-cn/dev/tiup/tiup-mirror-reference/'] --- # tiup mirror reference diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 4561ac8447ac..051fe4030114 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -1,6 +1,5 @@ --- title: TiUP 参考手册 -aliases: ['/docs-cn/dev/tiup/tiup-reference/'] --- # TiUP From 6d82fd40e29cb9f02f08369a38fce92aeb8ff3e9 Mon Sep 17 00:00:00 2001 From: lucklove Date: Wed, 20 Jan 2021 15:43:40 +0800 Subject: [PATCH 22/56] Remove description title --- tiup/tiup-cluster-topology-reference.md | 2 -- tiup/tiup-command-clean.md | 2 -- tiup/tiup-command-completion.md | 2 -- tiup/tiup-command-env.md | 2 -- tiup/tiup-command-help.md | 2 -- tiup/tiup-command-install.md | 2 -- tiup/tiup-command-list.md | 2 -- tiup/tiup-command-mirror-clone.md | 2 -- tiup/tiup-command-mirror-genkey.md | 2 -- tiup/tiup-command-mirror-grant.md | 2 -- tiup/tiup-command-mirror-init.md | 2 -- tiup/tiup-command-mirror-merge.md | 2 -- tiup/tiup-command-mirror-modify.md | 2 -- tiup/tiup-command-mirror-publish.md | 2 -- tiup/tiup-command-mirror-rotate.md | 2 -- tiup/tiup-command-mirror-set.md | 2 -- tiup/tiup-command-mirror-sign.md | 2 -- tiup/tiup-command-mirror.md | 2 -- tiup/tiup-command-status.md | 2 -- tiup/tiup-command-telemetry.md | 2 -- tiup/tiup-command-uninstall.md | 2 -- tiup/tiup-command-update.md | 2 -- tiup/tiup-component-cluster-audit.md | 2 -- tiup/tiup-component-cluster-clean.md | 2 -- tiup/tiup-component-cluster-destroy.md | 2 -- tiup/tiup-component-cluster-disable.md | 2 -- tiup/tiup-component-cluster-display.md | 2 -- tiup/tiup-component-cluster-edit-config.md | 2 -- tiup/tiup-component-cluster-enable.md | 2 -- tiup/tiup-component-cluster-help.md | 2 -- tiup/tiup-component-cluster-import.md | 2 -- tiup/tiup-component-cluster-list.md | 2 -- tiup/tiup-component-cluster-patch.md | 2 -- tiup/tiup-component-cluster-prune.md | 2 -- tiup/tiup-component-cluster-reload.md | 2 -- tiup/tiup-component-cluster-rename.md | 2 -- tiup/tiup-component-cluster-restart.md | 2 -- tiup/tiup-component-cluster-scale-in.md | 2 -- tiup/tiup-component-cluster-scale-out.md | 2 -- tiup/tiup-component-cluster-start.md | 2 -- tiup/tiup-component-cluster-stop.md | 2 -- tiup/tiup-component-cluster-upgrade.md | 2 -- tiup/tiup-component-cluster.md | 2 -- tiup/tiup-component-dm-audit.md | 2 -- tiup/tiup-component-dm-destroy.md | 2 -- tiup/tiup-component-dm-display.md | 2 -- tiup/tiup-component-dm-edit-config.md | 2 -- tiup/tiup-component-dm-help.md | 2 -- tiup/tiup-component-dm-import.md | 2 -- tiup/tiup-component-dm-list.md | 2 -- tiup/tiup-component-dm-patch.md | 2 -- tiup/tiup-component-dm-prune.md | 2 -- tiup/tiup-component-dm-reload.md | 2 -- tiup/tiup-component-dm-restart.md | 2 -- tiup/tiup-component-dm-scale-in.md | 2 -- tiup/tiup-component-dm-scale-out.md | 2 -- tiup/tiup-component-dm-start.md | 2 -- tiup/tiup-component-dm-stop.md | 2 -- tiup/tiup-component-dm-upgrade.md | 2 -- tiup/tiup-component-dm.md | 2 -- tiup/tiup-dm-topology-reference.md | 2 -- tiup/tiup-mirror-reference.md | 2 -- tiup/tiup-reference.md | 2 -- 63 files changed, 126 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index 1063806ba882..1f8047ef10bf 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -4,8 +4,6 @@ title: tiup cluster topology reference # tiup cluster topology reference -## 介绍 - 在部署或扩容 TiDB 集群时,需要提供一份拓扑文件来描述集群拓扑,同样,修改配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。 拓扑文件[示例参考](https://github.com/pingcap/tiup/blob/master/examples/topology.example.yaml)。 diff --git a/tiup/tiup-command-clean.md b/tiup/tiup-command-clean.md index e7b2d096a01d..b3fc69127924 100644 --- a/tiup/tiup-command-clean.md +++ b/tiup/tiup-command-clean.md @@ -4,8 +4,6 @@ title: tiup clean # tiup clean -## 介绍 - 命令 `tiup clean` 用于清除组件运行过程中产生的数据 ## 语法 diff --git a/tiup/tiup-command-completion.md b/tiup/tiup-command-completion.md index 4d22b53da833..56c4a6ab8f1d 100644 --- a/tiup/tiup-command-completion.md +++ b/tiup/tiup-command-completion.md @@ -4,8 +4,6 @@ title: tiup completion # tiup completion -## 介绍 - 为了记忆命令的心智负担,TiUP 提供了 `tiup completion` 命令用于生成命令行自动补全的配置文件,目前支持 `bash` 和 `zsh` 两种 shell 的命令补全。 如果是 bash,需要提前安装好 bash-completion: diff --git a/tiup/tiup-command-env.md b/tiup/tiup-command-env.md index 9b48db479932..139af33039b0 100644 --- a/tiup/tiup-command-env.md +++ b/tiup/tiup-command-env.md @@ -4,8 +4,6 @@ title: tiup env # tiup env -## 介绍 - TiUP 为用户提供了灵活的定制化接口,其中一部分是使用环境变量来实现的,命令 `tiup env` 用于查询 TiUP 支持用户自定义的环境变量以及它们此时的值。 ## 语法 diff --git a/tiup/tiup-command-help.md b/tiup/tiup-command-help.md index 95b3a5a764a1..6fe53fc601a5 100644 --- a/tiup/tiup-command-help.md +++ b/tiup/tiup-command-help.md @@ -4,8 +4,6 @@ title: tiup help # tiup help -## 介绍 - TiUP 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得。基本上,`tiup help ` 等价于 `tiup --help`。 ## 语法 diff --git a/tiup/tiup-command-install.md b/tiup/tiup-command-install.md index 716c738c10be..e35a9057c29c 100644 --- a/tiup/tiup-command-install.md +++ b/tiup/tiup-command-install.md @@ -4,8 +4,6 @@ title: tiup install # tiup install -## 介绍 - 命令 `tiup install` 用于安装一个或多个组件,它会从镜像仓库中下载特定版本的组件包,并在本地的 TiUP 数据目录中解压,以便后续使用。另外,当 TiUP 运行一个组件不存在的时候,会尝试先下载该组件,再自动运行,若不存在则报错。 ## 语法 diff --git a/tiup/tiup-command-list.md b/tiup/tiup-command-list.md index c2efbba39c08..553e0177c6c0 100644 --- a/tiup/tiup-command-list.md +++ b/tiup/tiup-command-list.md @@ -4,8 +4,6 @@ title: tiup list # tiup list -## 介绍 - 命令 `tiup list` 用于查询镜像中可用的组件列表。 ## 语法 diff --git a/tiup/tiup-command-mirror-clone.md b/tiup/tiup-command-mirror-clone.md index b59861a5916b..f8e7cf1eb05c 100644 --- a/tiup/tiup-command-mirror-clone.md +++ b/tiup/tiup-command-mirror-clone.md @@ -4,8 +4,6 @@ title: tiup mirror clone # tiup mirror clone -## 介绍 - 命令 `tiup mirror clone` 用于从一个已经存在的镜像上克隆或部分克隆出一个新的镜像,新旧镜像的组件/部分组件相同,但使用的签名密钥不同。 ## 语法 diff --git a/tiup/tiup-command-mirror-genkey.md b/tiup/tiup-command-mirror-genkey.md index e326e13abc79..1f387f3c53af 100644 --- a/tiup/tiup-command-mirror-genkey.md +++ b/tiup/tiup-command-mirror-genkey.md @@ -4,8 +4,6 @@ title: tiup mirror genkey # tiup mirror genkey -## 介绍 - 在 TiUP [镜像](/tiup/tiup-mirror-reference.md)的定义中,有三类角色: - 镜像管理员:拥有 `root.json`, `index.json`, `snapshot.json` 以及 `timestamp.json` 的修改权限 diff --git a/tiup/tiup-command-mirror-grant.md b/tiup/tiup-command-mirror-grant.md index 11a9e2cc97d0..6095c6aaf0f7 100644 --- a/tiup/tiup-command-mirror-grant.md +++ b/tiup/tiup-command-mirror-grant.md @@ -4,8 +4,6 @@ title: tiup mirror grant # tiup mirror grant -## 介绍 - 命令 `tiup mirror grant` 用来向当前镜像中引入一个组件管理员。 组件管理员可以使用其密钥发布新的组件,也可以对其之前发布的组件作出修改,添加组件管理员时,该组件管理员需要先将其公钥发送给镜像管理员,镜像管理员使用此命令将其加入。 diff --git a/tiup/tiup-command-mirror-init.md b/tiup/tiup-command-mirror-init.md index fd78234604bc..c17ee5fb8817 100644 --- a/tiup/tiup-command-mirror-init.md +++ b/tiup/tiup-command-mirror-init.md @@ -4,8 +4,6 @@ title: tiup mirror init # tiup mirror init -## 介绍 - 命令 `tiup mirror init` 用于初始化一个空的镜像,初始化的镜像不包含任何组件和组件管理员,仅生成以下文件: ``` diff --git a/tiup/tiup-command-mirror-merge.md b/tiup/tiup-command-mirror-merge.md index d9fecc02fa43..2ff412639a57 100644 --- a/tiup/tiup-command-mirror-merge.md +++ b/tiup/tiup-command-mirror-merge.md @@ -4,8 +4,6 @@ title: tiup mirror merge # tiup mirror merge -## 介绍 - 命令 `tiup mirror merge` 用于合并一个或多个镜像到当前镜像。 执行此命令需要满足几个条件: diff --git a/tiup/tiup-command-mirror-modify.md b/tiup/tiup-command-mirror-modify.md index 00574da1f4df..bb645de8fa95 100644 --- a/tiup/tiup-command-mirror-modify.md +++ b/tiup/tiup-command-mirror-modify.md @@ -4,8 +4,6 @@ title: tiup mirror modify # tiup mirror modify -## 介绍 - 命令 `tiup mirror modify` 用于修改已发布的组件。只有合法的组件管理员才可以修改组件,且只能修改其自己发布的组件,组件发布方式参考[publish 命令](/tiup/tiup-command-mirror-publish.md)。 ## 语法 diff --git a/tiup/tiup-command-mirror-publish.md b/tiup/tiup-command-mirror-publish.md index 60dd5bffe927..cb79ca455131 100644 --- a/tiup/tiup-command-mirror-publish.md +++ b/tiup/tiup-command-mirror-publish.md @@ -4,8 +4,6 @@ title: tiup mirror publish # tiup mirror publish -## 介绍 - 命令 `tiup mirror publish` 用于发布新组件,或已有组件的新版本。只有合法的组件管理员才可以发布组件,组件管理员的引入方式参考[grant 命令](/tiup/tiup-command-mirror-grant.md)。 ## 语法 diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md index 15c6a461795b..75239cd7ef17 100644 --- a/tiup/tiup-command-mirror-rotate.md +++ b/tiup/tiup-command-mirror-rotate.md @@ -4,8 +4,6 @@ title: tiup mirror rotate # tiup mirror rotate -## 介绍 - TiUP 的镜像中有一个非常重要的文件:root.json,里面记录了整个系统需要使用的公钥,是 TiUP 信任链的基础,它的内容主要包含几个部分: - N 个管理员的签名,对于官方镜像, N 为 5,默认初始化的镜像 N 为 3 diff --git a/tiup/tiup-command-mirror-set.md b/tiup/tiup-command-mirror-set.md index edbf14e67bfe..f8a2d0cc2df5 100644 --- a/tiup/tiup-command-mirror-set.md +++ b/tiup/tiup-command-mirror-set.md @@ -4,8 +4,6 @@ title: tiup mirror set # tiup mirror set -## 介绍 - 命令 `tiup mirror set` 用于切换当前镜像,支持本地文件系统和远程网络两种镜像。 官方镜像为 `https://tiup-mirrors.pingcap.com` diff --git a/tiup/tiup-command-mirror-sign.md b/tiup/tiup-command-mirror-sign.md index 160718842cf0..8308ca18ef9a 100644 --- a/tiup/tiup-command-mirror-sign.md +++ b/tiup/tiup-command-mirror-sign.md @@ -4,8 +4,6 @@ title: tiup mirror sign # tiup mirror sign -## 介绍 - 命令 `tiup mirror sign` 用于对[镜像](/tiup/tiup-mirror-reference.md)中定义的元信息文件(*.json)进行签名,这些文件可能储存在本地文件系统,也可以放在远端使用 http 协议提供签名入口。 ## 语法 diff --git a/tiup/tiup-command-mirror.md b/tiup/tiup-command-mirror.md index 6215813e9ed9..1d30586b45da 100644 --- a/tiup/tiup-command-mirror.md +++ b/tiup/tiup-command-mirror.md @@ -4,8 +4,6 @@ title: tiup mirror # tiup mirror -## 介绍 - 在 TiUP 中,[镜像](/tiup/tiup-mirror-reference.md)是一个非常重要的概念,目前 TiUP 支持两种形式的镜像: - 本地镜像:即 TiUP 客户端和镜像在同一台机器上,客户端通过文件系统访问镜像 diff --git a/tiup/tiup-command-status.md b/tiup/tiup-command-status.md index 66825a954c81..27e60c8e4d9e 100644 --- a/tiup/tiup-command-status.md +++ b/tiup/tiup-command-status.md @@ -4,8 +4,6 @@ title: tiup status # tiup status -## 介绍 - 命令 `tiup status` 查看组件运行信息:通过 `tiup [flags] [args...]` 运行组件之后,可以通过该命令查看组件的运行信息。 > **使用限制:** diff --git a/tiup/tiup-command-telemetry.md b/tiup/tiup-command-telemetry.md index ea11ba4647eb..012e64985ebb 100644 --- a/tiup/tiup-command-telemetry.md +++ b/tiup/tiup-command-telemetry.md @@ -4,8 +4,6 @@ title: tiup telemetry # tiup telemetry -## 介绍 - TiDB、TiUP 及 TiDB Dashboard 默认会收集使用情况信息,并将这些信息分享给 PingCAP 用于改善产品,例如,通过这些使用信息,PingCAP 可以了解常见的 TiDB 集群操作,从而确定新功能优先级。 当 TiUP 遥测功能开启时,执行 TiUP 命令时会将使用情况信息分享给 PingCAP,包括(但不限于): diff --git a/tiup/tiup-command-uninstall.md b/tiup/tiup-command-uninstall.md index 68e247098e37..3545f531bf05 100644 --- a/tiup/tiup-command-uninstall.md +++ b/tiup/tiup-command-uninstall.md @@ -4,8 +4,6 @@ title: tiup uninstall # tiup uninstall -## 介绍 - 命令 `tiup uninstall` 用于卸载已安装的组件。 ## 语法 diff --git a/tiup/tiup-command-update.md b/tiup/tiup-command-update.md index 855be2617dea..2b4dae36cd55 100644 --- a/tiup/tiup-command-update.md +++ b/tiup/tiup-command-update.md @@ -4,8 +4,6 @@ title: tiup update # tiup update -## 介绍 - 命令 `tiup update` 用于升级已安装的组件或者自身。 ## 语法 diff --git a/tiup/tiup-component-cluster-audit.md b/tiup/tiup-component-cluster-audit.md index 88935bcb9432..6daac6099fa6 100644 --- a/tiup/tiup-component-cluster-audit.md +++ b/tiup/tiup-component-cluster-audit.md @@ -4,8 +4,6 @@ title: tiup cluster audit # tiup cluster audit -## 介绍 - 命令 `tiup cluster audit` 可以用于查看历史上对所有集群执行了什么命令,以及每个命令的执行日志。 ## 语法 diff --git a/tiup/tiup-component-cluster-clean.md b/tiup/tiup-component-cluster-clean.md index 84c437432204..4ccd46a5cb05 100644 --- a/tiup/tiup-component-cluster-clean.md +++ b/tiup/tiup-component-cluster-clean.md @@ -4,8 +4,6 @@ title: tiup cluster clean # tiup cluster clean -## 介绍 - 在测试环境中,有时候需要将集群重置回刚部署的状态,即删除所有数据,命令 `tiup cluster clean` 可以很方便的做到这一点:它会停止集群,然后删除集群上的数据,额外重启集群之后,就能得到一个全新的集群了。 > **注意:** diff --git a/tiup/tiup-component-cluster-destroy.md b/tiup/tiup-component-cluster-destroy.md index ec959286ef24..547077fdb0c3 100644 --- a/tiup/tiup-component-cluster-destroy.md +++ b/tiup/tiup-component-cluster-destroy.md @@ -4,8 +4,6 @@ title: tiup cluster destroy # tiup cluster destroy -## 介绍 - 当业务下线之后,如果想将集群占有的机器释放出来让给其他业务使用,需要清理掉集群上的数据以及部署的二进制文件。`tiup cluster destroy` 命令会执行以下操作销毁集群: - 停止集群 diff --git a/tiup/tiup-component-cluster-disable.md b/tiup/tiup-component-cluster-disable.md index f61518ecec5e..c40f2e20f40c 100644 --- a/tiup/tiup-component-cluster-disable.md +++ b/tiup/tiup-component-cluster-disable.md @@ -4,8 +4,6 @@ title: tiup cluster disable # tiup cluster disable -## 介绍 - 命令 `tiup cluster disable` 用于关闭集群服务所在机器重启之后的自启动,该命令会到指定的节点上去执行 `systemctl disable ` 来关闭服务的自启动。 ## 语法 diff --git a/tiup/tiup-component-cluster-display.md b/tiup/tiup-component-cluster-display.md index 307362a59f2f..5d598beb4a4f 100644 --- a/tiup/tiup-component-cluster-display.md +++ b/tiup/tiup-component-cluster-display.md @@ -4,8 +4,6 @@ title: tiup cluster display # tiup cluster display -## 介绍 - 如果想查看集群中每个组件的运行状态,逐一登录到各个机器上查看显然很低效。因此,tiup-cluster 提供了 `tiup cluster display` 命令来高效完成这件工作。 ## 语法 diff --git a/tiup/tiup-component-cluster-edit-config.md b/tiup/tiup-component-cluster-edit-config.md index b6714ba8cc75..0c8135d75e4d 100644 --- a/tiup/tiup-component-cluster-edit-config.md +++ b/tiup/tiup-component-cluster-edit-config.md @@ -4,8 +4,6 @@ title: tiup cluster edit-config # tiup cluster edit-config -## 介绍 - 在部署集群之后,如果需要再调整集群服务的配置,则可以使用命令 `tiup cluster edit-config`,它会启动一个编辑器(默认为 $EDITOR 环境变量指定的值,当 EDITOR 环境变量不存在时,使用 vi 打开)允许用户修改指定集群的[拓扑文件](/tiup/tiup-cluster-topology-reference.md)。 > **注意:** diff --git a/tiup/tiup-component-cluster-enable.md b/tiup/tiup-component-cluster-enable.md index 85c0a678547a..b20ceb3495d3 100644 --- a/tiup/tiup-component-cluster-enable.md +++ b/tiup/tiup-component-cluster-enable.md @@ -4,8 +4,6 @@ title: tiup cluster enable # tiup cluster enable -## 介绍 - 命令 `tiup cluster enable` 用于设置集群服务在机器重启后的自启动,该命令会到指定的节点上去执行 `systemctl enable ` 来开启服务的自启。 > **注意:** diff --git a/tiup/tiup-component-cluster-help.md b/tiup/tiup-component-cluster-help.md index 6c0b72bbe29a..a7e390408d54 100644 --- a/tiup/tiup-component-cluster-help.md +++ b/tiup/tiup-component-cluster-help.md @@ -4,8 +4,6 @@ title: tiup cluster help # tiup cluster help -## 介绍 - tiup-cluster 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得。基本上,`tiup cluster help ` 等价于 `tiup cluster --help`。 ## 语法 diff --git a/tiup/tiup-component-cluster-import.md b/tiup/tiup-component-cluster-import.md index 8e3013716609..ae0ad022e588 100644 --- a/tiup/tiup-component-cluster-import.md +++ b/tiup/tiup-component-cluster-import.md @@ -4,8 +4,6 @@ title: tiup cluster import # tiup cluster import -## 介绍 - 在 TiDB 4.0 以前的版本,集群基本是通过 TiDB Ansible 部署的,TiUP Cluster 提供了 `import` 命令用于让这些集群过渡到 tiup-cluster 组件接管。 > **注意:** diff --git a/tiup/tiup-component-cluster-list.md b/tiup/tiup-component-cluster-list.md index cae896fc504f..adda0876f90d 100644 --- a/tiup/tiup-component-cluster-list.md +++ b/tiup/tiup-component-cluster-list.md @@ -4,8 +4,6 @@ title: tiup cluster list # tiup cluster list -## 介绍 - tiup-cluster 支持使用同一个中控机部署多套集群,而命令 `tiup cluster list` 可以查看当前登陆的用户使用该中控机部署了哪些集群。 > **注意:** diff --git a/tiup/tiup-component-cluster-patch.md b/tiup/tiup-component-cluster-patch.md index 1f3efeee547e..bd1eb0ae1de9 100644 --- a/tiup/tiup-component-cluster-patch.md +++ b/tiup/tiup-component-cluster-patch.md @@ -4,8 +4,6 @@ title: tiup cluster patch # tiup cluster patch -## 介绍 - 在集群运行过程中,如果需要动态替换某个服务的二进制文件(即替换过程中保持集群可用),那么可以使用 `tiup cluster patch` 命令,它会完成以下几件事情: - 将用于替换的二进制包上传到目标机器 diff --git a/tiup/tiup-component-cluster-prune.md b/tiup/tiup-component-cluster-prune.md index 0ea3e8e0ab3d..2bd12c637b46 100644 --- a/tiup/tiup-component-cluster-prune.md +++ b/tiup/tiup-component-cluster-prune.md @@ -4,8 +4,6 @@ title: tiup cluster prune # tiup cluster list -## 介绍 - 在[缩容集群](/tiup/tiup-component-cluster-scale-in.md)时,对于某些组件,并不会立即停止服务并删除数据,而是需要等数据调度完成之后,用户手动执行 `tiup cluster prune` 命令清理。 ## 语法 diff --git a/tiup/tiup-component-cluster-reload.md b/tiup/tiup-component-cluster-reload.md index 6085acb990fe..3e60566aa64a 100644 --- a/tiup/tiup-component-cluster-reload.md +++ b/tiup/tiup-component-cluster-reload.md @@ -4,8 +4,6 @@ title: tiup cluster reload # tiup cluster list -## 介绍 - 在[修改集群配置](/tiup/tiup-component-cluster-edit-config.md)之后,需要通过 `tiup cluster reload` 命令让集群重新加载配置才会生效,该命令会将中控机的配置发布到服务运行的远端机器,并按照升级的流程按顺序重启服务,重启过程中集群仍然可用。 ## 语法 diff --git a/tiup/tiup-component-cluster-rename.md b/tiup/tiup-component-cluster-rename.md index d7699b2bf287..55f0cff4313c 100644 --- a/tiup/tiup-component-cluster-rename.md +++ b/tiup/tiup-component-cluster-rename.md @@ -4,8 +4,6 @@ title: tiup cluster rename # tiup cluster rename -## 介绍 - 集群名字是[部署集群](/tiup/tiup-component-cluster-deploy.md)时指定的,在集群部署之后,如果想更改集群名字,可以通过 `tiup cluster rename` 命令来实现。 > **注意:** diff --git a/tiup/tiup-component-cluster-restart.md b/tiup/tiup-component-cluster-restart.md index 2657e45c5a33..f180295bd03e 100644 --- a/tiup/tiup-component-cluster-restart.md +++ b/tiup/tiup-component-cluster-restart.md @@ -4,8 +4,6 @@ title: tiup cluster restart # tiup cluster restart -## 介绍 - 命令 `tiup cluster restart` 用于重启指定集群的所有或部分服务。 > **注意:** diff --git a/tiup/tiup-component-cluster-scale-in.md b/tiup/tiup-component-cluster-scale-in.md index 7bdc97585872..1afe46568213 100644 --- a/tiup/tiup-component-cluster-scale-in.md +++ b/tiup/tiup-component-cluster-scale-in.md @@ -4,8 +4,6 @@ title: tiup cluster scale-in # tiup cluster scale-in -## 介绍 - `tiup cluster scale-in` 命令用于集群缩容,缩容即下线服务,最终会将指定的节点从集群中移除,并删除遗留的相关文件。 由于 TiKV,TiFlash 和 TiDB Binlog 组件的下线是异步的(需要先通过 API 执行移除操作)并且下线过程耗时较长(需要持续观察节点是否已经下线成功),所以对 TiKV,TiFlash 和 TiDB Binlog 组件做了特殊处理: diff --git a/tiup/tiup-component-cluster-scale-out.md b/tiup/tiup-component-cluster-scale-out.md index 79722394ad28..1a83f6f1bc03 100644 --- a/tiup/tiup-component-cluster-scale-out.md +++ b/tiup/tiup-component-cluster-scale-out.md @@ -4,8 +4,6 @@ title: tiup cluster scale-out # tiup cluster scale-out -## 介绍 - `tiup cluster scale-out` 命令用于集群扩容,扩容的内部逻辑与部署类似,tiup-cluster 组件会先建立新节点的 SSH 连接,在目标节点上创建必要的目录,然后执行部署并且启动服务。其中 PD 节点的扩容会通过 join 方式加入到集群中,并且会更新与 PD 有关联的服务的配置;其他服务直接启动加入到集群中。 ## 语法 diff --git a/tiup/tiup-component-cluster-start.md b/tiup/tiup-component-cluster-start.md index 5b873f149e33..4a4b9d954b40 100644 --- a/tiup/tiup-component-cluster-start.md +++ b/tiup/tiup-component-cluster-start.md @@ -4,8 +4,6 @@ title: tiup cluster start # tiup cluster start -## 介绍 - 命令 `tiup cluster start` 用于启动指定集群的所有或部分服务。 ## 语法 diff --git a/tiup/tiup-component-cluster-stop.md b/tiup/tiup-component-cluster-stop.md index 6a579e95ffab..9ffde0f4664e 100644 --- a/tiup/tiup-component-cluster-stop.md +++ b/tiup/tiup-component-cluster-stop.md @@ -4,8 +4,6 @@ title: tiup cluster stop # tiup cluster stop -## 介绍 - 命令 `tiup cluster stop` 用于停止指定集群的所有服务或部分服务。 > **注意:** diff --git a/tiup/tiup-component-cluster-upgrade.md b/tiup/tiup-component-cluster-upgrade.md index f6e3ecb88701..b37c9f320041 100644 --- a/tiup/tiup-component-cluster-upgrade.md +++ b/tiup/tiup-component-cluster-upgrade.md @@ -4,8 +4,6 @@ title: tiup cluster upgrade # tiup cluster upgrade -## 介绍 - 命令 `tiup cluster upgrade` 用于将指定集群升级到特定版本。 ## 语法 diff --git a/tiup/tiup-component-cluster.md b/tiup/tiup-component-cluster.md index d3fd6a8288c9..8c042507c37d 100644 --- a/tiup/tiup-component-cluster.md +++ b/tiup/tiup-component-cluster.md @@ -4,8 +4,6 @@ title: TiUP Cluster # TiUP Cluster -## 介绍 - TiUP Cluster 是 TiUP 提供的使用 Golang 编写的集群管理组件,通过 TiUP cluster 组件就可以进行日常的运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 TiDB 集群、管理 TiDB 集群参数。 ## 语法 diff --git a/tiup/tiup-component-dm-audit.md b/tiup/tiup-component-dm-audit.md index 225efe491136..09dde8ef0546 100644 --- a/tiup/tiup-component-dm-audit.md +++ b/tiup/tiup-component-dm-audit.md @@ -4,8 +4,6 @@ title: tiup dm audit # tiup dm audit -## 介绍 - 命令 `tiup dm audit` 可以用于查看历史上对所有集群执行了什么命令,以及每个命令的执行日志。 ## 语法 diff --git a/tiup/tiup-component-dm-destroy.md b/tiup/tiup-component-dm-destroy.md index 7af39c826116..02097c0a636e 100644 --- a/tiup/tiup-component-dm-destroy.md +++ b/tiup/tiup-component-dm-destroy.md @@ -4,8 +4,6 @@ title: tiup dm destroy # tiup dm destroy -## 介绍 - 当业务下线之后,如果想将集群占有的机器释放出来让给其他业务使用,需要清理掉集群上的数据以及部署的二进制文件。`tiup dm destroy` 命令会执行以下操作销毁集群: - 停止集群 diff --git a/tiup/tiup-component-dm-display.md b/tiup/tiup-component-dm-display.md index a5d34acd9321..5e87c4236a1b 100644 --- a/tiup/tiup-component-dm-display.md +++ b/tiup/tiup-component-dm-display.md @@ -4,8 +4,6 @@ title: tiup dm display # tiup dm display -## 介绍 - 如果想查看集群中每个组件的运行状态,逐一登录到各个机器上查看显然很低效。因此,tiup-dm 提供了 `tiup dm display` 命令来高效完成这件工作。 ## 语法 diff --git a/tiup/tiup-component-dm-edit-config.md b/tiup/tiup-component-dm-edit-config.md index 497150fd37a6..92dedcae785d 100644 --- a/tiup/tiup-component-dm-edit-config.md +++ b/tiup/tiup-component-dm-edit-config.md @@ -4,8 +4,6 @@ title: tiup dm edit-config # tiup dm edit-config -## 介绍 - 在部署集群之后,如果需要再调整集群服务的配置,则可以使用命令 `tiup dm edit-config`,它会启动一个编辑器(默认为 $EDITOR 环境变量指定的值,当 EDITOR 环境变量不存在时,使用 vi 打开)允许用户修改指定集群的[拓扑文件](/tiup/tiup-dm-topology-reference.md)。 > **注意:** diff --git a/tiup/tiup-component-dm-help.md b/tiup/tiup-component-dm-help.md index 114f9a25f4ab..db2179c63d2c 100644 --- a/tiup/tiup-component-dm-help.md +++ b/tiup/tiup-component-dm-help.md @@ -4,8 +4,6 @@ title: tiup dm help # tiup dm help -## 介绍 - tiup-dm 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得。基本上,`tiup dm help ` 等价于 `tiup dm --help`。 ## 语法 diff --git a/tiup/tiup-component-dm-import.md b/tiup/tiup-component-dm-import.md index c69920dfae94..76c72ec710c7 100644 --- a/tiup/tiup-component-dm-import.md +++ b/tiup/tiup-component-dm-import.md @@ -4,8 +4,6 @@ title: tiup dm import # tiup dm import -## 介绍 - 在 DM 1.0 版本,集群基本是通过 TiDB Ansible 部署的,TiUP DM 提供了 `import` 命令导入 1.0 的集群并重新部署 2.0 的集群。 > **注意:** diff --git a/tiup/tiup-component-dm-list.md b/tiup/tiup-component-dm-list.md index 1f6ae556dc79..b98a440e7f84 100644 --- a/tiup/tiup-component-dm-list.md +++ b/tiup/tiup-component-dm-list.md @@ -4,8 +4,6 @@ title: tiup dm list # tiup dm list -## 介绍 - tiup-dm 支持使用同一个中控机部署多套集群,而命令 `tiup dm list` 可以查看当前登陆的用户使用该中控机部署了哪些集群。 > **注意:** diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index a81051f6c2b5..d6dd3d3023df 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -4,8 +4,6 @@ title: tiup dm patch # tiup dm patch -## 介绍 - 在集群运行过程中,如果需要动态替换某个服务的二进制文件(即替换过程中保持集群可用),那么可以使用 `tiup dm patch` 命令,它会完成以下几件事情: - 将用于替换的二进制包上传到目标机器 diff --git a/tiup/tiup-component-dm-prune.md b/tiup/tiup-component-dm-prune.md index c1e4a84843f8..23c27f4d95a6 100644 --- a/tiup/tiup-component-dm-prune.md +++ b/tiup/tiup-component-dm-prune.md @@ -4,8 +4,6 @@ title: tiup dm prune # tiup dm prune -## 介绍 - 在[缩容集群](/tiup/tiup-component-dm-scale-in.md)后,ETCD 中仍然会有少量元信息不会被清理,通常不会有问题,如果确实需要清理,可以手动执行 `tiup cluster prune` 命令清理。 ## 语法 diff --git a/tiup/tiup-component-dm-reload.md b/tiup/tiup-component-dm-reload.md index 5eeca5c51912..f7626825a19e 100644 --- a/tiup/tiup-component-dm-reload.md +++ b/tiup/tiup-component-dm-reload.md @@ -4,8 +4,6 @@ title: tiup dm reload # tiup dm reload -## 介绍 - 在[修改集群配置](/tiup/tiup-component-dm-edit-config.md)之后,需要通过 `tiup dm reload` 命令让集群重新加载配置才会生效,该命令会将中控机的配置发布到服务运行的远端机器,并按照升级的流程按顺序重启服务,重启过程中集群仍然可用。 ## 语法 diff --git a/tiup/tiup-component-dm-restart.md b/tiup/tiup-component-dm-restart.md index efac15b97e1b..7cd29bf0e49e 100644 --- a/tiup/tiup-component-dm-restart.md +++ b/tiup/tiup-component-dm-restart.md @@ -4,8 +4,6 @@ title: tiup dm restart # tiup dm restart -## 介绍 - 命令 `tiup dm restart` 用于重启指定集群的所有或部分服务。 > **注意:** diff --git a/tiup/tiup-component-dm-scale-in.md b/tiup/tiup-component-dm-scale-in.md index 1429fa375394..edf27de37e7b 100644 --- a/tiup/tiup-component-dm-scale-in.md +++ b/tiup/tiup-component-dm-scale-in.md @@ -4,8 +4,6 @@ title: tiup dm scale-in # tiup dm scale-in -## 介绍 - `tiup dm scale-in` 命令用于集群缩容,缩容即下线服务,最终会将指定的节点从集群中移除,并删除遗留的相关文件。 ## 语法 diff --git a/tiup/tiup-component-dm-scale-out.md b/tiup/tiup-component-dm-scale-out.md index 7d13b1280625..d991ef88ce5e 100644 --- a/tiup/tiup-component-dm-scale-out.md +++ b/tiup/tiup-component-dm-scale-out.md @@ -4,8 +4,6 @@ title: tiup dm scale-out # tiup dm scale-out -## 介绍 - `tiup dm scale-out` 命令用于集群扩容,扩容的内部逻辑与部署类似,tiup-dm 组件会先建立新节点的 SSH 连接,在目标节点上创建必要的目录,然后执行部署并且启动服务。 ## 语法 diff --git a/tiup/tiup-component-dm-start.md b/tiup/tiup-component-dm-start.md index 60f4803f40c2..60c50afacb73 100644 --- a/tiup/tiup-component-dm-start.md +++ b/tiup/tiup-component-dm-start.md @@ -4,8 +4,6 @@ title: tiup dm start # tiup dm start -## 介绍 - 命令 `tiup dm start` 用于启动指定集群的所有或部分服务。 ## 语法 diff --git a/tiup/tiup-component-dm-stop.md b/tiup/tiup-component-dm-stop.md index 433e8ccbb69e..813b5f903184 100644 --- a/tiup/tiup-component-dm-stop.md +++ b/tiup/tiup-component-dm-stop.md @@ -4,8 +4,6 @@ title: tiup dm stop # tiup dm stop -## 介绍 - 命令 `tiup dm stop` 用于停止指定集群的所有服务或部分服务。 > **注意:** diff --git a/tiup/tiup-component-dm-upgrade.md b/tiup/tiup-component-dm-upgrade.md index 296c296b2e27..9b255e9f628c 100644 --- a/tiup/tiup-component-dm-upgrade.md +++ b/tiup/tiup-component-dm-upgrade.md @@ -5,8 +5,6 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-dm-upgrade/'] # tiup dm upgrade -## 介绍 - 命令 `tiup dm upgrade` 用于将指定集群升级到特定版本。 ## 语法 diff --git a/tiup/tiup-component-dm.md b/tiup/tiup-component-dm.md index 3e429e934c88..3c50c6621545 100644 --- a/tiup/tiup-component-dm.md +++ b/tiup/tiup-component-dm.md @@ -4,8 +4,6 @@ title: TiUP DM # TiUP DM -## 介绍 - 类似于 [TiUP Cluster](/tiup/tiup-component-cluster.md) 对 TiDB 集群的管理,TiUP DM 是用于对 DM 集群的日常运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 DM 集群、管理 DM 集群参数。 ## 语法 diff --git a/tiup/tiup-dm-topology-reference.md b/tiup/tiup-dm-topology-reference.md index 5edb3f1c9757..4cf679bbe4eb 100644 --- a/tiup/tiup-dm-topology-reference.md +++ b/tiup/tiup-dm-topology-reference.md @@ -4,8 +4,6 @@ title: tiup dm topology reference # tiup dm topology reference -## 介绍 - 在部署或扩容 DM 集群时,需要提供一份拓扑文件来描述集群拓扑,同样,修改配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。 拓扑文件[示例参考](https://github.com/pingcap/tiup/blob/master/examples/dm/topology.example.yaml)。 diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index aad14ba009ab..415b08ec6f3e 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -4,8 +4,6 @@ title: tiup mirror reference # tiup mirror reference -## 介绍 - TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件的元信息。镜像有两种存在形式: - 本地磁盘上的目录:用于服务本地的 TiUP 客户端,文档中将称之为本地镜像 diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 051fe4030114..9ea7050f2f4b 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -4,8 +4,6 @@ title: TiUP 参考手册 # TiUP -## 介绍 - 在各种系统软件和应用软件的安装管理中,包管理器均有着广泛的应用,包管理工具的出现大大简化了软件的安装和升级维护工作。例如,几乎所有使用 RPM 的 Linux 都会使用 Yum 来进行包管理,而 Anaconda 则可以非常方便地管理 python 的环境和相关软件包。 在早期的 TiDB 生态中,没有专门的包管理工具,使用者只能通过相应的配置文件和文件夹命名来手动管理,如 Prometheus 等第三方监控报表工具甚至需要额外的特殊管理,这样大大提升了运维管理难度。 From 46f2276b4db30c0ef906d7dac48ef891042affcf Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Wed, 20 Jan 2021 15:51:07 +0800 Subject: [PATCH 23/56] Apply suggestions from code review Co-authored-by: King-Dylan <50897894+King-Dylan@users.noreply.github.com> Co-authored-by: kissmydb --- tiup/tiup-command-completion.md | 4 ++-- tiup/tiup-command-env.md | 4 ++-- tiup/tiup-command-help.md | 4 ++-- tiup/tiup-command-install.md | 8 ++++---- tiup/tiup-command-list.md | 4 ++-- tiup/tiup-command-mirror-clone.md | 8 ++++---- tiup/tiup-command-mirror-grant.md | 4 ++-- tiup/tiup-command-mirror-init.md | 4 ++-- tiup/tiup-command-mirror-rotate.md | 4 ++-- tiup/tiup-component-cluster-clean.md | 4 ++-- tiup/tiup-documentation-guide.md | 2 +- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tiup/tiup-command-completion.md b/tiup/tiup-command-completion.md index 027adb44b62a..b52c5cb74439 100644 --- a/tiup/tiup-command-completion.md +++ b/tiup/tiup-command-completion.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-completion/'] ## 介绍 -为了记忆命令的心智负担,TiUP 提供了 `tiup completion` 命令用于生成命令行自动补全的配置文件,目前支持 `bash` 和 `zsh` 两种 shell 的命令补全。 +为了降低 TiUP 使用成本,TiUP 提供了 `tiup completion` 命令用于生成命令行自动补全的配置文件。目前支持 `bash` 和 `zsh` 两种 shell 的命令补全。 如果是 bash,需要提前安装好 bash-completion: @@ -43,4 +43,4 @@ source $HOME/.bash_profile ```sh tiup completion zsh > "${fpath[1]}/_tiup" -``` \ No newline at end of file +``` diff --git a/tiup/tiup-command-env.md b/tiup/tiup-command-env.md index 662f169b9cc9..1cdfacc0522b 100644 --- a/tiup/tiup-command-env.md +++ b/tiup/tiup-command-env.md @@ -15,7 +15,7 @@ TiUP 为用户提供了灵活的定制化接口,其中一部分是使用环境 tiup env [name1...N] ``` -`[name1...N]` 用于查看指定的环境变量,若不指定,则查看所有支持的环境变量。 +`[name1...N]` 用于查看指定的环境变量,若不指定,则默认查看所有支持的环境变量。 ## 选项 @@ -26,4 +26,4 @@ tiup env [name1...N] - 若未指定 `[name1...N]`,则输出 "{key}"="{value}" 列表 - 若指定了 `[name1...N]`,则按顺序输出 "{value}" 列表 -以上输出若 value 为空则代表其值未设置,TiUP 会采用默认行为。 \ No newline at end of file +以上输出若 value 为空则代表其值未设置,此时 TiUP 会使用默认参数。 diff --git a/tiup/tiup-command-help.md b/tiup/tiup-command-help.md index 514f871a8820..8c39c578eb7b 100644 --- a/tiup/tiup-command-help.md +++ b/tiup/tiup-command-help.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-help/'] ## 介绍 -TiUP 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得。基本上,`tiup help ` 等价于 `tiup --help`。 +TiUP 命令行界面为用户提供了丰富的帮助信息,用户可以通过 `help` 命令或者 `--help` 参数获得。`tiup help ` 命令等价于 `tiup --help`。 ## 语法 @@ -23,4 +23,4 @@ tiup help [command] ## 输出 -`[command]` 或 TiUP 的帮助信息。 \ No newline at end of file +`[command]` 或 TiUP 的帮助信息。 diff --git a/tiup/tiup-command-install.md b/tiup/tiup-command-install.md index 59aa750c96e3..2b6de56e2295 100644 --- a/tiup/tiup-command-install.md +++ b/tiup/tiup-command-install.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-install/'] ## 介绍 -命令 `tiup install` 用于安装一个或多个组件,它会从镜像仓库中下载特定版本的组件包,并在本地的 TiUP 数据目录中解压,以便后续使用。另外,当 TiUP 运行一个组件不存在的时候,会尝试先下载该组件,再自动运行,若不存在则报错。 +命令 `tiup install` 用于组件安装,它会从镜像仓库中下载指定版本的组件包,并在本地的 TiUP 数据目录中解压,以便后续使用。另外,当 TiUP 运行一个不存在组件的时候,会尝试先下载该组件,再自动运行,若还不存在再报错。 ## 语法 @@ -15,7 +15,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-install/'] tiup install [:version] [component2...N] [flags] ``` -`` 和 `` 代表组件名字,`[version]` 代表一个可选的版本号,若不加 `version`,则安装指定组件的最新稳定版本,否则安装 `[version]` 指定的版本。`[component2...N]` 表示可同时指定多个组件或同一个组件的多个版本。 +`` 和 `` 代表组件名字,`[version]` 代表一个可选的版本号,若不加 `version`,则安装指定组件的最新稳定版本。`[component2...N]` 表示可同时指定多个组件或同一个组件的多个版本。 ## 选项 @@ -23,6 +23,6 @@ tiup install [:version] [component2...N] [flags] ## 输出 -- 正常情况下输出下载进程 +- 正常情况下输出组件的下载信息 - 若组件不存在则报错 `The component "%s" not found` -- 若版本不存在则报错 `version %s not supported by component %s` \ No newline at end of file +- 若版本不存在则报错 `version %s not supported by component %s` diff --git a/tiup/tiup-command-list.md b/tiup/tiup-command-list.md index c77ea8bee477..1d96484e0dc0 100644 --- a/tiup/tiup-command-list.md +++ b/tiup/tiup-command-list.md @@ -21,7 +21,7 @@ tiup list [component] [flags] ### --all (boolean, 默认 false) -显示所有组件:默认只显示非隐藏组件。 +显示所有组件(默认只显示非隐藏组件)。 ### --installed (boolean,默认 false) @@ -38,4 +38,4 @@ tiup list [component] [flags] - 若不指定 --verbose:输出 `组件名(Name)`,`组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 - 若指定 `[component]` - 若 `[component]` 存在:输出 `版本(Version)`,`是否已安装(Installed)`,`发布时间(Release)`,`支持的平台(Platforms)` 构成的版本信息列表 - - 若 `[component]` 不存在:报错 `failed to fetch component: unknown component` \ No newline at end of file + - 若 `[component]` 不存在:报错 `failed to fetch component: unknown component` diff --git a/tiup/tiup-command-mirror-clone.md b/tiup/tiup-command-mirror-clone.md index 42d537c4f489..d87204a002ae 100644 --- a/tiup/tiup-command-mirror-clone.md +++ b/tiup/tiup-command-mirror-clone.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-clone/'] ## 介绍 -命令 `tiup mirror clone` 用于从一个已经存在的镜像上克隆或部分克隆出一个新的镜像,新旧镜像的组件/部分组件相同,但使用的签名密钥不同。 +命令 `tiup mirror clone` 用于从一个已经存在的镜像上克隆或克隆部分组件生成一个新的镜像,新旧镜像的组件相同,但使用的签名密钥不同。 ## 语法 @@ -16,13 +16,13 @@ tiup mirror clone [global version] [flags] ``` - `` 是本地存放克隆下来的镜像的路径,如果不存在则会自动创建 -- `[global version]` 若指定了该参数,会尝试克隆所有组件的该版本,若某些组件没有该版本,则克隆其最新版本 +- `[global version]` 若指定了该参数,会尝试克隆指定版本的所有组件,若某些组件没有指定的版本,则克隆其最新版本 ## 选项 ### -f, --full(boolean,默认 false) -是否克隆整个镜像,指定该选项后会完整从目标镜像克隆所有组件的所有版本,此时其他选项的指定与否将没有意义。 +是否克隆整个镜像,指定该选项后会完整从目标镜像克隆所有组件的所有版本,此时其他指定的选项将失效。 ### -a, --arch(strings,默认 amd64,arm64) @@ -38,4 +38,4 @@ tiup mirror clone [global version] [flags] ### --{component}(strings,默认为空) -指定要克隆的 `{component}` 组件的版本列表, `{component}` 为组件名,可选的组件名可执行 [tiup list --all](/tiup/tiup-command-list.md) 查看。 \ No newline at end of file +指定要克隆的 `{component}` 组件的版本列表, `{component}` 为组件名,可选的组件名可执行 [tiup list --all](/tiup/tiup-command-list.md) 查看。 diff --git a/tiup/tiup-command-mirror-grant.md b/tiup/tiup-command-mirror-grant.md index a4b88ae51953..f44199cdf04f 100644 --- a/tiup/tiup-command-mirror-grant.md +++ b/tiup/tiup-command-mirror-grant.md @@ -9,7 +9,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-grant/'] 命令 `tiup mirror grant` 用来向当前镜像中引入一个组件管理员。 -组件管理员可以使用其密钥发布新的组件,也可以对其之前发布的组件作出修改,添加组件管理员时,该组件管理员需要先将其公钥发送给镜像管理员,镜像管理员使用此命令将其加入。 +组件管理员可以使用其密钥发布新的组件,也可以对其之前发布的组件作出修改,添加组件管理员时,该组件管理员需要先将其公钥发送给镜像管理员。 > **使用限制:** > @@ -39,4 +39,4 @@ tiup mirror grant [flags] - 若执行成功:无输出 - 若管理员 ID 重复:`Error: owner %s exists` -- 若密钥已被其他管理员使用:`Error: key %s exists` \ No newline at end of file +- 若密钥已被其他管理员使用:`Error: key %s exists` diff --git a/tiup/tiup-command-mirror-init.md b/tiup/tiup-command-mirror-init.md index 23004fe86f17..be06de0aa170 100644 --- a/tiup/tiup-command-mirror-init.md +++ b/tiup/tiup-command-mirror-init.md @@ -30,7 +30,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-init/'] tiup mirror init [flags] ``` -`` 为本地目录路径,可以为相对路径,TiUP 会以该路径为 mirror-dir,在其中生成文件,若该目录已存在,则必须为空,若该目录不存在,则 TiUP 会自动创建。 +`` 为本地目录路径,可以为相对路径,TiUP 会以次路径做为 mirror-dir,在其中生成文件,若该目录已存在,则必须保证为空,若该目录不存在,则 TiUP 会自动创建。 ## 选项 @@ -42,4 +42,4 @@ tiup mirror init [flags] - 若成功:无输出 - 若 `` 不为空:`Error: the target path '%s' is not an empty directory` -- 若 `` 不是目录:`Error: fdopendir: not a directory` \ No newline at end of file +- 若 `` 不是目录:`Error: fdopendir: not a directory` diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md index 306dad35ae62..9a070359d445 100644 --- a/tiup/tiup-command-mirror-rotate.md +++ b/tiup/tiup-command-mirror-rotate.md @@ -46,7 +46,7 @@ TiUP 使用命令 `tiup mirror rotate` 来自动化以上流程。 tiup mirror rotate [flags] ``` -该命令会启动一个编辑器,修改其内容为目标值(比如将 expires 字段的值向后推移),然后需要将 version 字段加一,保存。保存之后会启动一个临时的 http 服务器,等待 N 个 不同的镜像管理员签名。 +该命令会启动一个编辑器,修改其内容为目标值(比如将 expires 字段的值向后推移),然后需要将 version 字段加一并保存。保存之后会启动一个临时的 http 服务器,等待 N 个不同的镜像管理员签名。 镜像管理员签名的方式参考[sign 命令](/tiup/tiup-command-mirror-sign.md)。 @@ -58,4 +58,4 @@ tiup mirror rotate [flags] ## 输出 -- 各个镜像管理员当前的签名状态 \ No newline at end of file +- 各个镜像管理员当前的签名状态 diff --git a/tiup/tiup-component-cluster-clean.md b/tiup/tiup-component-cluster-clean.md index 61d693b9d527..de8fe83c8bf5 100644 --- a/tiup/tiup-component-cluster-clean.md +++ b/tiup/tiup-component-cluster-clean.md @@ -7,7 +7,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-component-cluster-clean/'] ## 介绍 -在测试环境中,有时候需要将集群重置回刚部署的状态,即删除所有数据,命令 `tiup cluster clean` 可以很方便的做到这一点:它会停止集群,然后删除集群上的数据,额外重启集群之后,就能得到一个全新的集群了。 +在测试环境中,有时候需要将集群重置回刚部署的状态,即删除所有数据,命令 `tiup cluster clean` 可以很方便的做到这一点:它会停止集群,然后删除集群上的数据。手工重启集群之后,就能得到一个全新的集群了。 > **注意:** > @@ -52,4 +52,4 @@ tiup cluster clean [flags] ## 输出 -tiup-cluster 的执行日志。 \ No newline at end of file +tiup-cluster 的执行日志。 diff --git a/tiup/tiup-documentation-guide.md b/tiup/tiup-documentation-guide.md index 58c764c28ca5..b1f3fbcb6003 100644 --- a/tiup/tiup-documentation-guide.md +++ b/tiup/tiup-documentation-guide.md @@ -3,7 +3,7 @@ title: TiUP 文档指南 aliases: ['/docs-cn/dev/tiup/tiup-documentation-guide/'] --- -# TiUP 文档指南 +# TiUP 文档地图 ## 使用文档 From ecb7df42e56e4511c66359009455a2ed31aab858 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Thu, 21 Jan 2021 14:38:43 +0800 Subject: [PATCH 24/56] Apply suggestions from code review Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- production-deployment-using-tiup.md | 2 +- tiup/tiup-command-clean.md | 4 ++-- tiup/tiup-component-dm-upgrade.md | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index 690559138d7d..e0f7cb0a45d8 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -5,7 +5,7 @@ aliases: ['/docs-cn/dev/production-deployment-using-tiup/','/docs-cn/dev/how-to/ # 使用 TiUP 部署 TiDB 集群 -[TiUP](https://github.com/pingcap/tiup) 是 TiDB 4.0 版本引入的集群运维工具,[TiUP cluster](https://github.com/pingcap/tiup/tree/master/components/cluster) 是 TiUP 提供的使用 Golang 编写的集群管理组件,通过 TiUP cluster 组件就可以进行日常的运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 TiDB 集群、管理 TiDB 集群参数。 +[TiUP](https://github.com/pingcap/tiup) 是 TiDB 4.0 版本引入的集群运维工具,[TiUP cluster](https://github.com/pingcap/tiup/tree/master/components/cluster) 是 TiUP 提供的使用 Golang 编写的集群管理组件,通过 TiUP cluster 组件就可以进行日常的运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 TiDB 集群,以及管理 TiDB 集群参数。 目前 TiUP 可以支持部署 TiDB、TiFlash、TiDB Binlog、TiCDC,以及监控系统。本文将介绍不同集群拓扑的具体部署步骤。 diff --git a/tiup/tiup-command-clean.md b/tiup/tiup-command-clean.md index b3fc69127924..ed768e02aca1 100644 --- a/tiup/tiup-command-clean.md +++ b/tiup/tiup-command-clean.md @@ -4,7 +4,7 @@ title: tiup clean # tiup clean -命令 `tiup clean` 用于清除组件运行过程中产生的数据 +命令 `tiup clean` 用于清除组件运行过程中产生的数据。 ## 语法 @@ -22,4 +22,4 @@ tiup clean [name] [flags] ## 输出 -Clean instance of `%s`, directory: %s \ No newline at end of file +Clean instance of `%s`, directory: %s diff --git a/tiup/tiup-component-dm-upgrade.md b/tiup/tiup-component-dm-upgrade.md index 9b255e9f628c..6e1b598c5217 100644 --- a/tiup/tiup-component-dm-upgrade.md +++ b/tiup/tiup-component-dm-upgrade.md @@ -1,6 +1,5 @@ --- title: tiup dm upgrade -aliases: ['/docs-cn/dev/tiup/tiup-component-dm-upgrade/'] --- # tiup dm upgrade @@ -24,4 +23,4 @@ tiup dm upgrade [flags] ## 输出 -升级服务的日志。 \ No newline at end of file +升级服务的日志。 From 85c60ee935818388b344e2deacda489a63e361c5 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Fri, 22 Jan 2021 12:22:49 +0800 Subject: [PATCH 25/56] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- tiup/tiup-command-list.md | 2 +- tiup/tiup-command-mirror-genkey.md | 4 ++-- tiup/tiup-command-mirror-modify.md | 4 ++-- tiup/tiup-command-mirror-publish.md | 4 ++-- tiup/tiup-command-mirror-rotate.md | 4 ++-- tiup/tiup-command-update.md | 6 +++--- tiup/tiup-component-cluster-deploy.md | 6 +++--- tiup/tiup-component-cluster-edit-config.md | 6 +++--- tiup/tiup-component-cluster-help.md | 4 ++-- tiup/tiup-component-cluster-scale-in.md | 4 ++-- tiup/tiup-component-cluster-scale-out.md | 4 ++-- tiup/tiup-component-dm-display.md | 6 +++--- tiup/tiup-component-dm-patch.md | 4 ++-- 13 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tiup/tiup-command-list.md b/tiup/tiup-command-list.md index aedd5fb67c47..652c239be0ce 100644 --- a/tiup/tiup-command-list.md +++ b/tiup/tiup-command-list.md @@ -31,7 +31,7 @@ tiup list [component] [flags] ## 输出 - 若未指定 `[component]` - - 若指定 --verbose:输出 `组件名(Name)`,`已安装版本(Installed)`, `组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 + - 若指定 --verbose:输出 `组件名(Name)`,`已安装版本(Installed)`,`组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 - 若不指定 --verbose:输出 `组件名(Name)`,`组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 - 若指定 `[component]` - 若 `[component]` 存在:输出 `版本(Version)`,`是否已安装(Installed)`,`发布时间(Release)`,`支持的平台(Platforms)` 构成的版本信息列表 diff --git a/tiup/tiup-command-mirror-genkey.md b/tiup/tiup-command-mirror-genkey.md index 1f387f3c53af..cc93e76d27ed 100644 --- a/tiup/tiup-command-mirror-genkey.md +++ b/tiup/tiup-command-mirror-genkey.md @@ -12,9 +12,9 @@ title: tiup mirror genkey 由于修改文件需要相关的管理员进行签名,因此管理员必须拥有自己的私钥。命令 `tiup mirror genkey` 就是用于生成私钥的。 -> **最佳实践:** +> **注意:** > -> 永远不要通过网络传输私钥。 +> 请勿通过网络传输私钥。 ## 语法 diff --git a/tiup/tiup-command-mirror-modify.md b/tiup/tiup-command-mirror-modify.md index bb645de8fa95..149f3b7cc371 100644 --- a/tiup/tiup-command-mirror-modify.md +++ b/tiup/tiup-command-mirror-modify.md @@ -4,7 +4,7 @@ title: tiup mirror modify # tiup mirror modify -命令 `tiup mirror modify` 用于修改已发布的组件。只有合法的组件管理员才可以修改组件,且只能修改其自己发布的组件,组件发布方式参考[publish 命令](/tiup/tiup-command-mirror-publish.md)。 +命令 `tiup mirror modify` 用于修改已发布的组件。只有合法的组件管理员才可以修改组件,且只能修改其自己发布的组件,组件发布方式参考 [publish 命令](/tiup/tiup-command-mirror-publish.md)。 ## 语法 @@ -51,4 +51,4 @@ tiup mirror modify [:version] [flags] - 若成功:无输出 - 若该组件管理员无权修改目标组件: - 若使用远程镜像:`Error: The server refused, make sure you have access to this component` - - 若使用本地镜像:`Error: the signature is not correct` \ No newline at end of file + - 若使用本地镜像:`Error: the signature is not correct` diff --git a/tiup/tiup-command-mirror-publish.md b/tiup/tiup-command-mirror-publish.md index cb79ca455131..1ce6fd2ccffa 100644 --- a/tiup/tiup-command-mirror-publish.md +++ b/tiup/tiup-command-mirror-publish.md @@ -4,7 +4,7 @@ title: tiup mirror publish # tiup mirror publish -命令 `tiup mirror publish` 用于发布新组件,或已有组件的新版本。只有合法的组件管理员才可以发布组件,组件管理员的引入方式参考[grant 命令](/tiup/tiup-command-mirror-grant.md)。 +命令 `tiup mirror publish` 用于发布新组件,或已有组件的新版本。只有合法的组件管理员才可以发布组件,组件管理员的引入方式参考 [grant 命令](/tiup/tiup-command-mirror-grant.md)。 ## 语法 @@ -66,4 +66,4 @@ tiup mirror publish [flags] - 若成功:无输出 - 若该组件管理员无权修改目标组件: - 若使用远程镜像:`Error: The server refused, make sure you have access to this component` - - 若使用本地镜像:`Error: the signature is not correct` \ No newline at end of file + - 若使用本地镜像:`Error: the signature is not correct` diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md index e8e4f62c2505..984ae81acabd 100644 --- a/tiup/tiup-command-mirror-rotate.md +++ b/tiup/tiup-command-mirror-rotate.md @@ -34,8 +34,8 @@ TiUP 使用命令 `tiup mirror rotate` 来自动化以上流程。 > **注意:** > -> 经测试,[小于 TiUP v1.3.0 的版本无法正确获得新的 root.json](https://github.com/pingcap/tiup/issues/983)。 -> 使用此功能前请确保所有的 TiUP 客户端升级到了 v1.3.0 及其以上版本。 +> + 经测试,小于 TiUP v1.3.0 的版本无法正确获得新的 root.json [#983](https://github.com/pingcap/tiup/issues/983)。 +> + 使用此功能前请确保所有的 TiUP 客户端升级到了 v1.3.0 及其以上版本。 ## 语法 diff --git a/tiup/tiup-command-update.md b/tiup/tiup-command-update.md index 2b4dae36cd55..d0399c74b4f8 100644 --- a/tiup/tiup-command-update.md +++ b/tiup/tiup-command-update.md @@ -30,13 +30,13 @@ tiup update [component1][:version] [component2..N] [flags] ### --nightly (boolean, 默认 false) -将指定组件升级到 nightly 版本:等价于 `tiup update :nightly`。 +将指定组件升级到 nightly 版本。使用该参数的命令等价于 `tiup update :nightly`。 ### --self (boolean,默认 false) -升级 tiup 自身。 +升级 TiUP 自身。 ## 输出 - 升级成功:`Updated successfully!` -- 目标版本不存在:`Error: version %s not supported by component %s` \ No newline at end of file +- 目标版本不存在:`Error: version %s not supported by component %s` diff --git a/tiup/tiup-component-cluster-deploy.md b/tiup/tiup-component-cluster-deploy.md index dee6ffe11862..9dda01aa675e 100644 --- a/tiup/tiup-component-cluster-deploy.md +++ b/tiup/tiup-component-cluster-deploy.md @@ -38,9 +38,9 @@ tiup cluster deploy [flags] ### --no-labels(boolean,默认 false) -当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology-labels.md))。 +当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 Region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 Region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology-labels.md))。 -但是对于测试环境,可能并不在意是否将一个 region 的副本调度到了同一台机器上,这个时候可以使用 `--no-labels` 来绕过检查。 +但是对于测试环境,可能并不在意是否将一个 Region 的副本调度到了同一台机器上,这个时候可以使用 `--no-labels` 来绕过检查。 ### --skip-create-user(boolean,false) @@ -52,4 +52,4 @@ tiup cluster deploy [flags] ## 输出 -部署日志。 \ No newline at end of file +部署日志。 diff --git a/tiup/tiup-component-cluster-edit-config.md b/tiup/tiup-component-cluster-edit-config.md index 0c8135d75e4d..934fcbce1065 100644 --- a/tiup/tiup-component-cluster-edit-config.md +++ b/tiup/tiup-component-cluster-edit-config.md @@ -8,8 +8,8 @@ title: tiup cluster edit-config > **注意:** > -> 1. 修改配置时不能增删机器,增删机器属于[集群扩容](/tiup/tiup-component-cluster-scale-out.md)和[集群缩容](/tiup/tiup-component-cluster-scale-in.md)的功能。 -> 2. 执行完该命令后配置只是在中控机上修改了,要应用配置需要执行 `tiup cluster relaod` 命令来重新加载。 +> + 修改配置时不能增删机器,增删机器属于[集群扩容](/tiup/tiup-component-cluster-scale-out.md)和[集群缩容](/tiup/tiup-component-cluster-scale-in.md)的功能。 +> + 执行完该命令后配置只是在中控机上修改了,要应用配置需要执行 `tiup cluster relaod` 命令来重新加载。 ## 语法 @@ -28,4 +28,4 @@ tiup cluster edit-config [flags] ## 输出 - 正常情况无输出 -- 若修改了不能修改的字段,则保存文件时报错并提示用户重新编辑,不能修改的字段参考[拓扑文件](/tiup/tiup-cluster-topology-reference.md)中的相关描述 \ No newline at end of file +- 若修改了不能修改的字段,则保存文件时报错并提示用户重新编辑,不能修改的字段参考[拓扑文件](/tiup/tiup-cluster-topology-reference.md)中的相关描述 diff --git a/tiup/tiup-component-cluster-help.md b/tiup/tiup-component-cluster-help.md index a7e390408d54..519e6bddf6ba 100644 --- a/tiup/tiup-component-cluster-help.md +++ b/tiup/tiup-component-cluster-help.md @@ -4,7 +4,7 @@ title: tiup cluster help # tiup cluster help -tiup-cluster 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得。基本上,`tiup cluster help ` 等价于 `tiup cluster --help`。 +tiup-cluster 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得。`tiup cluster help ` 基本等价于 `tiup cluster --help`。 ## 语法 @@ -20,4 +20,4 @@ tiup cluster help [command] [flags] ## 输出 -`[command]` 或 tiup-cluster 的帮助信息。 \ No newline at end of file +`[command]` 或 tiup-cluster 的帮助信息。 diff --git a/tiup/tiup-component-cluster-scale-in.md b/tiup/tiup-component-cluster-scale-in.md index 1afe46568213..dc3f37a0306f 100644 --- a/tiup/tiup-component-cluster-scale-in.md +++ b/tiup/tiup-component-cluster-scale-in.md @@ -8,7 +8,7 @@ title: tiup cluster scale-in 由于 TiKV,TiFlash 和 TiDB Binlog 组件的下线是异步的(需要先通过 API 执行移除操作)并且下线过程耗时较长(需要持续观察节点是否已经下线成功),所以对 TiKV,TiFlash 和 TiDB Binlog 组件做了特殊处理: -- 对 TiKV,TiFlash 及 Binlog 组件的操作: +- 对 TiKV,TiFlash 及 TiDB Binlog 组件的操作: - tiup-cluster 通过 API 将其下线后直接退出而不等待下线完成 - 执行 `tiup cluster display` 查看下线节点的状态,等待其状态变为 Tombstone - 执行 `tiup cluster prune` 命令清理 Tombstone 节点,该命令会执行以下操作: @@ -55,4 +55,4 @@ tiup cluster scale-in [flags] ## 输出 -缩容日志 \ No newline at end of file +缩容日志 diff --git a/tiup/tiup-component-cluster-scale-out.md b/tiup/tiup-component-cluster-scale-out.md index 1a83f6f1bc03..cb31f6299e91 100644 --- a/tiup/tiup-component-cluster-scale-out.md +++ b/tiup/tiup-component-cluster-scale-out.md @@ -31,7 +31,7 @@ tiup cluster scale-out [flags] ### --no-labels(boolean,默认 false) -当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology-labels.md))。 +当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 Region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology-labels.md))。 但是对于测试环境,可能并不在意是否将一个 region 的副本调度到了同一台机器上,这个时候可以使用 `--no-labels` 来绕过检查。 @@ -45,4 +45,4 @@ tiup cluster scale-out [flags] ## 输出 -扩容日志 \ No newline at end of file +扩容日志 diff --git a/tiup/tiup-component-dm-display.md b/tiup/tiup-component-dm-display.md index 5e87c4236a1b..db1036cc93c9 100644 --- a/tiup/tiup-component-dm-display.md +++ b/tiup/tiup-component-dm-display.md @@ -42,11 +42,11 @@ tiup dm display [flags] - 集群版本 - SSH 客户端类型 - 含有以下字段的表格: - - ID:节点 ID,由 IP:PORT 构成 - - Role:该节点部署的服务角色(如 tidb, tikv 等) + - ID:节点 ID,由 IP:PORT 构成 + - Role:该节点部署的服务角色(如 TiDB 和 TiKV 等) - Host:该节点对应的机器 IP - Ports:服务占用的端口号 - OS/Arch:该节点的操作系统和机器架构 - Status:该节点服务当前的状态 - Data Dir:服务的数据目录,`-` 表示没有数据目录 - - Deploy Dir:服务的部署目录 \ No newline at end of file + - Deploy Dir:服务的部署目录 diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index d6dd3d3023df..ddb4239e51ed 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -33,7 +33,7 @@ tiup dm patch [flags] ### --overwrite(boolean,默认 false) -对某个组件(比如 TiDB,TiKV)进行 patch 之后,会涉及到一个问题:以后在该集群扩容该组件时,是用原来的版本,还是用 patch 之后的二进制包?tiup-dm 默认会用原来的版本,如果希望后续扩容的时候也使用 patch 之后的版本的话,就需要指定 `--overwrite` 选项。 +对某个组件(比如 TiDB,TiKV)进行 patch 之后,该集群扩容该组件时,tiup-dm 默认会用原来的版本。如果希望后续扩容的时候也使用 patch 之后的版本的话,就需要指定 `--overwrite` 选项。 ### -N, --node(strings,默认为 [],未选中任何节点) @@ -57,4 +57,4 @@ tiup dm patch [flags] ## 输出 -tiup-dm 的执行日志。 \ No newline at end of file +tiup-dm 的执行日志。 From c9fde0c1e35e077f769b69c58e99a9d8ad19fa40 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Fri, 22 Jan 2021 14:24:08 +0800 Subject: [PATCH 26/56] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- tiup/tiup-command-mirror-merge.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tiup/tiup-command-mirror-merge.md b/tiup/tiup-command-mirror-merge.md index 2ff412639a57..d71e1cb13571 100644 --- a/tiup/tiup-command-mirror-merge.md +++ b/tiup/tiup-command-mirror-merge.md @@ -9,7 +9,7 @@ title: tiup mirror merge 执行此命令需要满足几个条件: - 目标镜像的所有组件的管理员 ID 必须在当前镜像中存在 -- 执行该命令的用户的 `${TIUP_HOME}/keys` 目录中有上述管理员 ID 在当前镜像中对应的所有的私钥(可以使用命令 [tiup mirror set](/tiup/tiup-command-mirror-set.md) 将当前镜像切换成目前有权限修改的镜像) +- 执行该命令用户的 `${TIUP_HOME}/keys` 目录中有上述管理员 ID 在当前镜像中对应的所有私钥(可以使用命令 [tiup mirror set](/tiup/tiup-command-mirror-set.md) 将当前镜像切换成目前有权限修改的镜像) ## 语法 @@ -27,4 +27,4 @@ tiup mirror merge [mirror-dir-N] [flags] ## 输出 - 成功:无输出 -- 当前镜像缺失目标镜像某个组件的管理员,或 `${TIUP_HOME}/keys` 缺失该管理员的私钥:`Error: missing owner keys for owner %s on component %s` \ No newline at end of file +- 当前镜像缺失目标镜像某个组件的管理员,或 `${TIUP_HOME}/keys` 缺失该管理员的私钥:`Error: missing owner keys for owner %s on component %s` From cf58861802666a6531cfe4dd838359ce480fd47f Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Fri, 22 Jan 2021 14:37:22 +0800 Subject: [PATCH 27/56] Apply suggestions from code review Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- tiup/tiup-cluster-topology-reference.md | 10 +++++----- tiup/tiup-dm-topology-reference.md | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index 1f8047ef10bf..f7c1e8b310c4 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -1,16 +1,16 @@ --- -title: tiup cluster topology reference +title: 通过 TiUP 部署 TiDB 集群的拓扑文件配置 --- -# tiup cluster topology reference +# 通过 TiUP 部署 TiDB 集群的拓扑文件配置 -在部署或扩容 TiDB 集群时,需要提供一份拓扑文件来描述集群拓扑,同样,修改配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。 +通过 TiUP 部署或扩容 TiDB 集群时,需要提供一份拓扑文件([示例](https://github.com/pingcap/tiup/blob/master/examples/topology.example.yaml))来描述集群拓扑。 -拓扑文件[示例参考](https://github.com/pingcap/tiup/blob/master/examples/topology.example.yaml)。 +同样,修改集群配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。 ## 文件结构 -一个 TiDB 集群的拓扑文件可能包含以下区块: +一个通过 TiUP 部署的 TiDB 集群拓扑文件可能包含以下区块: - [global](/tiup/tiup-cluster-topology-reference.md#global):集群全局配置,其中一些是集群的默认值,可以在实例里面单独配置 - [monitored](/tiup/tiup-cluster-topology-reference.md#monitored):监控服务配置,即 blackbox exporter 和 node exporter,每台机器上都会部署一个 node exporter 一个 blackbox exporter diff --git a/tiup/tiup-dm-topology-reference.md b/tiup/tiup-dm-topology-reference.md index 4cf679bbe4eb..4f5e7db4a552 100644 --- a/tiup/tiup-dm-topology-reference.md +++ b/tiup/tiup-dm-topology-reference.md @@ -1,8 +1,8 @@ --- -title: tiup dm topology reference +title: 通过 TiUP 部署 DM 集群的拓扑文件配置 --- -# tiup dm topology reference +# 通过 TiUP 部署 DM 集群的拓扑文件配置 在部署或扩容 DM 集群时,需要提供一份拓扑文件来描述集群拓扑,同样,修改配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。 @@ -290,4 +290,4 @@ alertmanager_servers: config_file: /local/config/file - host: 10.0.1.12 config_file: /local/config/file -``` \ No newline at end of file +``` From 3465363025342fe4d8a9349d720a015bb40c9a10 Mon Sep 17 00:00:00 2001 From: lucklove Date: Fri, 22 Jan 2021 14:57:14 +0800 Subject: [PATCH 28/56] Address comment --- tiup/tiup-command-mirror-grant.md | 2 +- tiup/tiup-command-mirror-sign.md | 2 +- tiup/tiup-command-status.md | 2 +- tiup/tiup-mirror-reference.md | 18 +++++++++--------- tiup/tiup-reference.md | 6 ++++-- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/tiup/tiup-command-mirror-grant.md b/tiup/tiup-command-mirror-grant.md index 5cd4a5e553d7..62de3aa5af17 100644 --- a/tiup/tiup-command-mirror-grant.md +++ b/tiup/tiup-command-mirror-grant.md @@ -8,7 +8,7 @@ title: tiup mirror grant 组件管理员可以使用其密钥发布新的组件,也可以对其之前发布的组件作出修改,添加组件管理员时,该组件管理员需要先将其公钥发送给镜像管理员。 -> **使用限制:** +> **注意** > > 该命令仅支持在当前镜像为本地镜像时使用。 diff --git a/tiup/tiup-command-mirror-sign.md b/tiup/tiup-command-mirror-sign.md index 8308ca18ef9a..940beb985d7c 100644 --- a/tiup/tiup-command-mirror-sign.md +++ b/tiup/tiup-command-mirror-sign.md @@ -32,7 +32,7 @@ tiup mirror sign [flags] 通过网络签名时网络的访问超时时间,单位为秒。 -> **使用限制:** +> **注意** > > 只有当 `` 为网络地址时该选项有效。 diff --git a/tiup/tiup-command-status.md b/tiup/tiup-command-status.md index 27e60c8e4d9e..ddc5e23b4094 100644 --- a/tiup/tiup-command-status.md +++ b/tiup/tiup-command-status.md @@ -6,7 +6,7 @@ title: tiup status 命令 `tiup status` 查看组件运行信息:通过 `tiup [flags] [args...]` 运行组件之后,可以通过该命令查看组件的运行信息。 -> **使用限制:** +> **注意** > > 只能查询到以下两种组件的信息: > diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index 415b08ec6f3e..aedec889d803 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -299,13 +299,13 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 客户端通过以下逻辑保证从镜像下载到的文件是安全的: -- 客户端安装时随 binary 附带了一个 root.json -- 客户端运行时以已有的 root.json 为基础,做如下操作: - 1. 获取 root.json 中的 version,记为 N - 2. 向镜像请求 {N+1}.root.json,若成功,使用 root.json 中记录的公钥验证该文件是否合法 -- 向镜像请求 timestamp.json,并使用 root.json 中记录的公钥验证该文件是否合法 -- 检查 timestamp.json 中记录的 snapshot.json 的 checksum 和本地的 snapshot.json 的 checksum 是否吻合 +1. 客户端安装时随 binary 附带了一个 root.json +2. 客户端运行时以已有的 root.json 为基础,做如下操作: + a. 获取 root.json 中的 version,记为 N + b. 向镜像请求 {N+1}.root.json,若成功,使用 root.json 中记录的公钥验证该文件是否合法 +3. 向镜像请求 timestamp.json,并使用 root.json 中记录的公钥验证该文件是否合法 +4. 检查 timestamp.json 中记录的 snapshot.json 的 checksum 和本地的 snapshot.json 的 checksum 是否吻合 - 若不吻合,则向镜像请求最新的 snapshot.json 并使用 root.json 中记录的公钥验证该文件是否合法 -- 对于 index.json 文件,从 snapshot.json 中获取其版本号 N,并请求 {N}.index.json,然后使用 root.json 中记录的公钥验证该文件是否合法 -- 对于组件(如 tidb.json,tikv.json),从 snapshot.json 中获取其版本号 N,并请求 {N}.{component}.json,然后使用 index.json 中记录的公钥验证该文件是否合法 -- 对于组件 tar 文件,从 {component}.json 中获取其 url 及 checksum,请求 url 得到 tar 包,并验证 checksum 是否正确 \ No newline at end of file +5. 对于 index.json 文件,从 snapshot.json 中获取其版本号 N,并请求 {N}.index.json,然后使用 root.json 中记录的公钥验证该文件是否合法 +6. 对于组件(如 tidb.json,tikv.json),从 snapshot.json 中获取其版本号 N,并请求 {N}.{component}.json,然后使用 index.json 中记录的公钥验证该文件是否合法 +7. 对于组件 tar 文件,从 {component}.json 中获取其 url 及 checksum,请求 url 得到 tar 包,并验证 checksum 是否正确 \ No newline at end of file diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 9ea7050f2f4b..a5351870cc90 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -12,6 +12,8 @@ title: TiUP 参考手册 TiUP 的使用围绕命令,组件,镜像这几个核心概念进行,我们下面先对它们进行定义。 +## 概念 + ### 命令 命令是程序功能的入口,一切功能都被实现在一个命令中,它具有以下特点: @@ -55,7 +57,7 @@ tiup [flags] [args...] # 运行组件 - 执行 `tiup -B/--binary ` 将打印已安装的 `` 组件的最新稳定版路径,若 `` 组件未安装,则报错 - 执行 `tiup -B/--binary :` 将答应已经安装的 `` 组件的 `` 版本所在的路径,若该版本未安装,则报错 -> **使用限制:** +> **注意** > > 该选项只能用于 `tiup [flags] [args...]` 格式的命令。 @@ -63,7 +65,7 @@ tiup [flags] [args...] # 运行组件 指定要执行的组件的路径:执行一个组件时,如果不想使用 TiUP 镜像中的二进制文件,可以使用该参数使用自定义路径的二进制文件替换之。 -> **使用限制:** +> **注意** > > 该选项只能用于 `tiup [flags] [args...]` 格式的命令。 From bb6ca71955996510d0976c2d8bb9ca0d320071ab Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Fri, 29 Jan 2021 15:03:44 +0800 Subject: [PATCH 29/56] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- tiup/tiup-component-dm.md | 4 ++-- tiup/tiup-documentation-guide.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tiup/tiup-component-dm.md b/tiup/tiup-component-dm.md index 3c50c6621545..b9c1f91b5daf 100644 --- a/tiup/tiup-component-dm.md +++ b/tiup/tiup-component-dm.md @@ -46,7 +46,7 @@ tiup dm [command] [flags] ## 命令清单 -- [import](/tiup/tiup-component-dm-import.md):导入 ansible 部署的 1.0 的 DM 集群 +- [import](/tiup/tiup-component-dm-import.md):导入使用 DM-Ansible 部署的 DM v1.0 集群 - [deploy](/tiup/tiup-component-dm-deploy.md):根据指定拓扑部署集群 - [list](/tiup/tiup-component-dm-list.md):查询已部署的集群列表 - [display](/tiup/tiup-component-dm-display.md):展示指定集群状态 @@ -62,4 +62,4 @@ tiup dm [command] [flags] - [patch](/tiup/tiup-component-dm-patch.md):替换已部署集群的某个服务 - [destroy](/tiup/tiup-component-dm-destroy.md):销毁指定集群 - [audit](/tiup/tiup-component-dm-audit.md):查询集群操作审计日志 -- [help](/tiup/tiup-component-dm-help.md):输出帮助信息 \ No newline at end of file +- [help](/tiup/tiup-component-dm-help.md):输出帮助信息 diff --git a/tiup/tiup-documentation-guide.md b/tiup/tiup-documentation-guide.md index fc1ec81dd1a4..29b53da39e8f 100644 --- a/tiup/tiup-documentation-guide.md +++ b/tiup/tiup-documentation-guide.md @@ -12,7 +12,7 @@ aliases: ['/docs-cn/dev/tiup/tiup-documentation-guide/'] - [TiUP 组件管理](/tiup/tiup-component-management.md):详细介绍 TiUP 所有命令,如何使用 TiUP 下载、更新、删除组件 - [TiUP FAQ](/tiup/tiup-faq.md):TiUP 使用过程中的常见问题,包含 TiUP 第三方组件的 FAQ - [TiUP 故障排查](/tiup/tiup-troubleshooting-guide.md):如果在使用 TiUP 过程中遇到问题,可以参考故障排查文档的解决方案 -- [TiUP 参考手册](/tiup/tiup-reference.md):TiUP 详细参考手册 +- [TiUP 参考手册](/tiup/tiup-reference.md):TiUP 详细参考手册,包含各类命令、组件、镜像。 ## 资源 From ef916b9f377afb48b1d6752d954b92413d1561c3 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Fri, 29 Jan 2021 18:55:16 +0800 Subject: [PATCH 30/56] Update tiup/tiup-reference.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- tiup/tiup-reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index a5351870cc90..d858873bd1cd 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -91,7 +91,7 @@ tiup [flags] [args...] # 运行组件 - [install](/tiup/tiup-command-install.md):安装组件 - [list](/tiup/tiup-command-list.md):查看组件列表 -- [uniinstall](/tiup/tiup-command-uninstall.md):卸载组件 +- [uninstall](/tiup/tiup-command-uninstall.md):卸载组件 - [update](/tiup/tiup-command-update.md):升级已安装的组件 - [status](/tiup/tiup-command-status.md):查看组件运行状态 - [clean](/tiup/tiup-command-clean.md):清理组件数据目录 @@ -104,4 +104,4 @@ tiup [flags] [args...] # 运行组件 ## 组件清单 - [cluster](/tiup/tiup-component-cluster.md):生产环境 TiDB 集群管理 -- [dm](/tiup/tiup-component-dm.md):生产环境 DM 集群管理 \ No newline at end of file +- [dm](/tiup/tiup-component-dm.md):生产环境 DM 集群管理 From cb6bced247e2492c1c20e5096a4934b2b06f5c8a Mon Sep 17 00:00:00 2001 From: lucklove Date: Fri, 29 Jan 2021 18:57:12 +0800 Subject: [PATCH 31/56] Address comment --- TOC.md | 1 + tiup/tiup-reference.md | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/TOC.md b/TOC.md index c390bc9b89e8..17d2089c77de 100644 --- a/TOC.md +++ b/TOC.md @@ -497,6 +497,7 @@ + [TiUP 组件管理](/tiup/tiup-component-management.md) + [FAQ](/tiup/tiup-faq.md) + [故障排查](/tiup/tiup-troubleshooting-guide.md) + + [参考手册](/tiup/tiup-reference.md) + TiUP 组件文档 + [tiup-playground 运行本地测试集群](/tiup/tiup-playground.md) + [tiup-cluster 部署运维生产集群](/tiup/tiup-cluster.md) diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index d858873bd1cd..a437ed596c15 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -4,13 +4,7 @@ title: TiUP 参考手册 # TiUP -在各种系统软件和应用软件的安装管理中,包管理器均有着广泛的应用,包管理工具的出现大大简化了软件的安装和升级维护工作。例如,几乎所有使用 RPM 的 Linux 都会使用 Yum 来进行包管理,而 Anaconda 则可以非常方便地管理 python 的环境和相关软件包。 - -在早期的 TiDB 生态中,没有专门的包管理工具,使用者只能通过相应的配置文件和文件夹命名来手动管理,如 Prometheus 等第三方监控报表工具甚至需要额外的特殊管理,这样大大提升了运维管理难度。 - -从 TiDB 4.0 版本开始,TiUP 作为新的工具,承担着包管理器的角色,管理着 TiDB 生态下众多的组件,如 TiDB、PD、TiKV 等。用户想要运行 TiDB 生态中任何组件时,只需要执行 TiUP 一行命令即可,相比以前,极大地降低了管理难度。 - -TiUP 的使用围绕命令,组件,镜像这几个核心概念进行,我们下面先对它们进行定义。 +TiUP 在 TiDB 生态中承担包管理器的功能,它的使用围绕命令,组件,镜像这几个核心概念进行,我们下面先对它们进行定义。 ## 概念 @@ -89,6 +83,8 @@ tiup [flags] [args...] # 运行组件 ## 命令清单 +TiUP 包含众多的命令,这些命令又包含了许多子命令,具体命令及其子命令的说明请参考对应的链接: + - [install](/tiup/tiup-command-install.md):安装组件 - [list](/tiup/tiup-command-list.md):查看组件列表 - [uninstall](/tiup/tiup-command-uninstall.md):卸载组件 From ae9ea1e3f2e4ffdadbc9f963a27ae08371c68088 Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 1 Feb 2021 12:46:21 +0800 Subject: [PATCH 32/56] Address comment --- TOC.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TOC.md b/TOC.md index 17d2089c77de..aa43b641b251 100644 --- a/TOC.md +++ b/TOC.md @@ -498,6 +498,8 @@ + [FAQ](/tiup/tiup-faq.md) + [故障排查](/tiup/tiup-troubleshooting-guide.md) + [参考手册](/tiup/tiup-reference.md) + + [TiDB 集群拓扑文件配置](/tiup/tiup-cluster-topology-reference.md) + + [DM 集群拓扑文件配置](/tiup/tiup-dm-topology-reference.md) + TiUP 组件文档 + [tiup-playground 运行本地测试集群](/tiup/tiup-playground.md) + [tiup-cluster 部署运维生产集群](/tiup/tiup-cluster.md) From 4f935fab8e037a3587ac03fd032be2625760183f Mon Sep 17 00:00:00 2001 From: Keke Yi <40977455+yikeke@users.noreply.github.com> Date: Mon, 1 Feb 2021 13:35:51 +0800 Subject: [PATCH 33/56] Update tiup-command-clean.md --- tiup/tiup-command-clean.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tiup/tiup-command-clean.md b/tiup/tiup-command-clean.md index ed768e02aca1..0845af35cde8 100644 --- a/tiup/tiup-command-clean.md +++ b/tiup/tiup-command-clean.md @@ -22,4 +22,6 @@ tiup clean [name] [flags] ## 输出 +``` Clean instance of `%s`, directory: %s +``` From d7ea451a101c0395bc69971691e2f301a90ded90 Mon Sep 17 00:00:00 2001 From: yikeke Date: Mon, 1 Feb 2021 13:46:41 +0800 Subject: [PATCH 34/56] fix a typo --- tiup/tiup-component-cluster-check.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-component-cluster-check.md b/tiup/tiup-component-cluster-check.md index 85b09797248b..4e856475c5da 100644 --- a/tiup/tiup-component-cluster-check.md +++ b/tiup/tiup-component-cluster-check.md @@ -117,7 +117,7 @@ title: tiup cluster check tiup cluster check [flags] ``` -若集群尚未部署,需要传递将用于部署集群的 [tompology.yml](/tiup/tiup-cluster-topology-reference.md) 文件,tiup-cluster 会根据该文件的内容连接到对应机器去检查。若集群已经部署,则可以使用集群的名字 `` 作为检查对象。 +若集群尚未部署,需要传递将用于部署集群的 [topology.yml](/tiup/tiup-cluster-topology-reference.md) 文件,tiup-cluster 会根据该文件的内容连接到对应机器去检查。若集群已经部署,则可以使用集群的名字 `` 作为检查对象。 > **注意:** > From 258e28f2433a94366bf85e6817e45f8986646950 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Mon, 1 Feb 2021 15:04:29 +0800 Subject: [PATCH 35/56] Apply suggestions from code review Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- tiup/tiup-command-mirror-genkey.md | 2 +- tiup/tiup-command-mirror-rotate.md | 2 +- tiup/tiup-command-mirror-set.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tiup/tiup-command-mirror-genkey.md b/tiup/tiup-command-mirror-genkey.md index cc93e76d27ed..5fad688c432a 100644 --- a/tiup/tiup-command-mirror-genkey.md +++ b/tiup/tiup-command-mirror-genkey.md @@ -12,7 +12,7 @@ title: tiup mirror genkey 由于修改文件需要相关的管理员进行签名,因此管理员必须拥有自己的私钥。命令 `tiup mirror genkey` 就是用于生成私钥的。 -> **注意:** +> **警告:** > > 请勿通过网络传输私钥。 diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md index 984ae81acabd..78b5368f6a5d 100644 --- a/tiup/tiup-command-mirror-rotate.md +++ b/tiup/tiup-command-mirror-rotate.md @@ -6,7 +6,7 @@ title: tiup mirror rotate TiUP 的镜像中有一个非常重要的文件:root.json,里面记录了整个系统需要使用的公钥,是 TiUP 信任链的基础,它的内容主要包含几个部分: -- N 个管理员的签名,对于官方镜像, N 为 5,默认初始化的镜像 N 为 3 +- N 个管理员的签名,对于官方镜像,N 为 5,默认初始化的镜像 N 为 3 - 用于验证以下文件的公钥: - root.json - index.json diff --git a/tiup/tiup-command-mirror-set.md b/tiup/tiup-command-mirror-set.md index f8a2d0cc2df5..5ddd6f43fd95 100644 --- a/tiup/tiup-command-mirror-set.md +++ b/tiup/tiup-command-mirror-set.md @@ -6,7 +6,7 @@ title: tiup mirror set 命令 `tiup mirror set` 用于切换当前镜像,支持本地文件系统和远程网络两种镜像。 -官方镜像为 `https://tiup-mirrors.pingcap.com` +官方镜像为 `https://tiup-mirrors.pingcap.com`。 ## 语法 @@ -41,4 +41,4 @@ tiup mirror set -r /path/to/local/root.json ## 输出 -无 \ No newline at end of file +无 From 2e9c211332de13ca7f9790de6322bef67b0da254 Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 1 Feb 2021 15:24:47 +0800 Subject: [PATCH 36/56] Address comment --- TOC.md | 1 - 1 file changed, 1 deletion(-) diff --git a/TOC.md b/TOC.md index aa43b641b251..138b06b7cda0 100644 --- a/TOC.md +++ b/TOC.md @@ -499,7 +499,6 @@ + [故障排查](/tiup/tiup-troubleshooting-guide.md) + [参考手册](/tiup/tiup-reference.md) + [TiDB 集群拓扑文件配置](/tiup/tiup-cluster-topology-reference.md) - + [DM 集群拓扑文件配置](/tiup/tiup-dm-topology-reference.md) + TiUP 组件文档 + [tiup-playground 运行本地测试集群](/tiup/tiup-playground.md) + [tiup-cluster 部署运维生产集群](/tiup/tiup-cluster.md) From 73b54a96eb56b404c98108bc2fae03427844b8cf Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 1 Feb 2021 15:28:30 +0800 Subject: [PATCH 37/56] Address comment --- tiup/tiup-mirror-reference.md | 4 ++-- tiup/tiup-reference.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index aedec889d803..9109b6561e06 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -1,8 +1,8 @@ --- -title: tiup mirror reference +title: TiUP Mirror Reference --- -# tiup mirror reference +# TiUP Mirror Reference TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件的元信息。镜像有两种存在形式: diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index a437ed596c15..e61c9229586c 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -28,7 +28,7 @@ TiUP 集成了一系列的子命令用于组件管理和镜像管理。 ### 镜像 -镜像是一个组件仓库,它存放了一系列组件,负责在 TiUP 需要某个组件时提供它。 +镜像是一个组件仓库,它存放了一系列组件,负责在 TiUP 需要某个组件时提供它。它的组织形式可以参考 [TiUP Mirror Reference](/tiup/tiup-mirror-reference.md)。 ## 语法 From 5a14917bd8366144766efcfd032067c575369dfe Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Mon, 1 Feb 2021 15:43:31 +0800 Subject: [PATCH 38/56] Apply suggestions from code review Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- tiup/tiup-mirror-reference.md | 4 ++-- tiup/tiup-reference.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index 9109b6561e06..b2653043a53f 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -1,5 +1,5 @@ --- -title: TiUP Mirror Reference +title: TiUP 镜像参考指南 --- # TiUP Mirror Reference @@ -308,4 +308,4 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 - 若不吻合,则向镜像请求最新的 snapshot.json 并使用 root.json 中记录的公钥验证该文件是否合法 5. 对于 index.json 文件,从 snapshot.json 中获取其版本号 N,并请求 {N}.index.json,然后使用 root.json 中记录的公钥验证该文件是否合法 6. 对于组件(如 tidb.json,tikv.json),从 snapshot.json 中获取其版本号 N,并请求 {N}.{component}.json,然后使用 index.json 中记录的公钥验证该文件是否合法 -7. 对于组件 tar 文件,从 {component}.json 中获取其 url 及 checksum,请求 url 得到 tar 包,并验证 checksum 是否正确 \ No newline at end of file +7. 对于组件 tar 文件,从 {component}.json 中获取其 url 及 checksum,请求 url 得到 tar 包,并验证 checksum 是否正确 diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index e61c9229586c..dabb54dcc808 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -28,7 +28,7 @@ TiUP 集成了一系列的子命令用于组件管理和镜像管理。 ### 镜像 -镜像是一个组件仓库,它存放了一系列组件,负责在 TiUP 需要某个组件时提供它。它的组织形式可以参考 [TiUP Mirror Reference](/tiup/tiup-mirror-reference.md)。 +镜像是一个组件仓库,它存放了一系列组件,负责在 TiUP 需要某个组件时提供它。镜像的组织形式可以参考 [TiUP 镜像参考指南](/tiup/tiup-mirror-reference.md)。 ## 语法 From f26f8953231688519884a363764b31adb3718b87 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Mon, 1 Feb 2021 15:45:18 +0800 Subject: [PATCH 39/56] Update tiup/tiup-mirror-reference.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- tiup/tiup-mirror-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index b2653043a53f..516889b99b65 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -2,7 +2,7 @@ title: TiUP 镜像参考指南 --- -# TiUP Mirror Reference +# TiUP 镜像参考指南 TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件的元信息。镜像有两种存在形式: From 6d3a5af56025383824f84513469843005ec8a6db Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 1 Feb 2021 16:27:18 +0800 Subject: [PATCH 40/56] Address comment --- TOC.md | 1 + tiup/tiup-reference.md | 24 ------------------------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/TOC.md b/TOC.md index 138b06b7cda0..1ad4660ef1a7 100644 --- a/TOC.md +++ b/TOC.md @@ -499,6 +499,7 @@ + [故障排查](/tiup/tiup-troubleshooting-guide.md) + [参考手册](/tiup/tiup-reference.md) + [TiDB 集群拓扑文件配置](/tiup/tiup-cluster-topology-reference.md) + + [TiUP 镜像参考指南](/tiup/tiup-mirror-reference.md) + TiUP 组件文档 + [tiup-playground 运行本地测试集群](/tiup/tiup-playground.md) + [tiup-cluster 部署运维生产集群](/tiup/tiup-cluster.md) diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index dabb54dcc808..e0325a6b4ea1 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -6,30 +6,6 @@ title: TiUP 参考手册 TiUP 在 TiDB 生态中承担包管理器的功能,它的使用围绕命令,组件,镜像这几个核心概念进行,我们下面先对它们进行定义。 -## 概念 - -### 命令 - -命令是程序功能的入口,一切功能都被实现在一个命令中,它具有以下特点: - -- 内置于可执行程序 -- 可以带有子命令 -- 可以带有参数及选项(flags) - -TiUP 集成了一系列的子命令用于组件管理和镜像管理。 - -### 组件 - -区别于命令,组件具有以下特点: - -- 动态从镜像中取得 -- 本身是一个或一组二进制程序 -- 有自己的命令及子命令 - -### 镜像 - -镜像是一个组件仓库,它存放了一系列组件,负责在 TiUP 需要某个组件时提供它。镜像的组织形式可以参考 [TiUP 镜像参考指南](/tiup/tiup-mirror-reference.md)。 - ## 语法 ```sh From f1654e81daad668bbf9f223e9ab2557c5f99c556 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Mon, 1 Feb 2021 16:35:57 +0800 Subject: [PATCH 41/56] Apply suggestions from code review Co-authored-by: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> --- tiup/tiup-cluster-topology-reference.md | 80 ++++++++++++------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index f7c1e8b310c4..24dcefeeea9d 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -13,7 +13,7 @@ title: 通过 TiUP 部署 TiDB 集群的拓扑文件配置 一个通过 TiUP 部署的 TiDB 集群拓扑文件可能包含以下区块: - [global](/tiup/tiup-cluster-topology-reference.md#global):集群全局配置,其中一些是集群的默认值,可以在实例里面单独配置 -- [monitored](/tiup/tiup-cluster-topology-reference.md#monitored):监控服务配置,即 blackbox exporter 和 node exporter,每台机器上都会部署一个 node exporter 一个 blackbox exporter +- [monitored](/tiup/tiup-cluster-topology-reference.md#monitored):监控服务配置,即 blackbox exporter 和 node exporter,每台机器上都会部署一个 node exporter 和一个 blackbox exporter - [server_configs](/tiup/tiup-cluster-topology-reference.md#server_configs):组件全局配置,可单独针对每个组件配置,若在实例中存在同名配置项,那么以实例中配置的为准 - [pd_servers](/tiup/tiup-cluster-topology-reference.md#pd_servers):PD 实例的配置,用来指定 PD 组件部署到哪些机器上 - [tidb_servers](/tiup/tiup-cluster-topology-reference.md#tidb_servers): TiDB 实例的配置,用来指定 TiDB 组件部署到哪些机器上 @@ -36,22 +36,22 @@ title: 通过 TiUP 部署 TiDB 集群的拓扑文件配置 - `group`:自动创建用户时指定用户所属的用户组,默认和 `` 字段值相同,若指定的组不存在,则自动创建 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,默认值:22 - `enable_tls`:是否对集群启用 TLS,启用之后组件之间、客户端与组件之间都必须使用生成的 TLS 证书链接,**启用后无法关闭**,默认值:false -- `deploy_dir`:每个组件的部署目录,默认值:"deploy",其应用规则如下: +- `deploy_dir`:每个组件的部署目录,默认值:"deploy"。其应用规则如下: - 如果在实例级别配置了绝对路径的 `deploy_dir`,那么实际部署目录为该实例设定的 `deploy_dir` - 对于每个实例,如果用户未配置 `deploy_dir`,其默认值为相对路径 `-` - 如果 `global.deploy_dir` 为绝对路径,那么组件会部署到 `/` 目录 - 如果 `global.deploy_dir` 为相对路径,那么组件会部署到 `/home///` 目录 -- `data_dir`:数据目录, 默认值:"data",其应用规则如下: +- `data_dir`:数据目录, 默认值:"data"。其应用规则如下: - 如果在实例级别配置了绝对路径的 `data_dir`,那么实际数据目录为该实例设定的 `data_dir` - 对于每个实例,如果用户未配置 `data_dir`,其默认值为 `` - 如果 `data_dir` 为相对路径,那么组件数据将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 -- `log_dir`:数据目录, 默认值:"log",其应用规则如下: +- `log_dir`:数据目录, 默认值:"log"。其应用规则如下: - 如果在实例级别配置了绝对路径的 `log_dir`,那么实际日志目录为该实例设定的 `log_dir` - 对于每个实例,如果用户未配置 `log_dir`,其默认值为 `` - 如果 `log_dir` 为相对路径,那么组件日志将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 - `os`:目标机器的操作系统,该字段决定了向目标机器推送适配哪个操作系统的组件,默认值:linux - `arch`:目标机器的 CPU 架构,该字段决定了向目标机器推送哪个平台的二进制包,支持 amd64 和 arm64,默认值:amd64 -- `resource_control`:运行时资源控制,该字段下所有配置都将写入 systemd 的 service 文件中,默认不限制,支持控制的资源: +- `resource_control`:运行时资源控制,该字段下所有配置都将写入 systemd 的 service 文件中,默认无限制。支持控制的资源如下: - `memory_limit`: 限制运行时最大内存,例如 "2G" 表示最多使用 2GB 内存 - `cpu_quota`:限制运行时最大 CPU 占用率,例如 "200%" - `io_read_bandwidth_max`:读磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" @@ -71,9 +71,9 @@ global: ### `monitored` -`monitored` 用于配置目标机上的监控服务:[node_exporter](https://github.com/prometheus/node_exporter) 和 [blackbox_exporter](https://github.com/prometheus/blackbox_exporter),它包含这些字段: +`monitored` 用于配置目标机上的监控服务:[node_exporter](https://github.com/prometheus/node_exporter) 和 [blackbox_exporter](https://github.com/prometheus/blackbox_exporter)。包含以下字段: -- `node_exporter_port`: node_exporter 的服务端口,默认值:9100 +- `node_exporter_port`:node_exporter 的服务端口,默认值:9100 - `blackbox_exporter_port`:blackbox_exporter 的服务端口,默认值:9115 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 @@ -93,14 +93,14 @@ monitored: `server_configs` 用于配置服务,生成各组件的配置文件,类似 global 区块,该区块内的配置可以在具体的实例中被覆盖。主要包含以下字段: -- `tidb`:TiDB 服务的相关配置,支持的完整配置请参考[TiDB 配置文件描述](/tidb-configuration-file.md) -- `tikv`:TiKV 服务的相关配置,支持的完整配置请参考[TiKV 配置文件描述](/tikv-configuration-file.md) -- `pd`:PD 服务的相关配置,支持的完整配置请参考[PD 配置文件描述](/pd-configuration-file.md) -- `tiflash`:TiFlash 服务的相关配置,支持的完整配置请参考[TiFlash 配置参数](/tiflash/tiflash-configuration.md) +- `tidb`:TiDB 服务的相关配置,支持的完整配置请参考 [TiDB 配置文件描述](/tidb-configuration-file.md) +- `tikv`:TiKV 服务的相关配置,支持的完整配置请参考 [TiKV 配置文件描述](/tikv-configuration-file.md) +- `pd`:PD 服务的相关配置,支持的完整配置请参考 [PD 配置文件描述](/pd-configuration-file.md) +- `tiflash`:TiFlash 服务的相关配置,支持的完整配置请参考 [TiFlash 配置参数](/tiflash/tiflash-configuration.md) - `tiflash_learner`:每个 TiFlash 中内置了一个特殊的 TiKV,该配置项用于配置这个特殊的 TiKV,一般不建议修改这个配置项下的内容 -- `pump`:Pump 服务的相关配置,支持的完整配置请参考[TiDB Binlog 配置说明](/tidb-binlog/tidb-binlog-configuration-file.md#pump) -- `drainer`:Drainer 服务的相关配置,支持的完整配置请参考[TiDB Binlog 配置说明](/tidb-binlog/tidb-binlog-configuration-file.md#drainer) -- `cdc`:CDC 服务的相关配置,支持的完整配置请参考[TiCDC 安装部署](/ticdc/deploy-ticdc.md) +- `pump`:Pump 服务的相关配置,支持的完整配置请参考 [TiDB Binlog 配置说明](/tidb-binlog/tidb-binlog-configuration-file.md#pump) +- `drainer`:Drainer 服务的相关配置,支持的完整配置请参考 [TiDB Binlog 配置说明](/tidb-binlog/tidb-binlog-configuration-file.md#drainer) +- `cdc`:CDC 服务的相关配置,支持的完整配置请参考 [TiCDC 安装部署](/ticdc/deploy-ticdc.md) `server_configs` 配置示例: @@ -120,24 +120,24 @@ server_configs: ### `pd_servers` -`pd_servers` 约定了将 PD 的服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: +`pd_servers` 约定了将 PD 的服务部署到哪些机器上,同时可以指定每台机器上的服务配置。`pd_servers` 是一个数组,每个数组的元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` - `name`:指定该 PD 实例的名字,不同实例的名字必须唯一,否则无法部署 -- `client_port`:指定 PD 的客户端连接端口,默认是 2379 -- `peer_port`:指定 PD 之间互相通信的端口,默认是 2380 +- `client_port`:指定 PD 的客户端连接端口,默认值:2379 +- `peer_port`:指定 PD 之间互相通信的端口,默认值:2380 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl)。在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" - `config`:该字段配置规则和 `server_configs` 里的 `pd` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `pd` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制。如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `listen_host` @@ -165,22 +165,22 @@ pd_servers: ### `tidb_servers` -`tidb_servers` 约定了将 TiDB 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: +`tidb_servers` 约定了将 TiDB 服务部署到哪些机器上,同时可以指定每台机器上的服务配置。`tidb_servers` 是一个数组,每个数组的元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` -- `port`:TiDB 服务的监听端口,用于提供给 MySQL 客户端连接,默认 4000 -- `status_port`:TiDB 状态服务的监听端口,用于外部通过 http 请求查看 TiDB 服务的状态,默认 10080 +- `port`:TiDB 服务的监听端口,用于提供给 MySQL 客户端连接,默认值:4000 +- `status_port`:TiDB 状态服务的监听端口,用于外部通过 http 请求查看 TiDB 服务的状态,默认值:10080 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" - `config`:该字段配置规则和 `server_configs` 里的 `tidb` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tidb` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 -- `os`:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 global 中的 os -- `arch`:host 字段所指定的机器的架构,若不指定该字段,则默认为 global 中的 arch +- `os`:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` +- `arch`:host 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `listen_host` @@ -204,23 +204,23 @@ tidb_servers: ### `tikv_servers` -`tikv_servers` 约定了将 TiKV 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`tikv_servers` 约定了将 TiKV 服务部署到哪些机器上,同时可以指定每台机器上的服务配置。`tikv_servers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` -- `port`:TiKV 服务的监听端口,默认 20160 -- `status_port`:TiKV 状态服务的监听端口,默认 20180 +- `port`:TiKV 服务的监听端口,默认值:20160 +- `status_port`:TiKV 状态服务的监听端口,默认值:20180 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" - `config`:该字段配置规则和 server_configs 里的 tikv 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tikv` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 - `os`:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:host 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `listen_host` @@ -246,9 +246,9 @@ tikv_servers: ### `tiflash_servers` -`tiflash_servers` 约定了将 TiFlash 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`tiflash_servers` 约定了将 TiFlash 服务部署到哪些机器上,同时可以指定每台机器上的服务配置。该区块是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 ssh_port - `tcp_port`:TiFlash TCP 服务的端口,默认 9000 - `http_port`:TiFlash HTTP 服务的端口,默认 8123 @@ -267,7 +267,7 @@ tikv_servers: - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,`data_dir` 在部署完成之后只能新增目录,而以下字段在部署完成之后就不能再修改: +以上字段中,`data_dir` 在部署完成之后只能新增目录,而下列字段部署完成之后不能再修改: - `host` - `tcp_port` @@ -292,9 +292,9 @@ tiflash_servers: ### `pump_servers` -`pump_servers` 约定了将 Binlog 组件的 Pump 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`pump_servers` 约定了将 Binlog 组件的 Pump 服务部署到哪些机器上,同时可以指定每台机器上的服务配置。`pump_servers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 ssh_port - `port`:Pump 服务的监听端口,默认 8250 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 From f0e7a66c976bf47f1704bac7de58488ee3f5fe10 Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 1 Feb 2021 16:56:06 +0800 Subject: [PATCH 42/56] Address comment --- tiup/tiup-cluster-topology-reference.md | 98 ++++++++++++------------- tiup/tiup-dm-topology-reference.md | 62 ++++++++-------- 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index 24dcefeeea9d..0dcf7c3c25f1 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -132,7 +132,7 @@ server_configs: - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl)。在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" -- `config`:该字段配置规则和 `server_configs` 里的 `pd` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `pd` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `config`:该字段配置规则和 `server_configs` 里的 `pd` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `pd` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `resource_control`:针对该服务的资源控制。如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` @@ -175,10 +175,10 @@ pd_servers: - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" -- `config`:该字段配置规则和 `server_configs` 里的 `tidb` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tidb` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `config`:该字段配置规则和 `server_configs` 里的 `tidb` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tidb` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:host 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上所有字段中,部分字段部署完成之后不能再修改。如下所示: @@ -215,10 +215,10 @@ tidb_servers: - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" -- `config`:该字段配置规则和 server_configs 里的 tikv 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tikv` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `config`:该字段配置规则和 server_configs 里的 tikv 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tikv` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:host 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上所有字段中,部分字段部署完成之后不能再修改。如下所示: @@ -260,12 +260,12 @@ tikv_servers: - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成,TiFlash 的数据目录支持多个,采用逗号分割 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `tmp_path`: TiFlash 临时文件的存放路径,默认使用 [`path` 或者 `storage.latest.dir` 的第一个目录] + "/tmp" -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" -- `config`:该字段配置规则和 `server_configs` 里的 `tiflash` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tiflash` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 `tiflash` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tiflash` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `learner_config`:每个 TiFlash 中内置了一个特殊的 TiKV,该配置项用于配置这个特殊的 TiKV,一般不建议修改这个配置项下的内容 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` 以上字段中,`data_dir` 在部署完成之后只能新增目录,而下列字段部署完成之后不能再修改: @@ -300,13 +300,13 @@ tiflash_servers: - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" -- `config`:该字段配置规则和 `server_configs` 里的 `pump` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `pump` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 `pump` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `pump` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `port` @@ -328,22 +328,22 @@ pump_servers: ### `drainer_servers` -`drainer_servers` 约定了将 Binlog 组件的 Drainer 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`drainer_servers` 约定了将 Binlog 组件的 Drainer 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,`drainer_servers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` - `port`:Drainer 服务的监听端口,默认 8249 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `commit_ts`:Drainer 启动的时候会去读取 checkpoint,如果读取不到,就会使用该字段做为初次启动开始的同步时间点,该字段默认为 -1(从 PD 总获取最新时间戳作为 commit_ts) -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" -- `config`:该字段配置规则和 `server_configs` 里的 `drainer` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `drainer` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 `drainer` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `drainer` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `port` @@ -374,22 +374,22 @@ drainer_servers: ### `cdc_servers` -`cdc_servers` 约定了将 CDC 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`cdc_servers` 约定了将 CDC 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,`cdc_servers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` - `port`:CDC 服务的监听端口,默认 8300 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `gc-ttl`:TiCDC 在 PD 设置的服务级别 GC safepoint 的 TTL (Time To Live) 时长,单位为秒,默认值为 86400,即 24 小时 - `tz`:TiCDC 服务使用的时区。TiCDC 在内部转换 timestamp 等时间数据类型和向下游同步数据时使用该时区,默认为进程运行本地时区。 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" -- `config`:该字段配置规则和 `server_configs` 里的 `cdc` 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 `cdc` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `port` @@ -411,21 +411,21 @@ cdc_servers: ### `tispark_masters` -`tispark_masters` 约定了将 TiSpark 的 master 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`tispark_masters` 约定了将 TiSpark 的 master 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,`tispark_masters` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 ssh_port - `port`:Spark 的监听端口,节点之前通讯用,默认 7077 - `web_port`:Spark 的网页端口,提供网页服务,可查看任务情况,默认 8080 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `java_home`:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 JAVA_HOME -- `spark_config`:用于配置 TiSpark 服务,生成配置文件下发到 `host` 指定的机器 +- `spark_config`:用于配置 TiSpark 服务,生成配置文件并下发到 `host` 指定的机器 - `spark_env`:配置 Spark 启动时的环境变量 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `listen_host` @@ -458,9 +458,9 @@ tispark_masters: ### `tispark_workers` -`tispark_workers`约定了将 TiSpark 的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`tispark_workers` 约定了将 TiSpark 的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,`tispark_workers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` - `port`:Spark 的监听端口,节点之前通讯用,默认 7077 @@ -470,7 +470,7 @@ tispark_masters: - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `listen_host` @@ -490,22 +490,22 @@ tispark_workers: ### `monitoring_servers` -`monitoring_servers` 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`monitoring_servers` 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,`monitoring_servers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 ssh_port -- `port`:指定 Prometheus 提供服务的端口,默认是 9090 +- `port`:指定 Prometheus 提供服务的端口,默认值:9090 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" - `storage_retention`:Prometheus 监控数据保留时间,默认 "15d" - `rule_dir`:该字段指定一个本地目录,该目录中应当含有完整的 *.rules.yml 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `port` @@ -525,18 +525,18 @@ monitoring_servers: ### `grafana_servers` -`grafana_servers` 约定了将 Grafana 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`grafana_servers` 约定了将 Grafana 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,`grafana_servers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` -- `port`:指定 Grafana 提供服务的端口,默认是 3000 +- `port`:指定 Grafana 提供服务的端口,默认值:3000 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `username`:Grafana 登陆界面的用户名 - `password`:Grafana 对应的密码 - `dashboard_dir`:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` > **注意:** > @@ -545,7 +545,7 @@ monitoring_servers: > 1. 对于本地的 dashboards 目录中的 `*.json` 文件,将 datasource 字段的值更新为新的集群名(这是因为 datasource 是以集群名命名的) > 2. 执行 `tiup cluster reload -R grafana` 命令 -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `port` @@ -563,22 +563,22 @@ grafana_servers: ### `alertmanager_servers` -`alertmanager_servers` 约定了将 Alertmanager 服务部署到哪些机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`alertmanager_servers` 约定了将 Alertmanager 服务部署到哪些机器上,同时可以指定这台机器上的服务配置,`alertmanager_servers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` -- `web_port`:指定 Alertmanager 提供网页服务的端口,默认是 9093 -- `cluster_port`:指定 Alertmanger 和 其他 Alertmanager 通讯的端口,默认是 9094 +- `web_port`:指定 Alertmanager 提供网页服务的端口,默认值:9093 +- `cluster_port`:指定 Alertmanger 和 其他 Alertmanager 通讯的端口,默认值:9094 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" - `config_file`:该字段指定一个本地文件,该文件会在集群配置初始化阶段被传输到目标机器上,作为 Alertmanager 的配置 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `web_port` diff --git a/tiup/tiup-dm-topology-reference.md b/tiup/tiup-dm-topology-reference.md index 4f5e7db4a552..b0017bb07f0e 100644 --- a/tiup/tiup-dm-topology-reference.md +++ b/tiup/tiup-dm-topology-reference.md @@ -82,24 +82,24 @@ server_configs: ## `master_servers` -`master_servers` 约定了将 DM 组件的 master 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: +`master_servers` 约定了将 DM 组件的 master 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,`master_servers` 是一个数组,每个数组的元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` - `name`:指定该 DM master 实例的名字,不同实例的名字必须唯一,否则无法部署 - `port`:指定 DM master 提供给服务的端口,默认 8261 -- `peer_port`:指定 DM master 之间互相通信的端口,默认是 8291 +- `peer_port`:指定 DM master 之间互相通信的端口,默认值:8291 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" -- `config`:该字段配置规则和 `server_configs` 里的 master 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 master 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 master 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 master 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` - v1_source_path:从 v1.0.x 升级时,可指定该目录,该目录中应当存放有 V1 的源的配置文件 -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `name` @@ -139,22 +139,22 @@ master_servers: ## `worker_servers` -`worker_servers` 约定了将 DM 组件的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,它是一个数组,每个数组的元素包含以下字段: +`worker_servers` 约定了将 DM 组件的 worker 节点部署到哪些机器上,同时可以指定每台机器上的服务配置,`worker_servers` 是一个数组,每个数组的元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` - `name`:指定该 DM worker 实例的名字,不同实例的名字必须唯一,否则无法部署 - `port`:指定 DM master 提供给服务的端口,默认 8262 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" -- `config`:该字段配置规则和 `server_configs` 里的 worker 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 worker 内容合并(若字段重叠,以该字段为准),然后生成配置文件下发到 `host` 指定的机器 +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `config`:该字段配置规则和 `server_configs` 里的 worker 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 worker 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `name` @@ -183,22 +183,22 @@ worker_servers: ### `monitoring_servers` -`monitoring_servers` 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`monitoring_servers` 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,`monitoring_servers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` -- `port`:指定 Prometheus 提供服务的端口,默认是 9090 +- `port`:指定 Prometheus 提供服务的端口,默认值:9090 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" - `storage_retention`:Prometheus 监控数据保留时间,默认 "15d" - `rule_dir`:该字段指定一个本地目录,该目录中应当含有完整的 *.rules.yml 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `port` @@ -218,18 +218,18 @@ monitoring_servers: ### `grafana_servers` -`grafana_servers` 约定了将 Grafana 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`grafana_servers` 约定了将 Grafana 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,`grafana_servers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` -- `port`:指定 Grafana 提供服务的端口,默认是 3000 +- `port`:指定 Grafana 提供服务的端口,默认值:3000 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `username`:Grafana 登陆界面的用户名 - `password`:Grafana 对应的密码 - `dashboard_dir`:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global`中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global`中的 `resource_control` > **注意:** > @@ -238,7 +238,7 @@ monitoring_servers: > 1. 在本地的 dashboards 目录中,将 datasource 字段的值更新为新的集群名(datasource 是以集群名命名的) > 2. 执行 `tiup cluster reload -R grafana` 命令 -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `port` @@ -256,22 +256,22 @@ grafana_servers: ### `alertmanager_servers` -`alertmanager_servers` 约定了将 Alertmanager 服务部署到哪些机器上,同时可以指定这台机器上的服务配置,它是一个数组,每个数组元素包含以下字段: +`alertmanager_servers` 约定了将 Alertmanager 服务部署到哪些机器上,同时可以指定这台机器上的服务配置,`alertmanager_servers` 是一个数组,每个数组元素包含以下字段: -- `host`:部署到哪台机器,填 IP 地址,不可省略 +- `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` -- `web_port`:指定 Alertmanager 提供网页服务的端口,默认是 9093 -- `cluster_port`:指定 Alertmanger 和 其他 Alertmanager 通讯的端口,默认是 9094 +- `web_port`:指定 Alertmanager 提供网页服务的端口,默认值:9093 +- `cluster_port`:指定 Alertmanger 和 其他 Alertmanager 通讯的端口,默认值:9094 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。这个参数是一个 string 类型,里面填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" - `config_file`:该字段指定一个本地文件,该文件会在集群配置初始化阶段被传输到目标机器上,作为 Alertmanager 的配置 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` -- `resource_control`:针对该服务的资源控制,所配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以该字段为准),然后生成 systemd 配置文件下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` +- `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` -以上字段中,这些字段在部署完成之后就不能再修改: +以上所有字段中,部分字段部署完成之后不能再修改。如下所示: - `host` - `web_port` From 000800b9543cbd40f2239eb60081c661a57e8317 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Tue, 2 Feb 2021 14:24:31 +0800 Subject: [PATCH 43/56] Apply suggestions from code review Co-authored-by: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> --- tiup/tiup-command-completion.md | 2 +- tiup/tiup-command-help.md | 2 +- tiup/tiup-command-list.md | 16 ++++++++-------- tiup/tiup-command-mirror-clone.md | 12 ++++++------ tiup/tiup-command-mirror-genkey.md | 10 +++++----- tiup/tiup-command-mirror-grant.md | 6 +++--- tiup/tiup-command-mirror-init.md | 6 +++--- tiup/tiup-command-mirror-merge.md | 4 ++-- tiup/tiup-command-mirror-modify.md | 8 ++++---- tiup/tiup-command-mirror-publish.md | 8 ++++---- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/tiup/tiup-command-completion.md b/tiup/tiup-command-completion.md index 681d5e900e44..d4a11f6d2e9c 100644 --- a/tiup/tiup-command-completion.md +++ b/tiup/tiup-command-completion.md @@ -4,7 +4,7 @@ title: tiup completion # tiup completion -为了降低 TiUP 使用成本,TiUP 提供了 `tiup completion` 命令用于生成命令行自动补全的配置文件。目前支持 `bash` 和 `zsh` 两种 shell 的命令补全。 +为了降低使用成本,TiUP 提供了 `tiup completion` 命令用于生成命令行自动补全的配置文件。目前支持 `bash` 和 `zsh` 两种 shell 的命令补全。 如果是 bash,需要提前安装好 bash-completion: diff --git a/tiup/tiup-command-help.md b/tiup/tiup-command-help.md index 7e1760a0db0c..a7f997d61324 100644 --- a/tiup/tiup-command-help.md +++ b/tiup/tiup-command-help.md @@ -4,7 +4,7 @@ title: tiup help # tiup help -TiUP 命令行界面为用户提供了丰富的帮助信息,用户可以通过 `help` 命令或者 `--help` 参数获得。`tiup help ` 命令等价于 `tiup --help`。 +TiUP 命令行界面为用户提供了丰富的帮助信息,用户可以通过 `help` 命令或者 `--help` 参数查看。`tiup help ` 命令等价于 `tiup --help`。 ## 语法 diff --git a/tiup/tiup-command-list.md b/tiup/tiup-command-list.md index 652c239be0ce..7899cc308628 100644 --- a/tiup/tiup-command-list.md +++ b/tiup/tiup-command-list.md @@ -16,23 +16,23 @@ tiup list [component] [flags] ## 选项 -### --all (boolean, 默认 false) +### --all(boolean,默认 false) -显示所有组件(默认只显示非隐藏组件)。 +显示所有组件。默认只显示非隐藏组件。 -### --installed (boolean,默认 false) +### --installed(boolean,默认 false) 只显示已经安装的组件或版本。 -### --verbose (boolean,默认 false) +### --verbose(boolean,默认 false) -在组件列表中显示已安装的版本列表:默认组件列表不显示当前已安装的版本。 +在组件列表中显示已安装的版本列表。默认组件列表不显示当前已安装的版本。 ## 输出 - 若未指定 `[component]` - - 若指定 --verbose:输出 `组件名(Name)`,`已安装版本(Installed)`,`组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 - - 若不指定 --verbose:输出 `组件名(Name)`,`组件管理员(Owner)`,`组件描述(Owner)` 构成的组件信息列表 + - 若指定 --verbose:输出 `组件名 (Name)`,`已安装版本 (Installed)`,`组件管理员 (Owner)`,`组件描述(Owner)` 构成的组件信息列表 + - 若不指定 --verbose:输出 `组件名 (Name)`,`组件管理员 (Owner)`,`组件描述 (Owner)` 构成的组件信息列表 - 若指定 `[component]` - - 若 `[component]` 存在:输出 `版本(Version)`,`是否已安装(Installed)`,`发布时间(Release)`,`支持的平台(Platforms)` 构成的版本信息列表 + - 若 `[component]` 存在:�输出 `版本 (Version)`,`是否已安装 (Installed)`,`发布时间 (Release)`,`支持的平台 (Platforms)` 构成的版本信息列表 - 若 `[component]` 不存在:报错 `failed to fetch component: unknown component` diff --git a/tiup/tiup-command-mirror-clone.md b/tiup/tiup-command-mirror-clone.md index 6377331f74ef..2b1348712aee 100644 --- a/tiup/tiup-command-mirror-clone.md +++ b/tiup/tiup-command-mirror-clone.md @@ -4,7 +4,7 @@ title: tiup mirror clone # tiup mirror clone -命令 `tiup mirror clone` 用于从一个已经存在的镜像上克隆或克隆部分组件生成一个新的镜像,新旧镜像的组件相同,但使用的签名密钥不同。 +命令 `tiup mirror clone` 用于克隆一个已经存在的镜像或克隆部分组件生成一个新的镜像。新旧镜像的组件相同,但使用的签名密钥不同。 ## 语法 @@ -12,14 +12,14 @@ title: tiup mirror clone tiup mirror clone [global version] [flags] ``` -- `` 是本地存放克隆下来的镜像的路径,如果不存在则会自动创建 -- `[global version]` 若指定了该参数,会尝试克隆指定版本的所有组件,若某些组件没有指定的版本,则克隆其最新版本 +- `` 是本地存放克隆下来的镜像的路径,如果不存在则会自动创建。 +- `[global version]` 若指定了该参数,会尝试克隆指定版本的所有组件。若某些组件没有指定的版本,则克隆其最新版本。 ## 选项 ### -f, --full(boolean,默认 false) -是否克隆整个镜像,指定该选项后会完整从目标镜像克隆所有组件的所有版本,此时其他指定的选项将失效。 +是否克隆整个镜像。指定该选项后会完整从目标镜像克隆所有组件的所有版本,此时其他指定的选项将失效。 ### -a, --arch(strings,默认 amd64,arm64) @@ -31,8 +31,8 @@ tiup mirror clone [global version] [flags] ### --prefix(boolean,默认 false) -匹配版本时是否前缀匹配,默认情况下必须严格匹配指定的版本才会下载,指定该选项之后,仅前缀匹配指定的版本也会被下载。 +匹配版本时是否前缀匹配。默认情况下必须严格匹配指定的版本才会下载,指定该选项之后,仅前缀匹配指定的版本也会被下载。 ### --{component}(strings,默认为空) -指定要克隆的 `{component}` 组件的版本列表, `{component}` 为组件名,可选的组件名可执行 [tiup list --all](/tiup/tiup-command-list.md) 查看。 +指定要克隆的 `{component}` 组件的版本列表。`{component}` 为组件名,可选的组件名可执行 [tiup list --all](/tiup/tiup-command-list.md) 查看。 diff --git a/tiup/tiup-command-mirror-genkey.md b/tiup/tiup-command-mirror-genkey.md index 5fad688c432a..62a54a300a90 100644 --- a/tiup/tiup-command-mirror-genkey.md +++ b/tiup/tiup-command-mirror-genkey.md @@ -6,7 +6,7 @@ title: tiup mirror genkey 在 TiUP [镜像](/tiup/tiup-mirror-reference.md)的定义中,有三类角色: -- 镜像管理员:拥有 `root.json`, `index.json`, `snapshot.json` 以及 `timestamp.json` 的修改权限 +- 镜像管理员:拥有 `root.json`,`index.json`,`snapshot.json` 以及 `timestamp.json` 的修改权限 - 组件管理员:拥有相关组件的修改权限 - 普通用户:可以下载并使用组件 @@ -26,13 +26,13 @@ tiup mirror genkey [flags] ### -n, --name(string,默认 private) -密钥的名字,该名字决定最终生成的文件名,生成的私钥文件路径为:`${TIUP_HOME}/keys/{name}.json`,其中 `TIUP_HOME` 为 TiUP 的家目录,默认路径为 `$HOME/.tiup`,`name` 为 `-n/--name` 指定的密钥名字。 +密钥的名字,该名字决定最终生成的文件名。生成的私钥文件路径为:`${TIUP_HOME}/keys/{name}.json`,其中 `TIUP_HOME` 为 TiUP 的家目录,默认路径为 `$HOME/.tiup`,`name` 为 `-n/--name` 指定的密钥名字。 ### -p, --public(boolean,默认 false) 显示当前私钥对应的公钥,当前私钥名字由 `-n/--name` 选项指定。 -当指定了 `-p/--public` 时,不会创建新的私钥,若 `-n/--name` 指定的私钥不存在,则报错。 +当指定了 `-p/--public` 时,不会创建新的私钥。若 `-n/--name` 指定的私钥不存在,则报错。 ### --save(boolean,默认 false) @@ -40,9 +40,9 @@ tiup mirror genkey [flags] ## 输出 -- 若未指定 `-p/--public`: +- 若未指定 `-p/--public`: - 若指定的密钥已存在:`Key already exists, skipped` - 若指定的密钥不存在:`private key have been write to ${TIUP_HOME}/keys/{name}.json` -- 若指定 `-p/--public`: +- 若指定 `-p/--public`: - 若指定的密钥不存在:`Error: open ${TIUP_HOME}/keys/{name}.json: no such file or directory` - 若指定的密钥存在:输出该密钥对应的公钥内容 diff --git a/tiup/tiup-command-mirror-grant.md b/tiup/tiup-command-mirror-grant.md index 62de3aa5af17..d54424bfc49d 100644 --- a/tiup/tiup-command-mirror-grant.md +++ b/tiup/tiup-command-mirror-grant.md @@ -6,7 +6,7 @@ title: tiup mirror grant 命令 `tiup mirror grant` 用来向当前镜像中引入一个组件管理员。 -组件管理员可以使用其密钥发布新的组件,也可以对其之前发布的组件作出修改,添加组件管理员时,该组件管理员需要先将其公钥发送给镜像管理员。 +组件管理员可以使用其密钥发布新的组件,也可以对其之前发布的组件作出修改。添加组件管理员时,该组件管理员需要先将其公钥发送给镜像管理员。 > **注意** > @@ -24,13 +24,13 @@ tiup mirror grant [flags] ### -k, --key(string,默认 ${TIUP_HOME}/keys/private.json) -指定引入的组件管理员的密钥,该密钥可以是公钥也可以是私钥,如果传入私钥,会被转换成对应的公钥储存在镜像中。 +指定引入的组件管理员的密钥。该密钥可以是公钥也可以是私钥。如果传入私钥,会被转换成对应的公钥储存在镜像中。 一个密钥只能被一个组件管理员使用。 ### -n, --name(string,默认 ``) -指定组件管理员的名字,该名字会展示在组件列表的 `Owner` 字段上,若未指定 `-n/--name` 则使用 `` 作为组件管理员名字。 +指定组件管理员的名字,该名字会展示在组件列表的 `Owner` 字段上。若未指定 `-n/--name` 则使用 `` 作为组件管理员名字。 ### 输出 diff --git a/tiup/tiup-command-mirror-init.md b/tiup/tiup-command-mirror-init.md index 82f2ab428bd5..95b3f8cf8dfd 100644 --- a/tiup/tiup-command-mirror-init.md +++ b/tiup/tiup-command-mirror-init.md @@ -4,7 +4,7 @@ title: tiup mirror init # tiup mirror init -命令 `tiup mirror init` 用于初始化一个空的镜像,初始化的镜像不包含任何组件和组件管理员,仅生成以下文件: +命令 `tiup mirror init` 用于初始化一个空的镜像。初始化的镜像不包含任何组件和组件管理员,仅生成以下文件: ``` + # 镜像根目录 @@ -27,13 +27,13 @@ title: tiup mirror init tiup mirror init [flags] ``` -`` 为本地目录路径,可以为相对路径,TiUP 会以次路径做为 mirror-dir,在其中生成文件,若该目录已存在,则必须保证为空,若该目录不存在,则 TiUP 会自动创建。 +`` 为本地目录路径,可以为相对路径。TiUP 会以此路径为镜像文件存放路径,在其中生成文件。若该目录已存在,则必须保证为空,若该目录不存在,则 TiUP 会自动创建。 ## 选项 ### -k, --key-dir(string,默认 {path}/keys) -指定生成私钥文件的目录,若指定的文件目录不存在,则会自动创建。 +指定生成私钥文件的目录。若指定的文件目录不存在,则会自动创建。 ### 输出 diff --git a/tiup/tiup-command-mirror-merge.md b/tiup/tiup-command-mirror-merge.md index d71e1cb13571..5fcf9bc9bb07 100644 --- a/tiup/tiup-command-mirror-merge.md +++ b/tiup/tiup-command-mirror-merge.md @@ -8,8 +8,8 @@ title: tiup mirror merge 执行此命令需要满足几个条件: -- 目标镜像的所有组件的管理员 ID 必须在当前镜像中存在 -- 执行该命令用户的 `${TIUP_HOME}/keys` 目录中有上述管理员 ID 在当前镜像中对应的所有私钥(可以使用命令 [tiup mirror set](/tiup/tiup-command-mirror-set.md) 将当前镜像切换成目前有权限修改的镜像) +- 目标镜像的所有组件的管理员 ID 必须在当前镜像中存在。 +- 执行该命令用户的 `${TIUP_HOME}/keys` 目录中有上述管理员 ID 在当前镜像中对应的所有私钥(可以使用命令 [tiup mirror set](/tiup/tiup-command-mirror-set.md) 将当前镜像切换成目前有权限修改的镜像)。 ## 语法 diff --git a/tiup/tiup-command-mirror-modify.md b/tiup/tiup-command-mirror-modify.md index 149f3b7cc371..7aff26e00846 100644 --- a/tiup/tiup-command-mirror-modify.md +++ b/tiup/tiup-command-mirror-modify.md @@ -4,7 +4,7 @@ title: tiup mirror modify # tiup mirror modify -命令 `tiup mirror modify` 用于修改已发布的组件。只有合法的组件管理员才可以修改组件,且只能修改其自己发布的组件,组件发布方式参考 [publish 命令](/tiup/tiup-command-mirror-publish.md)。 +命令 `tiup mirror modify` 用于修改已发布的组件。只有合法的组件管理员才可以修改组件,且只能修改其自己发布的组件。组件发布方式参考 [publish 命令](/tiup/tiup-command-mirror-publish.md)。 ## 语法 @@ -27,8 +27,8 @@ tiup mirror modify [:version] [flags] 将指定组件或指定版本标记为不可用: -- 标记组件不可用之后 `tiup list` 将看不到该组件,也无法安装该组件的新版本 -- 标记版本不可用之后 `tiup list ` 将看不到该版本,也无法安装该版本 +- 标记组件不可用之后 `tiup list` 将看不到该组件,也无法安装该组件的新版本。 +- 标记版本不可用之后 `tiup list ` 将看不到该版本,也无法安装该版本。 ### --hide(boolean,默认 false) @@ -40,7 +40,7 @@ tiup mirror modify [:version] [flags] ### --standalone(boolean,默认 false) -该组件是否独立可运行的组件,该参数尚未使用,将在未来启用。 +该组件是否可独立运行。本参数目前尚未启用。 > **注意:** > diff --git a/tiup/tiup-command-mirror-publish.md b/tiup/tiup-command-mirror-publish.md index 1ce6fd2ccffa..301a889bf9cd 100644 --- a/tiup/tiup-command-mirror-publish.md +++ b/tiup/tiup-command-mirror-publish.md @@ -4,7 +4,7 @@ title: tiup mirror publish # tiup mirror publish -命令 `tiup mirror publish` 用于发布新组件,或已有组件的新版本。只有合法的组件管理员才可以发布组件,组件管理员的引入方式参考 [grant 命令](/tiup/tiup-command-mirror-grant.md)。 +命令 `tiup mirror publish` 用于发布新组件,或已有组件的新版本。只有合法的组件管理员才可以发布组件。组件管理员的引入方式参考 [grant 命令](/tiup/tiup-command-mirror-grant.md)。 ## 语法 @@ -15,7 +15,7 @@ tiup mirror publish [flags] 各个参数解释如下: - ``:组件名,如 `tidb`,建议使用符合正则 `^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$` 的字符串 -- ``:当前正在发布的版本,需要符合 [Semantic Versioning](https://semver.org/) +- ``:当前正在发布的版本,版本号需要符合 [Semantic Versioning](https://semver.org/) - ``:`.tar.gz` 包的本地路径,需要将组件的可执行文件及依赖放在该包中,由 TiUP 上传到镜像 - ``:组件的可执行文件在 `` 中的位置 @@ -55,11 +55,11 @@ tiup mirror publish [flags] ### --hide(boolean,默认 false) -是否为隐藏组件,若为隐藏组件,则不在 `tiup list` 的列表中显示,但是 `tiup list --all` 可看到。 +是否为隐藏组件。若为隐藏组件,则不在 `tiup list` 的列表中显示,但是 `tiup list --all` 可看到。 ### --standalone(boolean,默认 false) -该组件是否独立可运行的组件,该参数尚未使用,将在未来启用。 +该组件是否可独立运行。该参数目前尚未启用。 ## 输出 From 9dc570e02b561a13aab30f953b57c3d7356523c3 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Wed, 3 Feb 2021 15:06:28 +0800 Subject: [PATCH 44/56] refine format and remove control characters --- tiup/tiup-cluster-topology-reference.md | 62 ++++++++++++------------- tiup/tiup-command-list.md | 8 ++-- tiup/tiup-command-mirror-genkey.md | 2 +- tiup/tiup-command-mirror-merge.md | 2 +- tiup/tiup-command-mirror-modify.md | 2 +- tiup/tiup-command-mirror-publish.md | 12 ++--- tiup/tiup-command-mirror-rotate.md | 4 +- tiup/tiup-command-mirror-set.md | 2 +- tiup/tiup-command-status.md | 6 +-- tiup/tiup-command-telemetry.md | 4 +- tiup/tiup-component-cluster-display.md | 4 +- tiup/tiup-component-cluster-import.md | 20 ++++---- 12 files changed, 64 insertions(+), 64 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index 0dcf7c3c25f1..165329f66d6b 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -16,7 +16,7 @@ title: 通过 TiUP 部署 TiDB 集群的拓扑文件配置 - [monitored](/tiup/tiup-cluster-topology-reference.md#monitored):监控服务配置,即 blackbox exporter 和 node exporter,每台机器上都会部署一个 node exporter 和一个 blackbox exporter - [server_configs](/tiup/tiup-cluster-topology-reference.md#server_configs):组件全局配置,可单独针对每个组件配置,若在实例中存在同名配置项,那么以实例中配置的为准 - [pd_servers](/tiup/tiup-cluster-topology-reference.md#pd_servers):PD 实例的配置,用来指定 PD 组件部署到哪些机器上 -- [tidb_servers](/tiup/tiup-cluster-topology-reference.md#tidb_servers): TiDB 实例的配置,用来指定 TiDB 组件部署到哪些机器上 +- [tidb_servers](/tiup/tiup-cluster-topology-reference.md#tidb_servers):TiDB 实例的配置,用来指定 TiDB 组件部署到哪些机器上 - [tikv_servers](/tiup/tiup-cluster-topology-reference.md#tikv_servers):TiKV 实例的配置,用来指定 TiKV 组件部署到哪些机器上 - [tiflash_servers](/tiup/tiup-cluster-topology-reference.md#tiflash_servers):TiFlash 实例的配置,用来指定 TiFlash 组件部署到哪些机器上 - [pump_servers](/tiup/tiup-cluster-topology-reference.md#pump_servers):Pump 实例的配置,用来指定 Pump 组件部署到哪些机器上 @@ -41,11 +41,11 @@ title: 通过 TiUP 部署 TiDB 集群的拓扑文件配置 - 对于每个实例,如果用户未配置 `deploy_dir`,其默认值为相对路径 `-` - 如果 `global.deploy_dir` 为绝对路径,那么组件会部署到 `/` 目录 - 如果 `global.deploy_dir` 为相对路径,那么组件会部署到 `/home///` 目录 -- `data_dir`:数据目录, 默认值:"data"。其应用规则如下: +- `data_dir`:数据目录,默认值:"data"。其应用规则如下: - 如果在实例级别配置了绝对路径的 `data_dir`,那么实际数据目录为该实例设定的 `data_dir` - 对于每个实例,如果用户未配置 `data_dir`,其默认值为 `` - 如果 `data_dir` 为相对路径,那么组件数据将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 -- `log_dir`:数据目录, 默认值:"log"。其应用规则如下: +- `log_dir`:数据目录,默认值:"log"。其应用规则如下: - 如果在实例级别配置了绝对路径的 `log_dir`,那么实际日志目录为该实例设定的 `log_dir` - 对于每个实例,如果用户未配置 `log_dir`,其默认值为 `` - 如果 `log_dir` 为相对路径,那么组件日志将放到 `/` 中,其中 `` 的计算规则请参考 `deploy_dir` 字段的应用规则 @@ -53,10 +53,10 @@ title: 通过 TiUP 部署 TiDB 集群的拓扑文件配置 - `arch`:目标机器的 CPU 架构,该字段决定了向目标机器推送哪个平台的二进制包,支持 amd64 和 arm64,默认值:amd64 - `resource_control`:运行时资源控制,该字段下所有配置都将写入 systemd 的 service 文件中,默认无限制。支持控制的资源如下: - `memory_limit`: 限制运行时最大内存,例如 "2G" 表示最多使用 2GB 内存 - - `cpu_quota`:限制运行时最大 CPU 占用率,例如 "200%" - - `io_read_bandwidth_max`:读磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" - - `io_write_bandwidth_max`:写磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" - - `limit_core`:控制 core dump 大小 + - `cpu_quota`:限制运行时最大 CPU 占用率,例如 "200%" + - `io_read_bandwidth_max`:读磁盘 I/O 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" + - `io_write_bandwidth_max`:写磁盘 I/O 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" + - `limit_core`:控制 core dump 的大小 `global` 配置示例: @@ -67,7 +67,7 @@ global: memory_limit: "2G" ``` -上述配置指定使用 tidb 用户启动集群,同时限制每个组件运行时最多只能使用 2GB 内存。 +上述配置指定使用 `tidb` 用户启动集群,同时限制每个组件运行时最多只能使用 2GB 内存。 ### `monitored` @@ -91,7 +91,7 @@ monitored: ### `server_configs` -`server_configs` 用于配置服务,生成各组件的配置文件,类似 global 区块,该区块内的配置可以在具体的实例中被覆盖。主要包含以下字段: +`server_configs` 用于配置服务,生成各组件的配置文件,类似 `global` 区块,该区块内的配置可以在具体的实例中被覆盖。主要包含以下字段: - `tidb`:TiDB 服务的相关配置,支持的完整配置请参考 [TiDB 配置文件描述](/tidb-configuration-file.md) - `tikv`:TiKV 服务的相关配置,支持的完整配置请参考 [TiKV 配置文件描述](/tikv-configuration-file.md) @@ -120,7 +120,7 @@ server_configs: ### `pd_servers` -`pd_servers` 约定了将 PD 的服务部署到哪些机器上,同时可以指定每台机器上的服务配置。`pd_servers` 是一个数组,每个数组的元素包含以下字段: +`pd_servers` 指定了将 PD 的服务部署到哪些机器上,同时可以指定每台机器上的服务配置。`pd_servers` 是一个数组,每个数组的元素包含以下字段: - `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` @@ -131,7 +131,7 @@ server_configs: - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl)。在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl)。在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点的 ID,例如 "0,1" - `config`:该字段配置规则和 `server_configs` 里的 `pd` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `pd` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` @@ -165,7 +165,7 @@ pd_servers: ### `tidb_servers` -`tidb_servers` 约定了将 TiDB 服务部署到哪些机器上,同时可以指定每台机器上的服务配置。`tidb_servers` 是一个数组,每个数组的元素包含以下字段: +`tidb_servers` 指定了将 TiDB 服务部署到哪些机器上,同时可以指定每台机器上的服务配置。`tidb_servers` 是一个数组,每个数组的元素包含以下字段: - `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` @@ -174,7 +174,7 @@ pd_servers: - `status_port`:TiDB 状态服务的监听端口,用于外部通过 http 请求查看 TiDB 服务的状态,默认值:10080 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点的 ID,例如 "0,1" - `config`:该字段配置规则和 `server_configs` 里的 `tidb` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tidb` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:host 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` @@ -214,7 +214,7 @@ tidb_servers: - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点的 ID,例如 "0,1" - `config`:该字段配置规则和 server_configs 里的 tikv 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tikv` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:host 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:host 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` @@ -249,7 +249,7 @@ tikv_servers: `tiflash_servers` 约定了将 TiFlash 服务部署到哪些机器上,同时可以指定每台机器上的服务配置。该区块是一个数组,每个数组元素包含以下字段: - `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 -- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 ssh_port +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 `ssh_port` - `tcp_port`:TiFlash TCP 服务的端口,默认 9000 - `http_port`:TiFlash HTTP 服务的端口,默认 8123 - `flash_service_port`:TiFlash 提供服务的端口,TiDB 通过该端口从 TiFlash 读数据,默认 3930 @@ -260,7 +260,7 @@ tikv_servers: - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成,TiFlash 的数据目录支持多个,采用逗号分割 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `tmp_path`: TiFlash 临时文件的存放路径,默认使用 [`path` 或者 `storage.latest.dir` 的第一个目录] + "/tmp" -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点的 ID,例如 "0,1" - `config`:该字段配置规则和 `server_configs` 里的 `tiflash` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tiflash` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `learner_config`:每个 TiFlash 中内置了一个特殊的 TiKV,该配置项用于配置这个特殊的 TiKV,一般不建议修改这个配置项下的内容 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` @@ -292,15 +292,15 @@ tiflash_servers: ### `pump_servers` -`pump_servers` 约定了将 Binlog 组件的 Pump 服务部署到哪些机器上,同时可以指定每台机器上的服务配置。`pump_servers` 是一个数组,每个数组元素包含以下字段: +`pump_servers` 约定了将 TiDB Binlog 组件的 Pump 服务部署到哪些机器上,同时可以指定每台机器上的服务配置。`pump_servers` 是一个数组,每个数组元素包含以下字段: - `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 -- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 ssh_port +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` - `port`:Pump 服务的监听端口,默认 8250 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点的 ID,例如 "0,1" - `config`:该字段配置规则和 `server_configs` 里的 `pump` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `pump` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` @@ -328,7 +328,7 @@ pump_servers: ### `drainer_servers` -`drainer_servers` 约定了将 Binlog 组件的 Drainer 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,`drainer_servers` 是一个数组,每个数组元素包含以下字段: +`drainer_servers` 约定了将 TiDB Binlog 组件的 Drainer 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,`drainer_servers` 是一个数组,每个数组元素包含以下字段: - `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` @@ -337,7 +337,7 @@ pump_servers: - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `commit_ts`:Drainer 启动的时候会去读取 checkpoint,如果读取不到,就会使用该字段做为初次启动开始的同步时间点,该字段默认为 -1(从 PD 总获取最新时间戳作为 commit_ts) -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点的 ID,例如 "0,1" - `config`:该字段配置规则和 `server_configs` 里的 `drainer` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `drainer` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` @@ -383,7 +383,7 @@ drainer_servers: - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `gc-ttl`:TiCDC 在 PD 设置的服务级别 GC safepoint 的 TTL (Time To Live) 时长,单位为秒,默认值为 86400,即 24 小时 - `tz`:TiCDC 服务使用的时区。TiCDC 在内部转换 timestamp 等时间数据类型和向下游同步数据时使用该时区,默认为进程运行本地时区。 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点的 ID,例如 "0,1" - `config`:该字段配置规则和 `server_configs` 里的 `cdc` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` @@ -415,11 +415,11 @@ cdc_servers: - `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `listen_host`:当机器上有多个 IP 时,可以指定服务的监听 IP,默认为 `0.0.0.0` -- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 ssh_port +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 `ssh_port` - `port`:Spark 的监听端口,节点之前通讯用,默认 7077 - `web_port`:Spark 的网页端口,提供网页服务,可查看任务情况,默认 8080 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 -- `java_home`:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 JAVA_HOME +- `java_home`:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 `JAVA_HOME` - `spark_config`:用于配置 TiSpark 服务,生成配置文件并下发到 `host` 指定的机器 - `spark_env`:配置 Spark 启动时的环境变量 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` @@ -466,7 +466,7 @@ tispark_masters: - `port`:Spark 的监听端口,节点之前通讯用,默认 7077 - `web_port`:Spark 的网页端口,提供网页服务,可查看任务情况,默认 8080 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 -- `java_home`:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 JAVA_HOME +- `java_home`:指定要使用的 JRE 环境所在的路径。该参数对应系统环境变量 `JAVA_HOME` - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` @@ -493,14 +493,14 @@ tispark_workers: `monitoring_servers` 约定了将 Prometheus 服务部署到哪台机器上,同时可以指定这台机器上的服务配置,`monitoring_servers` 是一个数组,每个数组元素包含以下字段: - `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 -- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 ssh_port +- `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 global 区块中的 `ssh_port` - `port`:指定 Prometheus 提供服务的端口,默认值:9090 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点的 ID,例如 "0,1" - `storage_retention`:Prometheus 监控数据保留时间,默认 "15d" -- `rule_dir`:该字段指定一个本地目录,该目录中应当含有完整的 *.rules.yml 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 +- `rule_dir`:该字段指定一个本地目录,该目录中应当含有完整的 `*.rules.yml` 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` @@ -535,14 +535,14 @@ monitoring_servers: - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `username`:Grafana 登陆界面的用户名 - `password`:Grafana 对应的密码 -- `dashboard_dir`:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards +- `dashboard_dir`:该字段指定一个本地目录,该目录中应当含有完整的 `dashboard(*.json)` 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards - `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` > **注意:** > > 如果配置了 `grafana_servers` 的 `dashboard_dir` 字段,在执行 `tiup cluster rename` 命令进行集群重命名后,需要完成以下操作: > -> 1. 对于本地的 dashboards 目录中的 `*.json` 文件,将 datasource 字段的值更新为新的集群名(这是因为 datasource 是以集群名命名的) +> 1. 对于本地的 dashboards 目录中的 `*.json` 文件,将 `datasource` 字段的值更新为新的集群名(这是因为 `datasource` 是以集群名命名的) > 2. 执行 `tiup cluster reload -R grafana` 命令 以上所有字段中,部分字段部署完成之后不能再修改。如下所示: @@ -572,7 +572,7 @@ grafana_servers: - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `data_dir`:指定数据目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `data_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 -- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" +- `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点的 ID,例如 "0,1" - `config_file`:该字段指定一个本地文件,该文件会在集群配置初始化阶段被传输到目标机器上,作为 Alertmanager 的配置 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` diff --git a/tiup/tiup-command-list.md b/tiup/tiup-command-list.md index 7899cc308628..959e19ee0de5 100644 --- a/tiup/tiup-command-list.md +++ b/tiup/tiup-command-list.md @@ -12,7 +12,7 @@ title: tiup list tiup list [component] [flags] ``` -`[component]` 是可选的组件名称,若指定,则列出该组件的所有版本,若不指定,则列出所有组件列表。 +`[component]` 是可选的组件名称。若指定,则列出该组件的所有版本;若不指定,则列出所有组件列表。 ## 选项 @@ -31,8 +31,8 @@ tiup list [component] [flags] ## 输出 - 若未指定 `[component]` - - 若指定 --verbose:输出 `组件名 (Name)`,`已安装版本 (Installed)`,`组件管理员 (Owner)`,`组件描述(Owner)` 构成的组件信息列表 - - 若不指定 --verbose:输出 `组件名 (Name)`,`组件管理员 (Owner)`,`组件描述 (Owner)` 构成的组件信息列表 + - 若指定 --verbose:输出 `组件名 (Name)`、`已安装版本 (Installed)`、`组件管理员 (Owner)`、`组件描述(Owner)` 构成的组件信息列表 + - 若不指定 --verbose:输出 `组件名 (Name)`、`组件管理员 (Owner)`、`组件描述 (Owner)` 构成的组件信息列表 - 若指定 `[component]` - - 若 `[component]` 存在:�输出 `版本 (Version)`,`是否已安装 (Installed)`,`发布时间 (Release)`,`支持的平台 (Platforms)` 构成的版本信息列表 + - 若 `[component]` 存在:输出 `版本 (Version)`、`是否已安装 (Installed)`、`发布时间 (Release)`、`支持的平台 (Platforms)` 构成的版本信息列表 - 若 `[component]` 不存在:报错 `failed to fetch component: unknown component` diff --git a/tiup/tiup-command-mirror-genkey.md b/tiup/tiup-command-mirror-genkey.md index 62a54a300a90..0288fe949ca9 100644 --- a/tiup/tiup-command-mirror-genkey.md +++ b/tiup/tiup-command-mirror-genkey.md @@ -6,7 +6,7 @@ title: tiup mirror genkey 在 TiUP [镜像](/tiup/tiup-mirror-reference.md)的定义中,有三类角色: -- 镜像管理员:拥有 `root.json`,`index.json`,`snapshot.json` 以及 `timestamp.json` 的修改权限 +- 镜像管理员:拥有 `root.json`、`index.json`、`snapshot.json` 以及 `timestamp.json` 的修改权限 - 组件管理员:拥有相关组件的修改权限 - 普通用户:可以下载并使用组件 diff --git a/tiup/tiup-command-mirror-merge.md b/tiup/tiup-command-mirror-merge.md index 5fcf9bc9bb07..947a48d1bcbf 100644 --- a/tiup/tiup-command-mirror-merge.md +++ b/tiup/tiup-command-mirror-merge.md @@ -9,7 +9,7 @@ title: tiup mirror merge 执行此命令需要满足几个条件: - 目标镜像的所有组件的管理员 ID 必须在当前镜像中存在。 -- 执行该命令用户的 `${TIUP_HOME}/keys` 目录中有上述管理员 ID 在当前镜像中对应的所有私钥(可以使用命令 [tiup mirror set](/tiup/tiup-command-mirror-set.md) 将当前镜像切换成目前有权限修改的镜像)。 +- 执行该命令用户的 `${TIUP_HOME}/keys` 目录中有上述管理员 ID 在当前镜像中对应的所有私钥(可以使用命令 [`tiup mirror set`](/tiup/tiup-command-mirror-set.md) 将当前镜像切换成目前有权限修改的镜像)。 ## 语法 diff --git a/tiup/tiup-command-mirror-modify.md b/tiup/tiup-command-mirror-modify.md index 7aff26e00846..e6f8b9508677 100644 --- a/tiup/tiup-command-mirror-modify.md +++ b/tiup/tiup-command-mirror-modify.md @@ -4,7 +4,7 @@ title: tiup mirror modify # tiup mirror modify -命令 `tiup mirror modify` 用于修改已发布的组件。只有合法的组件管理员才可以修改组件,且只能修改其自己发布的组件。组件发布方式参考 [publish 命令](/tiup/tiup-command-mirror-publish.md)。 +命令 `tiup mirror modify` 用于修改已发布的组件。只有合法的组件管理员才可以修改组件,且只能修改其自己发布的组件。组件发布方式参考 [`publish` 命令](/tiup/tiup-command-mirror-publish.md)。 ## 语法 diff --git a/tiup/tiup-command-mirror-publish.md b/tiup/tiup-command-mirror-publish.md index 301a889bf9cd..d879d966df6a 100644 --- a/tiup/tiup-command-mirror-publish.md +++ b/tiup/tiup-command-mirror-publish.md @@ -29,9 +29,9 @@ tiup mirror publish [flags] 该 `` 中的二进制文件运行的平台,一个 `` 只能选以下三个平台之一: -- amd64:表示在 amd64 架构的机器上运行 -- arm64:表示在 arm64 架构的机器上运行 -- any:表示可以在以上两种架构的机器上运行(比如脚本) +- `amd64`:表示在 amd64 架构的机器上运行 +- `arm64`:表示在 arm64 架构的机器上运行 +- `any`:表示可以在以上两种架构的机器上运行(比如脚本) > **注意:** > @@ -41,9 +41,9 @@ tiup mirror publish [flags] 该 `` 中的二进制文件运行的操作系统,一个 `` 只能选以下三个操作系统之一: -- linux:表示在 Linux 操作系统上运行 -- darwin:表示在 Darwin 操作系统上运行 -- any:表示可以在以上两种操作系统上运行(比如脚本) +- `linux`:表示在 Linux 操作系统上运行 +- `darwin`:表示在 Darwin 操作系统上运行 +- `any`:表示可以在以上两种操作系统上运行(比如脚本) > **注意:** > diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md index 78b5368f6a5d..eca5a0950dec 100644 --- a/tiup/tiup-command-mirror-rotate.md +++ b/tiup/tiup-command-mirror-rotate.md @@ -43,7 +43,7 @@ TiUP 使用命令 `tiup mirror rotate` 来自动化以上流程。 tiup mirror rotate [flags] ``` -该命令会启动一个编辑器,修改其内容为目标值(比如将 expires 字段的值向后推移),然后需要将 version 字段加一并保存。保存之后会启动一个临时的 http 服务器,等待 N 个不同的镜像管理员签名。 +该命令会启动一个编辑器,修改其内容为目标值(比如将 `expires` 字段的值向后推移),然后需要将 `version` 字段加一并保存。保存之后会启动一个临时的 http 服务器,等待 N 个不同的镜像管理员签名。 镜像管理员签名的方式参考[sign 命令](/tiup/tiup-command-mirror-sign.md)。 @@ -51,7 +51,7 @@ tiup mirror rotate [flags] ### --addr(string,默认 0.0.0.0:8080) -临时服务器的监听地址,需要确保该地址可以被其他镜像管理员访问,这样他们才能使用[sign 命令](/tiup/tiup-command-mirror-sign.md)签名。 +临时服务器的监听地址,需要确保该地址可以被其他镜像管理员访问,这样他们才能使用[sign 命令](/tiup/tiup-command-mirror-sign.md)签名。 ## 输出 diff --git a/tiup/tiup-command-mirror-set.md b/tiup/tiup-command-mirror-set.md index 5ddd6f43fd95..38a4ed71e7b6 100644 --- a/tiup/tiup-command-mirror-set.md +++ b/tiup/tiup-command-mirror-set.md @@ -17,7 +17,7 @@ tiup mirror set [flags] `` 为镜像地址,可以有两种形式: - 网络地址:http 或者 https 开头,如 `http://172.16.5.5:8080`,`https://tiup-mirrors.pingcap.com` 等 -- 本地文件路径:镜像目录的绝对路径,比如 /path/to/local-tiup-mirror +- 本地文件路径:镜像目录的绝对路径,比如 `/path/to/local-tiup-mirror` ## 选项 diff --git a/tiup/tiup-command-status.md b/tiup/tiup-command-status.md index ddc5e23b4094..199b462f3016 100644 --- a/tiup/tiup-command-status.md +++ b/tiup/tiup-command-status.md @@ -10,8 +10,8 @@ title: tiup status > > 只能查询到以下两种组件的信息: > -> 1. 尚在运行的组件 -> 2. 通过 `tiup -T/--tag` 指定 tag 运行的组件 +> + 尚在运行的组件 +> + 通过 `tiup -T/--tag` 指定 tag 运行的组件 ## 语法 @@ -25,4 +25,4 @@ tiup status [flags] ## 输出 -由 `Tag 名字`,`组件名`,`进程 PID`,`运行状态`, `启动时间`,`启动参数`,`数据目录`,`二进制文件路径` 构成的表格,若启动时未指定 Tag 名字,则 Tag 名字段为随机字符串。 \ No newline at end of file +由 `Tag 名字`,`组件名`,`进程 PID`,`运行状态`, `启动时间`,`启动参数`,`数据目录`,`二进制文件路径` 构成的表格,若启动时未指定 Tag 名字,则 Tag 名字段为随机字符串。 diff --git a/tiup/tiup-command-telemetry.md b/tiup/tiup-command-telemetry.md index 012e64985ebb..fe371a0a0420 100644 --- a/tiup/tiup-command-telemetry.md +++ b/tiup/tiup-command-telemetry.md @@ -38,8 +38,8 @@ tiup telemetry 命令 `tiup telemetry status` 查看当前的遥测设置,输出以下信息: -- status: 当前是否开启遥测(enable|disable) -- uuid: 随机生成的遥测标示符 +- `status`: 当前是否开启遥测 `(enable|disable)` +- `uuid`: 随机生成的遥测标示符 ### reset diff --git a/tiup/tiup-component-cluster-display.md b/tiup/tiup-component-cluster-display.md index 5d598beb4a4f..12c9f6b111bb 100644 --- a/tiup/tiup-component-cluster-display.md +++ b/tiup/tiup-component-cluster-display.md @@ -47,8 +47,8 @@ tiup cluster display [flags] - SSH 客户端类型 - Dashboard 地址 - 含有以下字段的表格: - - ID:节点 ID,由 IP:PORT 构成 - - Role:该节点部署的服务角色(如 tidb, tikv 等) + - ID:节点 ID,由 `IP:PORT` 构成 + - Role:该节点部署的服务角色(如 TiDB、 TiKV 等) - Host:该节点对应的机器 IP - Ports:服务占用的端口号 - OS/Arch:该节点的操作系统和机器架构 diff --git a/tiup/tiup-component-cluster-import.md b/tiup/tiup-component-cluster-import.md index ae0ad022e588..0493b5be2335 100644 --- a/tiup/tiup-component-cluster-import.md +++ b/tiup/tiup-component-cluster-import.md @@ -4,19 +4,19 @@ title: tiup cluster import # tiup cluster import -在 TiDB 4.0 以前的版本,集群基本是通过 TiDB Ansible 部署的,TiUP Cluster 提供了 `import` 命令用于让这些集群过渡到 tiup-cluster 组件接管。 +在 TiDB 4.0 以前的版本,集群基本是通过 TiDB Ansible 部署的。TiUP Cluster 提供了 `import` 命令用于让这些集群过渡到使用 tiup-cluster 组件接管。 > **注意:** > -> 1. TiDB Ansible 配置导入到 TiUP 中管理后,不能再通过 TiDB Ansible 对集群进行操作,否则可能因元信息不一致造成冲突 -> 2. 对于满足以下情况之一的 TiDB Ansible 部署的集群,暂不支持导入: -> a. 启用了 `TLS` 加密功能的集群 -> b. 纯 KV 集群(没有 TiDB 实例的集群) -> c. 启用了 `Kafka` 的集群 -> d. 启用了 `Spark` 的集群 -> e. 启用了 `Lightning` / `Importer` 的集群 -> f. 仍使用老版本 '`push`' 的方式收集监控指标(从 3.0 默认为 '`pull`' 模式,如果没有特意调整过则可以支持) -> g. 在 `inventory.ini` 配置文件中单独为机器的 `node_exporter` / `blackbox_exporter` 通过 `node_exporter_port` / `blackbox_exporter_port` 设置了非默认端口(在 `group_vars` 目录中统一配置的可以兼容) +> + TiDB Ansible 配置导入到 TiUP 中管理后,不能再通过 TiDB Ansible 对集群进行操作,否则可能因元信息不一致造成冲突 +> + 如果使用 TiDB Ansible 部署的集群存在以下情况之一,暂不支持导入: +> + 启用了 TLS 加密功能的集群 +> + 纯 KV 集群(没有 TiDB 实例的集群) +> + 启用了 `Kafka 的集群 +> + 启用了 Spark` 的集群 +> + 启用了 TiDB Lightning/ Importer 的集群 +> + 仍使用老版本 `push` 的方式收集监控指标(从 v3.0 起默认为 `pull` 模式,如果没有特意调整过则可以支持) +> + 在 `inventory.ini` 配置文件中单独为机器的 `node_exporter` / `blackbox_exporter` 通过 `node_exporter_port`/`blackbox_exporter_port` 设置了非默认端口(在 `group_vars` 目录中统一配置的可以兼容) ## 语法 From 842460687213337dfb11d2f082316cb471e27a01 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Wed, 3 Feb 2021 15:58:32 +0800 Subject: [PATCH 45/56] correct spelling and format --- tiup/tiup-command-mirror-rotate.md | 2 +- tiup/tiup-component-cluster-disable.md | 8 +++---- tiup/tiup-component-cluster-display.md | 8 +++---- tiup/tiup-component-cluster-enable.md | 8 +++---- tiup/tiup-component-cluster-patch.md | 12 +++++----- tiup/tiup-component-cluster-reload.md | 14 ++++++------ tiup/tiup-component-cluster-rename.md | 6 ++--- tiup/tiup-component-cluster-restart.md | 4 ++-- tiup/tiup-component-cluster-scale-in.md | 6 ++--- tiup/tiup-component-cluster-scale-out.md | 4 ++-- tiup/tiup-component-cluster-start.md | 4 ++-- tiup/tiup-component-cluster-stop.md | 4 ++-- tiup/tiup-component-cluster.md | 10 ++++----- tiup/tiup-component-dm-display.md | 4 ++-- tiup/tiup-component-dm-edit-config.md | 8 +++---- tiup/tiup-component-dm-import.md | 12 +++++----- tiup/tiup-component-dm-patch.md | 8 +++---- tiup/tiup-component-dm-reload.md | 12 +++++----- tiup/tiup-component-dm-restart.md | 4 ++-- tiup/tiup-component-dm-scale-in.md | 2 +- tiup/tiup-component-dm-start.md | 4 ++-- tiup/tiup-component-dm-stop.md | 4 ++-- tiup/tiup-dm-topology-reference.md | 10 ++++----- tiup/tiup-mirror-reference.md | 28 ++++++++++++------------ 24 files changed, 93 insertions(+), 93 deletions(-) diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md index eca5a0950dec..d691ec9283d2 100644 --- a/tiup/tiup-command-mirror-rotate.md +++ b/tiup/tiup-command-mirror-rotate.md @@ -51,7 +51,7 @@ tiup mirror rotate [flags] ### --addr(string,默认 0.0.0.0:8080) -临时服务器的监听地址,需要确保该地址可以被其他镜像管理员访问,这样他们才能使用[sign 命令](/tiup/tiup-command-mirror-sign.md)签名。 +临时服务器的监听地址,需要确保该地址可以被其他镜像管理员访问,这样管理员才能使用[sign 命令](/tiup/tiup-command-mirror-sign.md)签名。 ## 输出 diff --git a/tiup/tiup-component-cluster-disable.md b/tiup/tiup-component-cluster-disable.md index c40f2e20f40c..6059fd89d324 100644 --- a/tiup/tiup-component-cluster-disable.md +++ b/tiup/tiup-component-cluster-disable.md @@ -21,16 +21,16 @@ tiup cluster disable [flags] 指定要关闭自启的节点,该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 > **注意:** -> -> 若同时指定了 `-R, --role`,那么将关闭他们的交集中的服务自启。 +> +> 若同时指定了 `-R, --role`,那么将关闭它们的交集中的服务自启。 ### -R, --role strings(strings,默认为 [],未选中任何角色) 指定要关闭自启的角色,该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 > **注意:** -> -> 若同时指定了 `-N, --node`,那么将关闭他们的交集中的服务自启。 +> +> 若同时指定了 `-N, --node`,那么将关闭它们的交集中的服务自启。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-cluster-display.md b/tiup/tiup-component-cluster-display.md index 12c9f6b111bb..220ea820be4e 100644 --- a/tiup/tiup-component-cluster-display.md +++ b/tiup/tiup-component-cluster-display.md @@ -25,16 +25,16 @@ tiup cluster display [flags] 指定要查询的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 > **注意:** -> -> 若同时指定了 `-R, --role`,那么将查询他们的交集中的服务状态。 +> +> 若同时指定了 `-R, --role`,那么将查询它们的交集中的服务状态。 ### -R, --role strings(strings,默认为 [],表示所有角色) 指定要查询的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 > **注意:** -> -> 若同时指定了 `-N, --node`,那么将查询他们的交集中的服务状态。 +> +> 若同时指定了 `-N, --node`,那么将查询它们的交集中的服务状态。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-cluster-enable.md b/tiup/tiup-component-cluster-enable.md index b20ceb3495d3..863dbada2178 100644 --- a/tiup/tiup-component-cluster-enable.md +++ b/tiup/tiup-component-cluster-enable.md @@ -25,16 +25,16 @@ tiup cluster enable [flags] 指定要开启自启的节点,该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 > **注意:** -> -> 若同时指定了 `-R, --role`,那么将开启他们的交集中的服务自启。 +> +> 若同时指定了 `-R, --role`,那么将开启它们的交集中的服务自启。 ### -R, --role strings(strings,默认为 [],未选中任何角色) 指定要开启自启的角色,该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 > **注意:** -> -> 若同时指定了 `-N, --node`,那么将开启他们的交集中的服务自启。 +> +> 若同时指定了 `-N, --node`,那么将开启它们的交集中的服务自启。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-cluster-patch.md b/tiup/tiup-component-cluster-patch.md index bd1eb0ae1de9..900d5c335b12 100644 --- a/tiup/tiup-component-cluster-patch.md +++ b/tiup/tiup-component-cluster-patch.md @@ -7,7 +7,7 @@ title: tiup cluster patch 在集群运行过程中,如果需要动态替换某个服务的二进制文件(即替换过程中保持集群可用),那么可以使用 `tiup cluster patch` 命令,它会完成以下几件事情: - 将用于替换的二进制包上传到目标机器 -- 如果目标服务是 TiKV, TiFlash 或者 Binlog 之类的存储服务,则先通过 API 下线节点 +- 如果目标服务是 TiKV、TiFlash 或者 TiDB Binlog 之类的存储服务,则先通过 API 下线节点 - 停止目标服务 - 解压二进制包,替换服务 - 启动目标服务 @@ -40,7 +40,7 @@ tiup cluster patch [flags] 在重启 PD 或 TiKV 时,会先将被重启节点的 leader 迁移到其他节点,迁移过程会需要一定时间,可以通过设置 `--transfer-timeout` 设置最长等待时间(单位为秒),超时之后会跳过等待直接重启服务。 > **注意:** -> +> > 若出现跳过等待直接重启的情况,服务性能可能会出现抖动。 ### -N, --node(strings,默认为 [],未选中任何节点) @@ -48,16 +48,16 @@ tiup cluster patch [flags] 指定要替换的节点,该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 > **注意:** -> -> 若同时指定了 `-R, --role`,那么将替换他们的交集中的服务。 +> +> 若同时指定了 `-R, --role`,那么将替换它们的交集中的服务。 ### -R, --role strings(strings,默认为 [],未选中任何角色) 指定要替换的角色,该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 > **注意:** -> -> 若同时指定了 `-N, --node`,那么将替换他们的交集中的服务。 +> +> 若同时指定了 `-N, --node`,那么将替换它们的交集中的服务。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-cluster-reload.md b/tiup/tiup-component-cluster-reload.md index 3e60566aa64a..97943e453918 100644 --- a/tiup/tiup-component-cluster-reload.md +++ b/tiup/tiup-component-cluster-reload.md @@ -18,14 +18,14 @@ tiup cluster reload [flags] ### --force(boolean,默认 false) -忽略 reload 过程中的错误,强制 reload。 +忽略重新加载过程中的错误,强制 reload。 ### --transfer-timeout(uint,默认 300) 在重启 PD 或 TiKV 时,会先将被重启节点的 leader 迁移到其他节点,迁移过程会需要一定时间,可以通过设置 `--transfer-timeout` 设置最长等待时间(单位为秒),超时之后会跳过等待直接重启服务。 > **注意:** -> +> > 若出现跳过等待直接重启的情况,服务性能可能会出现抖动。 ### --ignore-config-check(boolean,默认 false) @@ -39,17 +39,17 @@ tiup cluster reload [flags] 指定要重启的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第一列。 > **注意:** -> -> 1. 若同时指定了 `-R, --role`,那么将重启他们的交集中的服务 -> 2. 若指定了选项 `--skip-restart`,则该选项无效 +> +> + 若同时指定了 `-R, --role`,那么将重启它们的交集中的服务 +> + 若指定了选项 `--skip-restart`,则该选项无效 ### -R, --role strings(strings,默认为 [],表示所有角色) 指定要重启的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-cluster-display.md)表格的第二列。 > **注意:** -> -> 1. 若同时指定了 `-N, --node`,那么将重启他们的交集中的服务 +> +> 1. 若同时指定了 `-N, --node`,那么将重启它们的交集中的服务 > 2. 若指定了选项 `--skip-restart`,则该选项无效 ### --skip-restart(boolean,默认 false) diff --git a/tiup/tiup-component-cluster-rename.md b/tiup/tiup-component-cluster-rename.md index 55f0cff4313c..14908f85d499 100644 --- a/tiup/tiup-component-cluster-rename.md +++ b/tiup/tiup-component-cluster-rename.md @@ -8,10 +8,10 @@ title: tiup cluster rename > **注意:** > -> 如果配置了 grafana_servers 的 dashboard_dir 字段,在执行 tiup cluster rename 命令进行集群重命名后,需要额外做以下操作: +> 如果配置了 `grafana_servers` 的 `dashboard_dir` 字段,在执行 tiup cluster rename 命令进行集群重命名后,需要额外做以下操作: > -> 1. 对于本地的 dashboards 目录中的 `*.json` 文件,将 datasource 字段的值更新为新的集群名(这是因为 datasource 是以集群名命名的) -> 2. 执行 tiup cluster reload -R grafana 命令 +> + 对于本地的 dashboards 目录中的 `*.json` 文件,将 datasource 字段的值更新为新的集群名(这是因为 datasource 是以集群名命名的) +> + 执行 `tiup cluster reload -R grafana` 命令 ## 语法 diff --git a/tiup/tiup-component-cluster-restart.md b/tiup/tiup-component-cluster-restart.md index f180295bd03e..2d217bf29b6e 100644 --- a/tiup/tiup-component-cluster-restart.md +++ b/tiup/tiup-component-cluster-restart.md @@ -26,7 +26,7 @@ tiup cluster restart [flags] > **注意:** > -> 若同时指定了 `-R, --role`,那么将重启他们的交集中的服务。 +> 若同时指定了 `-R, --role`,那么将重启它们的交集中的服务。 ### -R, --role strings(strings,默认为 [],表示所有角色) @@ -34,7 +34,7 @@ tiup cluster restart [flags] > **注意:** > -> 若同时指定了 `-N, --node`,那么将重启他们的交集中的服务。 +> 若同时指定了 `-N, --node`,那么将重启它们的交集中的服务。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-cluster-scale-in.md b/tiup/tiup-component-cluster-scale-in.md index dc3f37a0306f..a1cc8ff18d1e 100644 --- a/tiup/tiup-component-cluster-scale-in.md +++ b/tiup/tiup-component-cluster-scale-in.md @@ -35,10 +35,10 @@ tiup cluster scale-in [flags] ### --force(boolean,默认 false) -在某些情况下,有可能被缩容的节点宿主机已经宕机,导致无法通过 ssh 连接到节点进行操作,这个时候可以通过 `--force` 选项强制将其从集群中移除。 +在某些情况下,有可能被缩容的节点宿主机已经宕机,导致无法通过 SSH 连接到节点进行操作,这个时候可以通过 `--force` 选项强制将其从集群中移除。 > **注意:** -> +> > 强制移除 TiKV 节点不会等待数据调度,移除一个以上正在提供服务的 TiKV 节点会有数据丢失的风险。 ### --transfer-timeout(uint,默认 300) @@ -46,7 +46,7 @@ tiup cluster scale-in [flags] 在缩容 PD 或 TiKV 时,会先将被缩容节点的 leader 迁移到其他节点,迁移过程会需要一定时间,可以通过设置 `--transfer-timeout` 设置最长等待时间(单位为秒),超时之后会跳过等待直接缩容服务。 > **注意:** -> +> > 若出现跳过等待直接缩容的情况,服务性能可能会出现抖动。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-cluster-scale-out.md b/tiup/tiup-component-cluster-scale-out.md index cb31f6299e91..1ec96ad0f9fb 100644 --- a/tiup/tiup-component-cluster-scale-out.md +++ b/tiup/tiup-component-cluster-scale-out.md @@ -31,9 +31,9 @@ tiup cluster scale-out [flags] ### --no-labels(boolean,默认 false) -当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 Region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来告诉 PD 不要将相同的 region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology-labels.md))。 +当两个或多个 TiKV 部署到同一台机器时,会存在一个风险:由于 PD 无法感知集群的拓扑结构,可能将一个 Region 的多个副本调度到一台物理机上的不同 TiKV,这样这台物理机就成为了单点。为了避免这种情况,用户可以通过 label 来指定 PD 不要将相同的 Region 调度到同一台机器上(配置方式参考[通过拓扑 label 进行副本调度](/schedule-replicas-by-topology-labels.md))。 -但是对于测试环境,可能并不在意是否将一个 region 的副本调度到了同一台机器上,这个时候可以使用 `--no-labels` 来绕过检查。 +但是对于测试环境,可能并不在意是否将一个 Region 的副本调度到了同一台机器上,这个时候可以使用 `--no-labels` 来绕过检查。 ### --skip-create-user(boolean,false) diff --git a/tiup/tiup-component-cluster-start.md b/tiup/tiup-component-cluster-start.md index 4a4b9d954b40..d195aa5b88e6 100644 --- a/tiup/tiup-component-cluster-start.md +++ b/tiup/tiup-component-cluster-start.md @@ -22,7 +22,7 @@ tiup cluster start [flags] > **注意:** > -> 若同时指定了 `-R, --role`,那么将启动他们的交集中的服务。 +> 若同时指定了 `-R, --role`,那么将启动它们的交集中的服务。 ### -R, --role strings(strings,默认为 [],表示所有角色) @@ -30,7 +30,7 @@ tiup cluster start [flags] > **注意:** > -> 若同时指定了 `-N, --node`,那么将启动他们的交集中的服务。 +> 若同时指定了 `-N, --node`,那么将启动它们的交集中的服务。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-cluster-stop.md b/tiup/tiup-component-cluster-stop.md index 9ffde0f4664e..02faf458343c 100644 --- a/tiup/tiup-component-cluster-stop.md +++ b/tiup/tiup-component-cluster-stop.md @@ -26,7 +26,7 @@ tiup cluster stop [flags] > **注意:** > -> 若同时指定了 `-R, --role`,那么将停止他们的交集中的服务。 +> 若同时指定了 `-R, --role`,那么将停止它们的交集中的服务。 ### -R, --role strings(strings,默认为 [],表示所有角色) @@ -34,7 +34,7 @@ tiup cluster stop [flags] > **注意:** > -> 若同时指定了 `-N, --node`,那么将停止他们的交集中的服务。 +> 若同时指定了 `-N, --node`,那么将停止它们的交集中的服务。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-cluster.md b/tiup/tiup-component-cluster.md index 8c042507c37d..d69ef088d4b0 100644 --- a/tiup/tiup-component-cluster.md +++ b/tiup/tiup-component-cluster.md @@ -4,7 +4,7 @@ title: TiUP Cluster # TiUP Cluster -TiUP Cluster 是 TiUP 提供的使用 Golang 编写的集群管理组件,通过 TiUP cluster 组件就可以进行日常的运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 TiDB 集群、管理 TiDB 集群参数。 +TiUP Cluster 是 TiUP 提供的使用 Golang 编写的集群管理组件,通过 TiUP Cluster 组件就可以进行日常的运维工作,包括部署、启动、关闭、销毁、弹性扩缩容、升级 TiDB 集群、管理 TiDB 集群参数。 ## 语法 @@ -18,19 +18,19 @@ tiup cluster [command] [flags] ### --ssh (string,默认 builtin) -指定 SSH 客户端连接远端(部署 TiDB 服务的机器)执行命令,支持以下几个值: +指定 SSH 客户端连接远端(部署 TiDB 服务的机器)执行命令,支持以下值: - builtin:使用 tiup-cluster 内置的 easyssh 客户端 -- system:使用当前操作系统默认的 ssh 客户端 +- system:使用当前操作系统默认的 SSH 客户端 - none:不使用 ssh 客户端,这种方式只支持部署到当前机器 ### --ssh-timeout(uint,默认 5) -设置 ssh 连接超时时间,单位为秒。 +设置 SSH 连接超时时间,单位为秒。 ### --wait-timeout(uint,默认 120) -运维过程中涉及到很多操作:指定 systemctl 启动/停止服务,等待端口上线/下线等,每个操作可能会消耗数秒,`--wait-timeout` 用于设置每个步骤的最长等待时间(单位为秒),超时后报错退出。 +运维过程中涉及到很多操作:指定 systemctl 启动/停止服务,等待端口上线/下线等,每个操作可能会消耗数秒。`--wait-timeout` 用于设置每个步骤的最长等待时间(单位为秒),超时后报错退出。 ### -y, --yes (boolean,默认 false) diff --git a/tiup/tiup-component-dm-display.md b/tiup/tiup-component-dm-display.md index db1036cc93c9..ad0adc833f07 100644 --- a/tiup/tiup-component-dm-display.md +++ b/tiup/tiup-component-dm-display.md @@ -22,7 +22,7 @@ tiup dm display [flags] > **注意:** > -> 若同时指定了 `-R, --role`,那么将查询他们的交集中的服务状态。 +> 若同时指定了 `-R, --role`,那么将查询它们的交集中的服务状态。 ### -R, --role strings(strings,默认为 [],表示所有角色) @@ -30,7 +30,7 @@ tiup dm display [flags] > **注意:** > -> 若同时指定了 `-N, --node`,那么将查询他们的交集中的服务状态。 +> 若同时指定了 `-N, --node`,那么将查询它们的交集中的服务状态。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-dm-edit-config.md b/tiup/tiup-component-dm-edit-config.md index 92dedcae785d..69eccecfdb4c 100644 --- a/tiup/tiup-component-dm-edit-config.md +++ b/tiup/tiup-component-dm-edit-config.md @@ -4,12 +4,12 @@ title: tiup dm edit-config # tiup dm edit-config -在部署集群之后,如果需要再调整集群服务的配置,则可以使用命令 `tiup dm edit-config`,它会启动一个编辑器(默认为 $EDITOR 环境变量指定的值,当 EDITOR 环境变量不存在时,使用 vi 打开)允许用户修改指定集群的[拓扑文件](/tiup/tiup-dm-topology-reference.md)。 +在部署集群之后,如果需要再调整集群服务的配置,则可以使用命令 `tiup dm edit-config`,它会启动一个编辑器(默认为 `$EDITOR` 环境变量指定的值,当 EDITOR 环境变量不存在时,使用 vi 打开)允许用户修改指定集群的[拓扑文件](/tiup/tiup-dm-topology-reference.md)。 > **注意:** -> -> 1. 修改配置时不能增删机器,增删机器属于[集群扩容](/tiup/tiup-component-dm-scale-out.md)和[集群缩容](/tiup/tiup-component-dm-scale-in.md)的功能。 -> 2. 执行完该命令后配置只是在中控机上修改了,要应用配置需要执行 `tiup dm relaod` 命令来重新加载。 +> +> + 修改配置时不能增删机器,增删机器属于[集群扩容](/tiup/tiup-component-dm-scale-out.md)和[集群缩容](/tiup/tiup-component-dm-scale-in.md)的功能。 +> + 执行完该命令后配置只是在中控机上修改了,要应用配置需要执行 `tiup dm relaod` 命令来重新加载。 ## 语法 diff --git a/tiup/tiup-component-dm-import.md b/tiup/tiup-component-dm-import.md index 76c72ec710c7..980a74a27399 100644 --- a/tiup/tiup-component-dm-import.md +++ b/tiup/tiup-component-dm-import.md @@ -4,15 +4,15 @@ title: tiup dm import # tiup dm import -在 DM 1.0 版本,集群基本是通过 TiDB Ansible 部署的,TiUP DM 提供了 `import` 命令导入 1.0 的集群并重新部署 2.0 的集群。 +在 DM 1.0 版本,集群基本是通过 TiDB Ansible 部署的,TiUP DM 提供了 `import` 命令导入 v1.0 的集群并重新部署 v2.0 的集群。 > **注意:** > -> - 不支持导入 1.0 集群中的 DM Portal 组件 +> - 不支持导入 v1.0 集群中的 DM Portal 组件 > - 导入前请先停止原集群 -> - 对于需要升级到 2.0 的数据迁移任务,请不要执行 `stop-task` +> - 对于需要升级到 v2.0 的数据迁移任务,请不要执行 `stop-task` > - 仅支持导入到 v2.0.0-rc.2 或更高版本 -> - `import` 命令用于将 DM 1.0 集群导入到全新的 2.0 集群。如果需要将数据迁移任务导入到已有的 2.0 集群,请参考 [TiDB Data Migration 1.0.x 到 2.0.x 手动升级](https://docs.pingcap.com/zh/tidb-data-migration/stable/manually-upgrade-dm-1.0-to-2.0) +> - `import` 命令用于将 DM v1.0 集群导入到全新的 v2.0 集群。如果需要将数据迁移任务导入到已有的 v2.0 集群,请参考 [TiDB Data Migration 1.0.x 到 2.0.x 手动升级](https://docs.pingcap.com/zh/tidb-data-migration/stable/manually-upgrade-dm-1.0-to-2.0) > - 部分组件生成的部署目录会跟原集群不一样,具体可以使用 `display` 命令查看 > - 导入前运行 `tiup update --self && tiup update dm` 确认升级 TiUP DM 组件到最新版本 > - 导入后集群中仅会有一个 DM-master 节点,可参考[扩容节点](/tiup/tiup-component-dm-scale-out.md)对 DM-master 进行扩容 @@ -39,7 +39,7 @@ tiup dm import [flags] ### --rename(string,默认为空) -重命名导入的集群。默认集群名为 inventory 中指定的 cluster_name。 +重命名导入的集群。默认集群名为 inventory 中指定的 `cluster_name`。 ### -h, --help(boolean,默认 false) @@ -47,4 +47,4 @@ tiup dm import [flags] ## 输出 -import 过程的日志信息。 \ No newline at end of file +导入过程的日志信息。 diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index ddb4239e51ed..edc906d0f0e5 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -40,16 +40,16 @@ tiup dm patch [flags] 指定要替换的节点,该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-dm-display.md)表格的第一列。 > **注意:** -> -> 若同时指定了 `-R, --role`,那么将替换他们的交集中的服务。 +> +> 若同时指定了 `-R, --role`,那么将替换它们的交集中的服务。 ### -R, --role strings(strings,默认为 [],未选中任何角色) 指定要替换的角色,该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-dm-display.md)表格的第二列。 > **注意:** -> -> 若同时指定了 `-N, --node`,那么将替换他们的交集中的服务。 +> +> 若同时指定了 `-N, --node`,那么将替换它们的交集中的服务。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-dm-reload.md b/tiup/tiup-component-dm-reload.md index f7626825a19e..c76920715136 100644 --- a/tiup/tiup-component-dm-reload.md +++ b/tiup/tiup-component-dm-reload.md @@ -21,18 +21,18 @@ tiup dm reload [flags] 指定要重启的节点,不指定则表示所有节点。该选项的值为以逗号分割的节点 ID 列表,节点 ID 为[集群状态](/tiup/tiup-component-dm-display.md)表格的第一列。 > **注意:** -> -> 1. 若同时指定了 `-R, --role`,那么将重启他们的交集中的服务 -> 2. 若指定了选项 `--skip-restart`,则该选项无效 +> +> + 若同时指定了 `-R, --role`,那么将重启它们的交集中的服务 +> + 若指定了选项 `--skip-restart`,则该选项无效 ### -R, --role strings(strings,默认为 [],表示所有角色) 指定要重启的角色,不指定则表示所有角色。该选项的值为以逗号分割的节点角色列表,角色为[集群状态](/tiup/tiup-component-dm-display.md)表格的第二列。 > **注意:** -> -> 1. 若同时指定了 `-N, --node`,那么将重启他们的交集中的服务 -> 2. 若指定了选项 `--skip-restart`,则该选项无效 +> +> + 若同时指定了 `-N, --node`,那么将重启它们的交集中的服务 +> + 若指定了选项 `--skip-restart`,则该选项无效 ### --skip-restart(boolean,默认 false) diff --git a/tiup/tiup-component-dm-restart.md b/tiup/tiup-component-dm-restart.md index 7cd29bf0e49e..f49d57559ee4 100644 --- a/tiup/tiup-component-dm-restart.md +++ b/tiup/tiup-component-dm-restart.md @@ -26,7 +26,7 @@ tiup dm restart [flags] > **注意:** > -> 若同时指定了 `-R, --role`,那么将重启他们的交集中的服务。 +> 若同时指定了 `-R, --role`,那么将重启它们的交集中的服务。 ### -R, --role strings(strings,默认为 [],表示所有角色) @@ -34,7 +34,7 @@ tiup dm restart [flags] > **注意:** > -> 若同时指定了 `-N, --node`,那么将重启他们的交集中的服务。 +> 若同时指定了 `-N, --node`,那么将重启它们的交集中的服务。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-dm-scale-in.md b/tiup/tiup-component-dm-scale-in.md index edf27de37e7b..b99ccbdad8fa 100644 --- a/tiup/tiup-component-dm-scale-in.md +++ b/tiup/tiup-component-dm-scale-in.md @@ -22,7 +22,7 @@ tiup dm scale-in [flags] ### --force(boolean,默认 false) -在某些情况下,有可能被缩容的节点宿主机已经宕机,导致无法通过 ssh 连接到节点进行操作,这个时候可以通过 `--force` 选项强制将其从集群中移除。 +在某些情况下,有可能被缩容的节点宿主机已经宕机,导致无法通过 SSH 连接到节点进行操作,这个时候可以通过 `--force` 选项强制将其从集群中移除。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-dm-start.md b/tiup/tiup-component-dm-start.md index 60c50afacb73..0049ad26d5a7 100644 --- a/tiup/tiup-component-dm-start.md +++ b/tiup/tiup-component-dm-start.md @@ -22,7 +22,7 @@ tiup dm start [flags] > **注意:** > -> 若同时指定了 `-R, --role`,那么将启动他们的交集中的服务。 +> 若同时指定了 `-R, --role`,那么将启动它们的交集中的服务。 ### -R, --role strings(strings,默认为 [],表示所有角色) @@ -30,7 +30,7 @@ tiup dm start [flags] > **注意:** > -> 若同时指定了 `-N, --node`,那么将启动他们的交集中的服务。 +> 若同时指定了 `-N, --node`,那么将启动它们的交集中的服务。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-component-dm-stop.md b/tiup/tiup-component-dm-stop.md index 813b5f903184..b676c51fce66 100644 --- a/tiup/tiup-component-dm-stop.md +++ b/tiup/tiup-component-dm-stop.md @@ -26,7 +26,7 @@ tiup dm stop [flags] > **注意:** > -> 若同时指定了 `-R, --role`,那么将停止他们的交集中的服务。 +> 若同时指定了 `-R, --role`,那么将停止它们的交集中的服务。 ### -R, --role strings(strings,默认为 [],表示所有角色) @@ -34,7 +34,7 @@ tiup dm stop [flags] > **注意:** > -> 若同时指定了 `-N, --node`,那么将停止他们的交集中的服务。 +> 若同时指定了 `-N, --node`,那么将停止它们的交集中的服务。 ### -h, --help(boolean,默认 false) diff --git a/tiup/tiup-dm-topology-reference.md b/tiup/tiup-dm-topology-reference.md index b0017bb07f0e..124c299dbf40 100644 --- a/tiup/tiup-dm-topology-reference.md +++ b/tiup/tiup-dm-topology-reference.md @@ -4,7 +4,7 @@ title: 通过 TiUP 部署 DM 集群的拓扑文件配置 # 通过 TiUP 部署 DM 集群的拓扑文件配置 -在部署或扩容 DM 集群时,需要提供一份拓扑文件来描述集群拓扑,同样,修改配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。 +在部署或扩容 TiDB Data Migration (DM) 集群时,需要提供一份拓扑文件来描述集群拓扑,同样,修改配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。 拓扑文件[示例参考](https://github.com/pingcap/tiup/blob/master/examples/dm/topology.example.yaml)。 @@ -44,7 +44,7 @@ title: 通过 TiUP 部署 DM 集群的拓扑文件配置 - `arch`:目标机器的 CPU 架构,该字段决定了向目标机器推送哪个平台的二进制包,支持 amd64 和 arm64,默认值:amd64 - `resource_control`:运行时资源控制,该字段下所有配置都将写入 systemd 的 service 文件中,默认不限制,支持控制的资源: - `memory_limit`: 限制运行时最大内存,例如 "2G" 表示最多使用 2GB 内存 - - `cpu_quota`:限制运行时最大 CPU 占用率,例如 "200%" + - `cpu_quota`:限制运行时最大 CPU 占用率,例如 "200%" - `io_read_bandwidth_max`:读磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" - `io_write_bandwidth_max`:写磁盘 IO 的最大带宽,例如:"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 100M" - `limit_core`:控制 core dump 大小 @@ -58,7 +58,7 @@ global: memory_limit: "2G" ``` -上述配置指定使用 tidb 用户启动集群,同时限制每个组件运行时最多只能使用 2GB 内存。 +上述配置指定使用 `tidb` 用户启动集群,同时限制每个组件运行时最多只能使用 2GB 内存。 ### `server_configs` @@ -193,7 +193,7 @@ worker_servers: - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点 ID,比如 "0,1" - `storage_retention`:Prometheus 监控数据保留时间,默认 "15d" -- `rule_dir`:该字段指定一个本地目录,该目录中应当含有完整的 *.rules.yml 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 +- `rule_dir`:该字段指定一个本地目录,该目录中应当含有完整的 `*.rules.yml` 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Prometheus 的规则 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` @@ -228,7 +228,7 @@ monitoring_servers: - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `username`:Grafana 登陆界面的用户名 - `password`:Grafana 对应的密码 -- `dashboard_dir`:该字段指定一个本地目录,该目录中应当含有完整的 dashboard(*.json) 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards +- `dashboard_dir`:该字段指定一个本地目录,该目录中应当含有完整的 `dashboard(*.json)` 文件,这些文件会在集群配置初始化阶段被传输到目标机器上,作为 Grafana 的 dashboards - `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global`中的 `resource_control` > **注意:** diff --git a/tiup/tiup-mirror-reference.md b/tiup/tiup-mirror-reference.md index 516889b99b65..3850c8aa64c6 100644 --- a/tiup/tiup-mirror-reference.md +++ b/tiup/tiup-mirror-reference.md @@ -36,9 +36,9 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 |-- {N}.root.json |-- {N}.{component}.json |-- {N}.index.json - |-- {component}-{version}-{os}-{arch}.tar.gz + |-- {component}-{version}-{os}-{arch}.tar.gz |-- snapshot.json - |-- timestamp.json + |-- timestamp.json |--+ keys # 镜像私钥(可移动到其他位置) |-- {hash1..hashN}-root.json # 根证书私钥 |-- {hash}-index.json # 索引私钥 @@ -48,8 +48,8 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 > **注意:** > -> 1. commits 目录是在更新镜像过程中产生的日志,用于回滚镜像,磁盘空间不足时可以定期删除旧的文件夹 -> 2. keys 文件夹中存放的私钥较敏感,建议单独妥善保管 +> + commits 目录是在更新镜像过程中产生的日志,用于回滚镜像,磁盘空间不足时可以定期删除旧的文件夹 +> + keys 文件夹中存放的私钥较敏感,建议单独妥善保管 ### 根证书 @@ -128,7 +128,7 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 "owner": "{owner-id}", # 组件管理员 ID "standalone": {bool}, # 该组件是否可独立运行 "url": "/{component}.json", # 获取组件的地址,需要加上版本号:/{N}.{component}.json - "yanked": {bool} # 该组件是否已被标记为删除 + "yanked": {bool} # 该组件是否已被标记为删除 }, ... "{componentN}": { # 第 N 个组件的名称 @@ -299,13 +299,13 @@ TiUP 镜像是 TiUP 的组件仓库,存放了一些列的组件和这些组件 客户端通过以下逻辑保证从镜像下载到的文件是安全的: -1. 客户端安装时随 binary 附带了一个 root.json -2. 客户端运行时以已有的 root.json 为基础,做如下操作: - a. 获取 root.json 中的 version,记为 N - b. 向镜像请求 {N+1}.root.json,若成功,使用 root.json 中记录的公钥验证该文件是否合法 -3. 向镜像请求 timestamp.json,并使用 root.json 中记录的公钥验证该文件是否合法 -4. 检查 timestamp.json 中记录的 snapshot.json 的 checksum 和本地的 snapshot.json 的 checksum 是否吻合 ++ 客户端安装时随 binary 附带了一个 root.json ++ 客户端运行时以已有的 root.json 为基础,做如下操作: + 1. 获取 root.json 中的 version,记为 N + 2. 向镜像请求 {N+1}.root.json,若成功,使用 root.json 中记录的公钥验证该文件是否合法 ++ 向镜像请求 timestamp.json,并使用 root.json 中记录的公钥验证该文件是否合法 ++ 检查 timestamp.json 中记录的 snapshot.json 的 checksum 和本地的 snapshot.json 的 checksum 是否吻合 - 若不吻合,则向镜像请求最新的 snapshot.json 并使用 root.json 中记录的公钥验证该文件是否合法 -5. 对于 index.json 文件,从 snapshot.json 中获取其版本号 N,并请求 {N}.index.json,然后使用 root.json 中记录的公钥验证该文件是否合法 -6. 对于组件(如 tidb.json,tikv.json),从 snapshot.json 中获取其版本号 N,并请求 {N}.{component}.json,然后使用 index.json 中记录的公钥验证该文件是否合法 -7. 对于组件 tar 文件,从 {component}.json 中获取其 url 及 checksum,请求 url 得到 tar 包,并验证 checksum 是否正确 ++ 对于 index.json 文件,从 snapshot.json 中获取其版本号 N,并请求 {N}.index.json,然后使用 root.json 中记录的公钥验证该文件是否合法 ++ 对于组件(如 tidb.json,tikv.json),从 snapshot.json 中获取其版本号 N,并请求 {N}.{component}.json,然后使用 index.json 中记录的公钥验证该文件是否合法 ++ 对于组件 tar 文件,从 {component}.json 中获取其 url 及 checksum,请求 url 得到 tar 包,并验证 checksum 是否正确 From dce141115a625db82917ce0a6dd6578e86724714 Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 22 Feb 2021 10:55:31 +0800 Subject: [PATCH 46/56] Resolve comment --- tiup/tiup-command-completion.md | 2 +- tiup/tiup-command-env.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tiup/tiup-command-completion.md b/tiup/tiup-command-completion.md index d4a11f6d2e9c..2c4d332bdb44 100644 --- a/tiup/tiup-command-completion.md +++ b/tiup/tiup-command-completion.md @@ -23,7 +23,7 @@ tiup completion ### bash -将自动补全代码写入一个文件,并且在 .bash_profile 中 source 之: +将自动补全代码写入一个文件,并且在 .bash_profile 中对其执行 source: ```sh tiup completion bash > ~/.tiup.completion.bash diff --git a/tiup/tiup-command-env.md b/tiup/tiup-command-env.md index 7762c0953a35..7335bd008dc2 100644 --- a/tiup/tiup-command-env.md +++ b/tiup/tiup-command-env.md @@ -23,4 +23,4 @@ tiup env [name1...N] - 若未指定 `[name1...N]`,则输出 "{key}"="{value}" 列表 - 若指定了 `[name1...N]`,则按顺序输出 "{value}" 列表 -以上输出若 value 为空则代表其值未设置,此时 TiUP 会使用默认参数。 +以上输出中若 `value` 为空则代表未设置环境变量的值,此时 TiUP 会使用默认值。 From ecbe08f075474b49b2e864d8cc629b9681916e37 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Mon, 22 Feb 2021 11:04:06 +0800 Subject: [PATCH 47/56] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> Co-authored-by: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> --- tiup/tiup-cluster-topology-reference.md | 4 ++-- tiup/tiup-command-completion.md | 2 +- tiup/tiup-command-install.md | 2 +- tiup/tiup-command-mirror-clone.md | 4 ++-- tiup/tiup-command-mirror-rotate.md | 2 +- tiup/tiup-component-cluster-check.md | 6 +++--- tiup/tiup-component-cluster-destroy.md | 4 ++-- tiup/tiup-component-cluster-import.md | 6 +++--- tiup/tiup-component-cluster-list.md | 4 ++-- tiup/tiup-component-dm-audit.md | 4 ++-- tiup/tiup-component-dm-list.md | 4 ++-- tiup/tiup-component-dm-prune.md | 4 ++-- tiup/tiup-reference.md | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index 165329f66d6b..e06028a40b4f 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -374,11 +374,11 @@ drainer_servers: ### `cdc_servers` -`cdc_servers` 约定了将 CDC 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,`cdc_servers` 是一个数组,每个数组元素包含以下字段: +`cdc_servers` 约定了将 TiCDC 服务部署到哪些机器上,同时可以指定每台机器上的服务配置,`cdc_servers` 是一个数组,每个数组元素包含以下字段: - `host`:指定部署到哪台机器,字段值填 IP 地址,不可省略 - `ssh_port`:指定连接目标机器进行操作的时候使用的 SSH 端口,若不指定,则使用 `global` 区块中的 `ssh_port` -- `port`:CDC 服务的监听端口,默认 8300 +- `port`:TiCDC 服务的监听端口,默认 8300 - `deploy_dir`:指定部署目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `deploy_dir` 生成 - `log_dir`:指定日志目录,若不指定,或指定为相对目录,则按照 `global` 中配置的 `log_dir` 生成 - `gc-ttl`:TiCDC 在 PD 设置的服务级别 GC safepoint 的 TTL (Time To Live) 时长,单位为秒,默认值为 86400,即 24 小时 diff --git a/tiup/tiup-command-completion.md b/tiup/tiup-command-completion.md index d4a11f6d2e9c..486dbbb44a14 100644 --- a/tiup/tiup-command-completion.md +++ b/tiup/tiup-command-completion.md @@ -8,7 +8,7 @@ title: tiup completion 如果是 bash,需要提前安装好 bash-completion: -- macOS 的安装方式为:`brew install bash-completion` 或者 `brew install bash-completion@2`(Bash 4.1+) +- macOS 的安装方式为:如果 Bash 版本小于 4.1,运行 `brew install bash-completion`;如果 Bash 版本大于等于 4.1,则运行 `brew install bash-completion@2`。 - Linux 的安装方式为:使用包管理器安装 `bash-completion` 包,例如 `yum install bash-completion` 或者 `apt install bash-completion` ## 语法 diff --git a/tiup/tiup-command-install.md b/tiup/tiup-command-install.md index b195b711b51d..7f3f6dd8dd7a 100644 --- a/tiup/tiup-command-install.md +++ b/tiup/tiup-command-install.md @@ -4,7 +4,7 @@ title: tiup install # tiup install -命令 `tiup install` 用于组件安装,它会从镜像仓库中下载指定版本的组件包,并在本地的 TiUP 数据目录中解压,以便后续使用。另外,当 TiUP 运行一个不存在组件的时候,会尝试先下载该组件,再自动运行,若还不存在再报错。 +命令 `tiup install` 用于组件安装,它会从镜像仓库中下载指定版本的组件包,并在本地的 TiUP 数据目录中解压,以便后续使用。另外,当 TiUP 需要运行一个镜像仓库中不存在的组件时,会尝试先下载该组件,再自动运行,若仓库中不存在会报错。 ## 语法 diff --git a/tiup/tiup-command-mirror-clone.md b/tiup/tiup-command-mirror-clone.md index 2b1348712aee..d9b66f307005 100644 --- a/tiup/tiup-command-mirror-clone.md +++ b/tiup/tiup-command-mirror-clone.md @@ -13,7 +13,7 @@ tiup mirror clone [global version] [flags] ``` - `` 是本地存放克隆下来的镜像的路径,如果不存在则会自动创建。 -- `[global version]` 若指定了该参数,会尝试克隆指定版本的所有组件。若某些组件没有指定的版本,则克隆其最新版本。 +- 若指定了 `[global version]` 参数,TiUP 会尝试克隆指定版本的所有组件。若某些组件没有指定的版本,则克隆其最新版本。 ## 选项 @@ -35,4 +35,4 @@ tiup mirror clone [global version] [flags] ### --{component}(strings,默认为空) -指定要克隆的 `{component}` 组件的版本列表。`{component}` 为组件名,可选的组件名可执行 [tiup list --all](/tiup/tiup-command-list.md) 查看。 +指定要克隆的 `{component}` 组件的版本列表。`{component}` 为组件名,可选的组件名可执行 [`tiup list --all`](/tiup/tiup-command-list.md) 查看。 diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md index d691ec9283d2..c2efeec4f0f1 100644 --- a/tiup/tiup-command-mirror-rotate.md +++ b/tiup/tiup-command-mirror-rotate.md @@ -16,7 +16,7 @@ TiUP 的镜像中有一个非常重要的文件:root.json,里面记录了整 关于镜像的详细介绍可以参考[镜像说明](/tiup/tiup-mirror-reference.md)。 -在某些情况下,我们需要更新 root.json: +在某些情况下,用户需要更新 root.json: - 更换镜像的密钥 - 更新证书过期时间 diff --git a/tiup/tiup-component-cluster-check.md b/tiup/tiup-component-cluster-check.md index 4e856475c5da..a0c4ca9a5292 100644 --- a/tiup/tiup-component-cluster-check.md +++ b/tiup/tiup-component-cluster-check.md @@ -4,7 +4,7 @@ title: tiup cluster check # tiup cluster check -对于严肃的生产环境,在正式上线之前需要进行一系列检查,来确保集群拥有最好的表现,为了简化人工检查的步骤,tiup-cluster 提供了 `check` 子命令,该命令用于检查指定集群的机器硬件和软件环境是否满足正常运行条件。 +对于严肃的生产环境,在正式上线之前需要进行一系列检查,来确保集群拥有最好的表现。为了简化人工检查的步骤,TiUP Cluster 提供了 `check` 子命令,用于检查指定集群的机器硬件和软件环境是否满足正常运行条件。 ## 检查项列表 @@ -47,7 +47,7 @@ title: tiup cluster check 检查部署机是否启用透明大页:建议禁用透明大页。 -### 系统 Limits +### 系统限制 检查 /etc/security/limits.conf 中各项 limit 值: @@ -192,4 +192,4 @@ tiup cluster check [flags] - Node:目标节点 - Check:检查项 - Result:检查结果(Pass/Warn/Fail) -- Message:结果描述 \ No newline at end of file +- Message:结果描述 diff --git a/tiup/tiup-component-cluster-destroy.md b/tiup/tiup-component-cluster-destroy.md index 547077fdb0c3..c020b9397d62 100644 --- a/tiup/tiup-component-cluster-destroy.md +++ b/tiup/tiup-component-cluster-destroy.md @@ -22,7 +22,7 @@ tiup cluster destroy [flags] ### --force(boolean,默认 false) -在某些情况下,有可能集群中的某些节点已经宕机,导致无法通过 ssh 连接到节点进行操作,这个时候可以通过 `--force` 选项忽略这些错误。 +在某些情况下,有可能集群中的某些节点已经宕机,导致无法通过 SSH 连接到节点进行操作,这个时候可以通过 `--force` 选项忽略这些错误。 ### --retain-node-data(StringArray,默认为空) @@ -38,4 +38,4 @@ tiup cluster destroy [flags] ## 输出 -tiup-cluster 的执行日志。 \ No newline at end of file +tiup-cluster 的执行日志。 diff --git a/tiup/tiup-component-cluster-import.md b/tiup/tiup-component-cluster-import.md index 0493b5be2335..7de16a0ef27b 100644 --- a/tiup/tiup-component-cluster-import.md +++ b/tiup/tiup-component-cluster-import.md @@ -4,7 +4,7 @@ title: tiup cluster import # tiup cluster import -在 TiDB 4.0 以前的版本,集群基本是通过 TiDB Ansible 部署的。TiUP Cluster 提供了 `import` 命令用于让这些集群过渡到使用 tiup-cluster 组件接管。 +在 TiDB 4.0 以前的版本,集群多是通过 TiDB Ansible 部署的。TiUP Cluster 提供了 `import` 命令用于让这些集群过渡到使用 tiup-cluster 组件管理。 > **注意:** > @@ -40,7 +40,7 @@ tiup cluster import [flags] ### --no-backup(boolean,默认 false) -默认情况下,import 成功之后会将 `--dir` 指定的目录里所有内容备份到 `${TIUP_HOME}/.tiup/storage/cluster/clusters/{cluster-name}/ansible-backup` 下面。该选项用于禁用这个步骤,这在该目录下有多个 inventory 文件(部署了多个集群)的时候很有用。 +默认情况下,导入成功之后会将 `--dir` 指定的目录里所有内容备份到 `${TIUP_HOME}/.tiup/storage/cluster/clusters/{cluster-name}/ansible-backup` 下。该选项用于禁用默认的备份步骤,如果该目录下有多个 inventory 文件(部署了多个集群),推荐禁用默认备份。 ### --rename(string,默认为空) @@ -52,4 +52,4 @@ tiup cluster import [flags] ## 输出 -import 过程的日志信息。 \ No newline at end of file +导入过程的日志信息。 diff --git a/tiup/tiup-component-cluster-list.md b/tiup/tiup-component-cluster-list.md index adda0876f90d..2fd86d1b7373 100644 --- a/tiup/tiup-component-cluster-list.md +++ b/tiup/tiup-component-cluster-list.md @@ -8,7 +8,7 @@ tiup-cluster 支持使用同一个中控机部署多套集群,而命令 `tiup > **注意:** > -> 部署的集群数据默认放在 `~/.tiup/storage/cluster/clusters/` 目录下,因此在同一台中控机上,用户 A 部署的集群用户 B 是看不到的。 +> 部署的集群数据默认放在 `~/.tiup/storage/cluster/clusters/` 目录下,因此在同一台中控机上,当前登录用户无法查看其他用户部署的集群。 ## 语法 @@ -30,4 +30,4 @@ tiup cluster list [flags] - User:部署用户 - Version:集群版本 - Path:集群部署数据在中控机上的路径 -- PrivateKey:连接集群的私钥所在路径 \ No newline at end of file +- PrivateKey:连接集群的私钥所在路径 diff --git a/tiup/tiup-component-dm-audit.md b/tiup/tiup-component-dm-audit.md index 09dde8ef0546..6e35235e105c 100644 --- a/tiup/tiup-component-dm-audit.md +++ b/tiup/tiup-component-dm-audit.md @@ -4,7 +4,7 @@ title: tiup dm audit # tiup dm audit -命令 `tiup dm audit` 可以用于查看历史上对所有集群执行了什么命令,以及每个命令的执行日志。 +命令 `tiup dm audit` 可以用于查看执行在所有集群上的历史命令,以及每个命令的执行日志。 ## 语法 @@ -27,4 +27,4 @@ tiup dm audit [audit-id] [flags] - 若不指定 `[audit-id]` 则输出含有以下字段的表格: - ID:该条记录对应的 audit-id - Time:该条记录对应的命令执行时间 - - Command:该条记录对应的命令 \ No newline at end of file + - Command:该条记录对应的命令 diff --git a/tiup/tiup-component-dm-list.md b/tiup/tiup-component-dm-list.md index b98a440e7f84..9075fea2087c 100644 --- a/tiup/tiup-component-dm-list.md +++ b/tiup/tiup-component-dm-list.md @@ -8,7 +8,7 @@ tiup-dm 支持使用同一个中控机部署多套集群,而命令 `tiup dm li > **注意:** > -> 部署的集群数据默认放在 `~/.tiup/storage/dm/clusters/` 目录下,因此在同一台中控机上,用户 A 部署的集群用户 B 是看不到的。 +> 部署的集群数据默认放在 `~/.tiup/storage/dm/clusters/` 目录下,因此在同一台中控机上,当前登录用户无法查看其他用户部署的集群。 ## 语法 @@ -30,4 +30,4 @@ tiup dm list [flags] - User:部署用户 - Version:集群版本 - Path:集群部署数据在中控机上的路径 -- PrivateKey:连接集群的私钥所在路径 \ No newline at end of file +- PrivateKey:连接集群的私钥所在路径 diff --git a/tiup/tiup-component-dm-prune.md b/tiup/tiup-component-dm-prune.md index 23c27f4d95a6..d1c3a995eae3 100644 --- a/tiup/tiup-component-dm-prune.md +++ b/tiup/tiup-component-dm-prune.md @@ -4,7 +4,7 @@ title: tiup dm prune # tiup dm prune -在[缩容集群](/tiup/tiup-component-dm-scale-in.md)后,ETCD 中仍然会有少量元信息不会被清理,通常不会有问题,如果确实需要清理,可以手动执行 `tiup cluster prune` 命令清理。 +在[缩容集群](/tiup/tiup-component-dm-scale-in.md)后,etcd 中仍然会有少量元信息不会被清理,通常不会有问题,如果确实需要清理,可以手动执行 `tiup cluster prune` 命令清理。 ## 语法 @@ -20,4 +20,4 @@ tiup dm prune [flags] ## 输出 -清理过程的日志。 \ No newline at end of file +清理过程的日志。 diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index e0325a6b4ea1..07bc801b1b6a 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -4,7 +4,7 @@ title: TiUP 参考手册 # TiUP -TiUP 在 TiDB 生态中承担包管理器的功能,它的使用围绕命令,组件,镜像这几个核心概念进行,我们下面先对它们进行定义。 +TiUP 在 TiDB 生态中承担包管理器的功能,它的使用围绕命令、组件、镜像这几个核心概念进行。下面先对这些概念进行定义。 ## 语法 From 67e711b8c8d2d50365009c7efbec71ddffe3c02c Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Wed, 24 Feb 2021 11:32:37 +0800 Subject: [PATCH 48/56] Update tiup/tiup-command-completion.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- tiup/tiup-command-completion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-command-completion.md b/tiup/tiup-command-completion.md index 9c004898cde6..5bf6d51b022a 100644 --- a/tiup/tiup-command-completion.md +++ b/tiup/tiup-command-completion.md @@ -23,7 +23,7 @@ tiup completion ### bash -将自动补全代码写入一个文件,并且在 .bash_profile 中对其执行 source: +将自动补全代码写入一个文件,并且在 `.bash_profile` 中对其执行 `source` 命令: ```sh tiup completion bash > ~/.tiup.completion.bash From e58c0f75aa15817e0b65322d258f9547f8523c47 Mon Sep 17 00:00:00 2001 From: lucklove Date: Wed, 24 Feb 2021 11:32:55 +0800 Subject: [PATCH 49/56] Address comment --- tiup/tiup-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 07bc801b1b6a..9bd3c02ccaaf 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -43,7 +43,7 @@ tiup [flags] [args...] # 运行组件 跳过版本号合法性检查,默认指定的版本号只能是 Semantic Version。 -***deprecated*** +该选项自 `v1.3.0` 版本起**已废弃**。 ### -T, --tag (string) From 8768213cc3b1be1cccd88dc25330f81001c88b62 Mon Sep 17 00:00:00 2001 From: lucklove Date: Wed, 24 Feb 2021 16:00:27 +0800 Subject: [PATCH 50/56] Fix link --- tiup/tiup-cluster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-cluster.md b/tiup/tiup-cluster.md index 821f3d2a7913..4208d10ac31c 100644 --- a/tiup/tiup-cluster.md +++ b/tiup/tiup-cluster.md @@ -406,7 +406,7 @@ alertmanager_servers: - `grafana_servers` 的 `dashboard_dir` 字段指定的文件夹中应当含有完整的 `*.json` 文件。 - `monitoring_servers` 的 `rule_dir` 字段定义的文件夹中应当含有完整的 `*.rules.yml` 文件。 -- `alertmanager_servers` 的 `config_file` 格式请参考 [Alertmanager 配置模板](https://github.com/pingcap/tiup/blob/master/templates/config/alertmanager.yml)。 +- `alertmanager_servers` 的 `config_file` 格式请参考 [Alertmanager 配置模板](https://github.com/pingcap/tiup/blob/master/embed/templates/config/alertmanager.yml)。 在执行 `tiup reload` 时,TiUP 会将中控机上对应的配置上传到目标机器对应的配置目录中,上传之前会删除目标机器中已有的旧配置文件。如果想要修改某一个配置文件,请确保将所有的(包含未修改的)配置文件都放在同一个目录中。例如,要修改 Grafana 的 `tidb.json` 文件,可以先将 Grafana 的 `dashboards` 目录中所有的 `*.json` 文件拷贝到本地目录中,再修改 `tidb.json` 文件。否则最终的目标机器上将缺失其他的 JSON 文件。 From a00215c9fb5fb4ec87daa83774ffd38f675aff8a Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Wed, 24 Feb 2021 20:31:46 +0800 Subject: [PATCH 51/56] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- tiup/tiup-cluster-topology-reference.md | 4 ++-- tiup/tiup-command-clean.md | 2 +- tiup/tiup-command-completion.md | 4 ++-- tiup/tiup-command-list.md | 2 +- tiup/tiup-command-mirror-modify.md | 2 +- tiup/tiup-command-mirror-publish.md | 2 +- tiup/tiup-command-mirror-rotate.md | 18 +++++++++--------- tiup/tiup-command-mirror-set.md | 4 ++-- tiup/tiup-command-mirror.md | 4 ++-- tiup/tiup-command-status.md | 2 +- tiup/tiup-component-cluster-check.md | 4 ++-- tiup/tiup-component-cluster.md | 4 ++-- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index e06028a40b4f..e75303fc7352 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -6,7 +6,7 @@ title: 通过 TiUP 部署 TiDB 集群的拓扑文件配置 通过 TiUP 部署或扩容 TiDB 集群时,需要提供一份拓扑文件([示例](https://github.com/pingcap/tiup/blob/master/examples/topology.example.yaml))来描述集群拓扑。 -同样,修改集群配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。 +同样,修改集群配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。本文档介绍拓扑文件的各个区块以各区块中的各字段。 ## 文件结构 @@ -262,7 +262,7 @@ tikv_servers: - `tmp_path`: TiFlash 临时文件的存放路径,默认使用 [`path` 或者 `storage.latest.dir` 的第一个目录] + "/tmp" - `numa_node`:为该实例分配 NUMA 策略,如果指定了该参数,需要确保目标机装了 [numactl](https://linux.die.net/man/8/numactl),在指定该参数的情况下会通过 [numactl](https://linux.die.net/man/8/numactl) 分配 cpubind 和 membind 策略。该字段参数为 string 类型,字段值填 NUMA 节点的 ID,例如 "0,1" - `config`:该字段配置规则和 `server_configs` 里的 `tiflash` 配置规则相同,若配置了该字段,会将该字段内容和 `server_configs` 里的 `tiflash` 内容合并(若字段重叠,以本字段内容为准),然后生成配置文件并下发到 `host` 指定的机器 -- `learner_config`:每个 TiFlash 中内置了一个特殊的 TiKV,该配置项用于配置这个特殊的 TiKV,一般不建议修改这个配置项下的内容 +- `learner_config`:每个 TiFlash 中内置了一个特殊的 TiKV 模块,该配置项用于配置这个特殊的 TiKV 模块,一般不建议修改这个配置项下的内容 - `os`:`host` 字段所指定的机器的操作系统,若不指定该字段,则默认为 `global` 中的 `os` - `arch`:`host` 字段所指定的机器的架构,若不指定该字段,则默认为 `global` 中的 `arch` - `resource_control`:针对该服务的资源控制,如果配置了该字段,会将该字段和 `global` 中的 `resource_control` 内容合并(若字段重叠,以本字段内容为准),然后生成 systemd 配置文件并下发到 `host` 指定机器。`resource_control` 的配置规则同 `global` 中的 `resource_control` diff --git a/tiup/tiup-command-clean.md b/tiup/tiup-command-clean.md index 0845af35cde8..1c01f0b2b26c 100644 --- a/tiup/tiup-command-clean.md +++ b/tiup/tiup-command-clean.md @@ -12,7 +12,7 @@ title: tiup clean tiup clean [name] [flags] ``` -`[name]` 取值为 [status 命令](/tiup/tiup-command-status.md)输出的 `Name` 字段。若省略 ``,则必须配合 `--all` 使用。 +`[name]` 取值为 [status 命令](/tiup/tiup-command-status.md)输出的 `Name` 字段。若省略 `[name]`,则必须配合 `--all` 使用。 ## 选项 diff --git a/tiup/tiup-command-completion.md b/tiup/tiup-command-completion.md index 5bf6d51b022a..099aa000942f 100644 --- a/tiup/tiup-command-completion.md +++ b/tiup/tiup-command-completion.md @@ -8,8 +8,8 @@ title: tiup completion 如果是 bash,需要提前安装好 bash-completion: -- macOS 的安装方式为:如果 Bash 版本小于 4.1,运行 `brew install bash-completion`;如果 Bash 版本大于等于 4.1,则运行 `brew install bash-completion@2`。 -- Linux 的安装方式为:使用包管理器安装 `bash-completion` 包,例如 `yum install bash-completion` 或者 `apt install bash-completion` +- 在 macOS 上的安装方式为:如果 bash 版本小于 4.1,执行 `brew install bash-completion`;如果 bash 版本大于等于 4.1,则执行 `brew install bash-completion@2`。 +- 在 Linux 上的安装方式为:使用包管理器安装 `bash-completion` 包,例如执行 `yum install bash-completion` 或者 `apt install bash-completion`。 ## 语法 diff --git a/tiup/tiup-command-list.md b/tiup/tiup-command-list.md index 959e19ee0de5..97f9b26288ed 100644 --- a/tiup/tiup-command-list.md +++ b/tiup/tiup-command-list.md @@ -31,7 +31,7 @@ tiup list [component] [flags] ## 输出 - 若未指定 `[component]` - - 若指定 --verbose:输出 `组件名 (Name)`、`已安装版本 (Installed)`、`组件管理员 (Owner)`、`组件描述(Owner)` 构成的组件信息列表 + - 若指定 --verbose:输出 `组件名 (Name)`、`已安装版本 (Installed)`、`组件管理员 (Owner)`、`组件描述 (Owner)` 构成的组件信息列表 - 若不指定 --verbose:输出 `组件名 (Name)`、`组件管理员 (Owner)`、`组件描述 (Owner)` 构成的组件信息列表 - 若指定 `[component]` - 若 `[component]` 存在:输出 `版本 (Version)`、`是否已安装 (Installed)`、`发布时间 (Release)`、`支持的平台 (Platforms)` 构成的版本信息列表 diff --git a/tiup/tiup-command-mirror-modify.md b/tiup/tiup-command-mirror-modify.md index e6f8b9508677..17e6f1059a54 100644 --- a/tiup/tiup-command-mirror-modify.md +++ b/tiup/tiup-command-mirror-modify.md @@ -32,7 +32,7 @@ tiup mirror modify [:version] [flags] ### --hide(boolean,默认 false) -将该组件设置为隐藏,隐藏之后该组件将不在 `tiup list` 的列表中显示,但是 `tiup list --all` 可看到。 +将该组件设置为隐藏,隐藏之后该组件将不在 `tiup list` 的列表中显示,但是可通过执行 `tiup list --all` 查看。 > **注意:** > diff --git a/tiup/tiup-command-mirror-publish.md b/tiup/tiup-command-mirror-publish.md index d879d966df6a..c494d28590b9 100644 --- a/tiup/tiup-command-mirror-publish.md +++ b/tiup/tiup-command-mirror-publish.md @@ -4,7 +4,7 @@ title: tiup mirror publish # tiup mirror publish -命令 `tiup mirror publish` 用于发布新组件,或已有组件的新版本。只有合法的组件管理员才可以发布组件。组件管理员的引入方式参考 [grant 命令](/tiup/tiup-command-mirror-grant.md)。 +命令 `tiup mirror publish` 用于发布新组件,或已有组件的新版本。只有有权限的组件管理员才可以发布组件。引入组件管理员的方式可参考 [grant 命令](/tiup/tiup-command-mirror-grant.md)。 ## 语法 diff --git a/tiup/tiup-command-mirror-rotate.md b/tiup/tiup-command-mirror-rotate.md index c2efeec4f0f1..60bb8ff52e96 100644 --- a/tiup/tiup-command-mirror-rotate.md +++ b/tiup/tiup-command-mirror-rotate.md @@ -23,19 +23,19 @@ TiUP 的镜像中有一个非常重要的文件:root.json,里面记录了整 更新 root.json 内容之后,必须由管理员对其进行重新签名,否则客户端会拒绝,更新流程如下: -- 更新 root.json 的内容 -- N 个管理员对新的 root.json 进行签名 -- 更新 snapshot.json,记录新的 root.json 的 version -- 对新的 snapshot.json 进行签名 -- 更新 timestamp.json,记录新的 snapshot.json 的 hash -- 对新的 timestamp.json 进行签名 +1. 更新 root.json 的内容 +2. N 个管理员对新的 root.json 进行签名 +3. 更新 snapshot.json,记录新的 root.json 的 version +4. 对新的 snapshot.json 进行签名 +5. 更新 timestamp.json,记录新的 snapshot.json 的 hash +6. 对新的 timestamp.json 进行签名 TiUP 使用命令 `tiup mirror rotate` 来自动化以上流程。 > **注意:** > > + 经测试,小于 TiUP v1.3.0 的版本无法正确获得新的 root.json [#983](https://github.com/pingcap/tiup/issues/983)。 -> + 使用此功能前请确保所有的 TiUP 客户端升级到了 v1.3.0 及其以上版本。 +> + 使用此功能前请确保所有的 TiUP 客户端升级到了 v1.3.0 或以上版本。 ## 语法 @@ -45,13 +45,13 @@ tiup mirror rotate [flags] 该命令会启动一个编辑器,修改其内容为目标值(比如将 `expires` 字段的值向后推移),然后需要将 `version` 字段加一并保存。保存之后会启动一个临时的 http 服务器,等待 N 个不同的镜像管理员签名。 -镜像管理员签名的方式参考[sign 命令](/tiup/tiup-command-mirror-sign.md)。 +镜像管理员签名的方式参考 [sign 命令](/tiup/tiup-command-mirror-sign.md)。 ## 选项 ### --addr(string,默认 0.0.0.0:8080) -临时服务器的监听地址,需要确保该地址可以被其他镜像管理员访问,这样管理员才能使用[sign 命令](/tiup/tiup-command-mirror-sign.md)签名。 +临时服务器的监听地址,需要确保该地址可以被其他镜像管理员访问,这样管理员才能使用 [sign 命令](/tiup/tiup-command-mirror-sign.md)签名。 ## 输出 diff --git a/tiup/tiup-command-mirror-set.md b/tiup/tiup-command-mirror-set.md index 38a4ed71e7b6..a854d4435187 100644 --- a/tiup/tiup-command-mirror-set.md +++ b/tiup/tiup-command-mirror-set.md @@ -16,7 +16,7 @@ tiup mirror set [flags] `` 为镜像地址,可以有两种形式: -- 网络地址:http 或者 https 开头,如 `http://172.16.5.5:8080`,`https://tiup-mirrors.pingcap.com` 等 +- 网络地址:以 http 或者 https 开头,如 `http://172.16.5.5:8080`,`https://tiup-mirrors.pingcap.com` 等 - 本地文件路径:镜像目录的绝对路径,比如 `/path/to/local-tiup-mirror` ## 选项 @@ -37,7 +37,7 @@ wget /root.json -O /path/to/local/root.json tiup mirror set -r /path/to/local/root.json ``` -在这种操作方式下,如果中间人在 `wget` 之前攻击了镜像,我们能发现根证书不正确,如果在 `wget` 之后攻击了镜像,TiUP 会发现镜像和根证书不符。 +在这种操作方式下,如果中间人在 `wget` 之前攻击了镜像,用户可发现根证书不正确。如果在 `wget` 之后攻击了镜像,TiUP 会发现镜像和根证书不符。 ## 输出 diff --git a/tiup/tiup-command-mirror.md b/tiup/tiup-command-mirror.md index 1d30586b45da..cbb8a569606d 100644 --- a/tiup/tiup-command-mirror.md +++ b/tiup/tiup-command-mirror.md @@ -29,9 +29,9 @@ tiup mirror [flags] - [sign](/tiup/tiup-command-mirror-sign.md): 使用私钥文件对特定文件进行签名 - [init](/tiup/tiup-command-mirror-init.md): 创建一个空的镜像 - [set](/tiup/tiup-command-mirror-set.md): 设置当前镜像 -- [grant](/tiup/tiup-command-mirror-grant.md): 为当前镜像引入新的组件作者 +- [grant](/tiup/tiup-command-mirror-grant.md): 为当前镜像引入新的组件管理员 - [publish](/tiup/tiup-command-mirror-publish.md): 向当前镜像推送新的组件 - [modify](/tiup/tiup-command-mirror-modify.md): 修改当前镜像中的组件属性 - [rotate](/tiup/tiup-command-mirror-rotate.md): 更新当前镜像中的根证书 - [clone](/tiup/tiup-command-mirror-rotate.md): 从已有镜像克隆一个新的镜像 -- [merge](/tiup/tiup-command-mirror-merge.md): 合并镜像 \ No newline at end of file +- [merge](/tiup/tiup-command-mirror-merge.md): 合并镜像 diff --git a/tiup/tiup-command-status.md b/tiup/tiup-command-status.md index 199b462f3016..493d2d56ce70 100644 --- a/tiup/tiup-command-status.md +++ b/tiup/tiup-command-status.md @@ -4,7 +4,7 @@ title: tiup status # tiup status -命令 `tiup status` 查看组件运行信息:通过 `tiup [flags] [args...]` 运行组件之后,可以通过该命令查看组件的运行信息。 +使用命令 `tiup status` 可查看组件的运行信息:通过 `tiup [flags] [args...]` 运行组件之后,可以通过该命令查看组件的运行信息。 > **注意** > diff --git a/tiup/tiup-component-cluster-check.md b/tiup/tiup-component-cluster-check.md index a0c4ca9a5292..8fb3f6bb5fd2 100644 --- a/tiup/tiup-component-cluster-check.md +++ b/tiup/tiup-component-cluster-check.md @@ -10,7 +10,7 @@ title: tiup cluster check ### 操作系统版本 -检查部署机操作系统发行版和版本:目前仅支持部署在 CentOS 7 的操作系统上,之后随兼容性改进可能增加更多系统版本。 +检查部署机操作系统发行版和版本:目前仅支持部署在 CentOS 7 的操作系统上,之后随兼容性改进可能支持更多系统版本。 ### CPU EPOLLEXCLUSIVE @@ -40,7 +40,7 @@ title: tiup cluster check - net.ipv4.tcp_syncookies: 0 - net.core.somaxconn: 32768 - vm.swappiness: 0 -- vm.overcommit_memory: 0 or 1 +- vm.overcommit_memory: 0 或 1 - fs.file-max: 1000000 ### THP(透明大页) diff --git a/tiup/tiup-component-cluster.md b/tiup/tiup-component-cluster.md index d69ef088d4b0..420ae3e76e0c 100644 --- a/tiup/tiup-component-cluster.md +++ b/tiup/tiup-component-cluster.md @@ -38,7 +38,7 @@ tiup cluster [command] [flags] ### -v, --version(boolean,默认 false) -输出 tiup-cluster 当前版本信息。 +输出 TiUP Cluster 当前版本信息。 ### -h, --help(boolean,默认 false) @@ -67,4 +67,4 @@ tiup cluster [command] [flags] - [audit](/tiup/tiup-component-cluster-audit.md):查询集群操作审计日志 - [enable](/tiup/tiup-component-cluster-enable.md):开启指定集群或服务开机自启动 - [disable](/tiup/tiup-component-cluster-disable.md):关闭指定集群或服务开机自启动 -- [help](/tiup/tiup-component-cluster-help.md):输出帮助信息 \ No newline at end of file +- [help](/tiup/tiup-component-cluster-help.md):输出帮助信息 From b869c1128ad485cbac6a3cee48f9a7592c9a0a91 Mon Sep 17 00:00:00 2001 From: lucklove Date: Thu, 25 Feb 2021 18:34:26 +0800 Subject: [PATCH 52/56] Address comment --- tiup/tiup-command-status.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tiup/tiup-command-status.md b/tiup/tiup-command-status.md index 199b462f3016..870985e589ee 100644 --- a/tiup/tiup-command-status.md +++ b/tiup/tiup-command-status.md @@ -25,4 +25,13 @@ tiup status [flags] ## 输出 -由 `Tag 名字`,`组件名`,`进程 PID`,`运行状态`, `启动时间`,`启动参数`,`数据目录`,`二进制文件路径` 构成的表格,若启动时未指定 Tag 名字,则 Tag 名字段为随机字符串。 +由以下字段构成的表格: + +- Name: 通过 `-T/--tag` 指定的 Tag 名字,若未指定,则为随机字符串 +- Component: 运行的组件 +- PID: 对应的进程 ID +- Status: 组件运行状态 +- Created Time: 启动时间 +- Directory: 数据目录 +- Binary: 二进制文件路径 +- Args: 启动参数 \ No newline at end of file From 7bbaecf986cf5587fe8e3eec2ab751be8221d086 Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 1 Mar 2021 15:38:21 +0800 Subject: [PATCH 53/56] Fix link --- tiup/tiup-cluster-topology-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index e75303fc7352..6015e052c353 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -4,7 +4,7 @@ title: 通过 TiUP 部署 TiDB 集群的拓扑文件配置 # 通过 TiUP 部署 TiDB 集群的拓扑文件配置 -通过 TiUP 部署或扩容 TiDB 集群时,需要提供一份拓扑文件([示例](https://github.com/pingcap/tiup/blob/master/examples/topology.example.yaml))来描述集群拓扑。 +通过 TiUP 部署或扩容 TiDB 集群时,需要提供一份拓扑文件([示例](https://github.com/pingcap/tiup/blob/master/embed/templates/examples/topology.example.yaml))来描述集群拓扑。 同样,修改集群配置也是通过编辑拓扑文件来实现的,区别在于修改配置时仅允许修改部分字段。本文档介绍拓扑文件的各个区块以各区块中的各字段。 From 69ff4f8d1089eb180718d37aecfe65b172f67239 Mon Sep 17 00:00:00 2001 From: lucklove Date: Mon, 1 Mar 2021 15:48:45 +0800 Subject: [PATCH 54/56] Address comment --- tiup/tiup-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-reference.md b/tiup/tiup-reference.md index 9bd3c02ccaaf..a41e07cea9f3 100644 --- a/tiup/tiup-reference.md +++ b/tiup/tiup-reference.md @@ -4,7 +4,7 @@ title: TiUP 参考手册 # TiUP -TiUP 在 TiDB 生态中承担包管理器的功能,它的使用围绕命令、组件、镜像这几个核心概念进行。下面先对这些概念进行定义。 +TiUP 在 TiDB 生态中承担包管理器的功能,管理着 TiDB 生态下众多的组件,如 TiDB、PD、TiKV 等。 ## 语法 From 4005fd3bcf87d2707974f0af84a8872d8be1c71d Mon Sep 17 00:00:00 2001 From: yikeke Date: Mon, 1 Mar 2021 15:57:09 +0800 Subject: [PATCH 55/56] add links to tiup-cluster-topology-reference.md --- geo-distributed-deployment-topology.md | 4 +++- hybrid-deployment-topology.md | 8 +++++--- minimal-deployment-topology.md | 2 ++ ticdc-deployment-topology.md | 2 ++ tidb-binlog-deployment-topology.md | 2 ++ tiflash-deployment-topology.md | 4 +++- tispark-deployment-topology.md | 2 ++ 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/geo-distributed-deployment-topology.md b/geo-distributed-deployment-topology.md index 93a1d27b3ff2..b66b775e523b 100644 --- a/geo-distributed-deployment-topology.md +++ b/geo-distributed-deployment-topology.md @@ -21,6 +21,8 @@ aliases: ['/docs-cn/dev/geo-distributed-deployment-topology/'] [跨机房配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/geo-redundancy-deployment.yaml) +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md)。 + ### 关键参数配置 本节介绍跨数据中心部署 TiDB 集群的关键参数配置。 @@ -28,7 +30,7 @@ aliases: ['/docs-cn/dev/geo-distributed-deployment-topology/'] #### TiKV 参数 - 设置 gRPC 的压缩格式,默认为 `none`。为提高跨机房部署场景的目标节点间 gRPC 包的传输速度,建议设置为 gzip 格式。 - + ```yaml server.grpc-compression-type: gzip ``` diff --git a/hybrid-deployment-topology.md b/hybrid-deployment-topology.md index a3c8fc72862d..4351cd74ff5c 100644 --- a/hybrid-deployment-topology.md +++ b/hybrid-deployment-topology.md @@ -23,6 +23,8 @@ aliases: ['/docs-cn/dev/hybrid-deployment-topology/'] [详细混部配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-multi-instance.yaml) +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md)。 + ### 混合部署的关键参数介绍 本节介绍单机多实例的关键参数,主要用于 TiDB、TiKV 的单机多实例部署场景。你需要按照提供的计算公式,将结果填写至上一步的配置模板中。 @@ -32,7 +34,7 @@ aliases: ['/docs-cn/dev/hybrid-deployment-topology/'] - readpool 线程池自适应,配置 `readpool.unified.max-thread-count` 参数可以使 `readpool.storage` 和 `readpool.coprocessor` 共用统一线程池,同时要分别设置自适应开关。 - 开启 `readpool.storage` 和 `readpool.coprocessor`: - + ```yaml readpool.storage.use-unified-pool: true readpool.coprocessor.use-unified-pool: true @@ -51,7 +53,7 @@ aliases: ['/docs-cn/dev/hybrid-deployment-topology/'] ```yaml storage.block-cache.shared: true ``` - + - 计算公式如下: ``` @@ -93,7 +95,7 @@ aliases: ['/docs-cn/dev/hybrid-deployment-topology/'] - numa 绑核使用前,确认已经安装 numactl 工具,以及物理机对应的物理机 CPU 的信息后,再进行参数配置; - - `numa_node` 这个配置参数与 `numactl --membind` 配置对应。 + - `numa_node` 这个配置参数与 `numactl --membind` 配置对应。 > **注意:** > diff --git a/minimal-deployment-topology.md b/minimal-deployment-topology.md index 62d7231ddb85..06bfbbc0870e 100644 --- a/minimal-deployment-topology.md +++ b/minimal-deployment-topology.md @@ -23,6 +23,8 @@ aliases: ['/docs-cn/dev/minimal-deployment-topology/'] [详细最小配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-mini.yaml) +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md)。 + > **注意:** > > - 无需手动创建配置文件中的 `tidb` 用户,TiUP cluster 组件会在目标主机上自动创建该用户。可以自定义用户,也可以和中控机的用户保持一致。 diff --git a/ticdc-deployment-topology.md b/ticdc-deployment-topology.md index 963b2a032f82..35679e38a900 100644 --- a/ticdc-deployment-topology.md +++ b/ticdc-deployment-topology.md @@ -28,6 +28,8 @@ aliases: ['/docs-cn/dev/ticdc-deployment-topology/','/docs-cn/dev/reference/tool [详细 TiCDC 配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-cdc.yaml) +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md#cdc_servers)。 + > **注意:** > > - 无需手动创建配置文件中的 `tidb` 用户,TiUP cluster 组件会在目标主机上自动创建该用户。可以自定义用户,也可以和中控机的用户保持一致。 diff --git a/tidb-binlog-deployment-topology.md b/tidb-binlog-deployment-topology.md index 7f69b8a9f525..386cb41b842a 100644 --- a/tidb-binlog-deployment-topology.md +++ b/tidb-binlog-deployment-topology.md @@ -26,6 +26,8 @@ aliases: ['/docs-cn/dev/tidb-binlog-deployment-topology/'] [详细 TiDB Binlog 配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-tidb-binlog.yaml) +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md)。 + ### 关键参数介绍 拓扑配置模版的关键参数如下: diff --git a/tiflash-deployment-topology.md b/tiflash-deployment-topology.md index 7a6eb0001314..d95c9627c286 100644 --- a/tiflash-deployment-topology.md +++ b/tiflash-deployment-topology.md @@ -24,6 +24,8 @@ aliases: ['/docs-cn/dev/tiflash-deployment-topology/'] - [详细 TiFlash 配置模版](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-tiflash.yaml) +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md#tiflash_servers)。 + ### 关键参数介绍 - 需要将配置模板中 `replication.enable-placement-rules` 设置为 `true`,以开启 PD 的 [Placement Rules](/configure-placement-rules.md) 功能。 @@ -35,4 +37,4 @@ aliases: ['/docs-cn/dev/tiflash-deployment-topology/'] > **注意:** > > - 无需手动创建配置文件中的 `tidb` 用户,TiUP cluster 组件会在目标主机上自动创建该用户。可以自定义用户,也可以和中控机的用户保持一致。 -> - 如果部署目录配置为相对路径,会部署在用户家目录下。 +> - 如果部署目录配置为相对路径,会部署在用户家目录下。 \ No newline at end of file diff --git a/tispark-deployment-topology.md b/tispark-deployment-topology.md index 03eb48d353eb..20f918402bd0 100644 --- a/tispark-deployment-topology.md +++ b/tispark-deployment-topology.md @@ -30,6 +30,8 @@ aliases: ['/docs-cn/dev/tispark-deployment-topology/'] [详细 TiSpark 配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-tispark.yaml) +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md#tispark_masters)。 + > **注意:** > > - 无需手动创建配置文件中的 `tidb` 用户,TiUP cluster 组件会在目标主机上自动创建该用户。可以自定义用户,也可以和中控机的用户保持一致。 From b82fddf783625c8fbc02ff6be206f563b74cfa37 Mon Sep 17 00:00:00 2001 From: yikeke Date: Mon, 1 Mar 2021 16:00:43 +0800 Subject: [PATCH 56/56] fix links --- geo-distributed-deployment-topology.md | 2 +- hybrid-deployment-topology.md | 2 +- minimal-deployment-topology.md | 2 +- ticdc-deployment-topology.md | 2 +- tidb-binlog-deployment-topology.md | 2 +- tiflash-deployment-topology.md | 2 +- tispark-deployment-topology.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/geo-distributed-deployment-topology.md b/geo-distributed-deployment-topology.md index b66b775e523b..816a5346147f 100644 --- a/geo-distributed-deployment-topology.md +++ b/geo-distributed-deployment-topology.md @@ -21,7 +21,7 @@ aliases: ['/docs-cn/dev/geo-distributed-deployment-topology/'] [跨机房配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/geo-redundancy-deployment.yaml) -以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md)。 +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](/tiup/tiup-cluster-topology-reference.md)。 ### 关键参数配置 diff --git a/hybrid-deployment-topology.md b/hybrid-deployment-topology.md index 4351cd74ff5c..340e2e31d920 100644 --- a/hybrid-deployment-topology.md +++ b/hybrid-deployment-topology.md @@ -23,7 +23,7 @@ aliases: ['/docs-cn/dev/hybrid-deployment-topology/'] [详细混部配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-multi-instance.yaml) -以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md)。 +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](/tiup/tiup-cluster-topology-reference.md)。 ### 混合部署的关键参数介绍 diff --git a/minimal-deployment-topology.md b/minimal-deployment-topology.md index 06bfbbc0870e..972c3fbbed52 100644 --- a/minimal-deployment-topology.md +++ b/minimal-deployment-topology.md @@ -23,7 +23,7 @@ aliases: ['/docs-cn/dev/minimal-deployment-topology/'] [详细最小配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-mini.yaml) -以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md)。 +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](/tiup/tiup-cluster-topology-reference.md)。 > **注意:** > diff --git a/ticdc-deployment-topology.md b/ticdc-deployment-topology.md index 35679e38a900..c0fa6ea88f57 100644 --- a/ticdc-deployment-topology.md +++ b/ticdc-deployment-topology.md @@ -28,7 +28,7 @@ aliases: ['/docs-cn/dev/ticdc-deployment-topology/','/docs-cn/dev/reference/tool [详细 TiCDC 配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-cdc.yaml) -以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md#cdc_servers)。 +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](/tiup/tiup-cluster-topology-reference.md#cdc_servers)。 > **注意:** > diff --git a/tidb-binlog-deployment-topology.md b/tidb-binlog-deployment-topology.md index 386cb41b842a..c5732f4ea871 100644 --- a/tidb-binlog-deployment-topology.md +++ b/tidb-binlog-deployment-topology.md @@ -26,7 +26,7 @@ aliases: ['/docs-cn/dev/tidb-binlog-deployment-topology/'] [详细 TiDB Binlog 配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-tidb-binlog.yaml) -以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md)。 +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](/tiup/tiup-cluster-topology-reference.md)。 ### 关键参数介绍 diff --git a/tiflash-deployment-topology.md b/tiflash-deployment-topology.md index d95c9627c286..823c1b874053 100644 --- a/tiflash-deployment-topology.md +++ b/tiflash-deployment-topology.md @@ -24,7 +24,7 @@ aliases: ['/docs-cn/dev/tiflash-deployment-topology/'] - [详细 TiFlash 配置模版](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-tiflash.yaml) -以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md#tiflash_servers)。 +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](/tiup/tiup-cluster-topology-reference.md#tiflash_servers)。 ### 关键参数介绍 diff --git a/tispark-deployment-topology.md b/tispark-deployment-topology.md index 20f918402bd0..bced4e182e3f 100644 --- a/tispark-deployment-topology.md +++ b/tispark-deployment-topology.md @@ -30,7 +30,7 @@ aliases: ['/docs-cn/dev/tispark-deployment-topology/'] [详细 TiSpark 配置模板](https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-tispark.yaml) -以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](tiup/tiup-cluster-topology-reference.md#tispark_masters)。 +以上 TiDB 集群拓扑文件中,详细的配置项说明见[通过 TiUP 部署 TiDB 集群的拓扑文件配置](/tiup/tiup-cluster-topology-reference.md#tispark_masters)。 > **注意:** >