From 4cf7eb315ca9983c797f2c5253e33cd42a2af1fe Mon Sep 17 00:00:00 2001 From: wangxj <44355590+together-wang@users.noreply.github.com> Date: Thu, 21 May 2020 17:55:04 +0800 Subject: [PATCH 1/9] add Update component --- maintain-tidb-using-tiup.md | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/maintain-tidb-using-tiup.md b/maintain-tidb-using-tiup.md index 041ab9f08d51..2e56995b2349 100644 --- a/maintain-tidb-using-tiup.md +++ b/maintain-tidb-using-tiup.md @@ -124,6 +124,51 @@ server_configs: 然后执行 `tiup cluster reload ${cluster-name} -N tidb` 命令滚动重启。 +## 更新组件 + +常规的升级集群可以使用 upgrade 命令,但是在某些场景下(例如 Debug),可能需要用一个临时的包替换正在运行的组件,此时可以用 patch 命令: + +{{< copyable "shell-root" >}} + +```bash +tiup cluster patch --help +``` + +``` +Replace the remote package with a specified package and restart the service + +Usage: + tiup cluster patch [flags] + +Flags: + -h, --help 帮助信息 + -N, --node strings 指定被替换的节点 + --overwrite 在未来的 scale-out 操作中使用当前指定的临时包 + -R, --role strings 指定被替换的服务类型 + --transfer-timeout int transfer leader 的超时时间 + +Global Flags: + --ssh-timeout int SSH 连接的超时时间 + -y, --yes 跳过所有的确认步骤 +``` + +例如,有一个 TiDB 的 hotfix 包放在 `/tmp/tidb-hotfix.tar.gz`,如果此时想要替换集群上的所有 TiDB,则可以执行: + +{{< copyable "shell-regular" >}} + +```bash +tiup cluster patch test-cluster /tmp/tidb-hotfix.tar.gz -R tidb +``` + +或者只替换其中一个 TiDB: + +{{< copyable "shell-regular" >}} + +```bash +tiup cluster patch test-cluster /tmp/tidb-hotfix.tar.gz -N 172.16.4.5:4000 +``` + + ## 关闭集群 关闭集群操作会按 Drainer -> TiFlash -> TiDB -> Pump -> TiKV -> PD 的顺序关闭整个 TiDB 集群所有组件(同时也会关闭监控组件): From 43aca63883605698fc42078a2547da73bb36b96e Mon Sep 17 00:00:00 2001 From: kissmydb Date: Thu, 21 May 2020 22:44:30 +0800 Subject: [PATCH 2/9] Update maintain-tidb-using-tiup.md Co-authored-by: Lilian Lee --- maintain-tidb-using-tiup.md | 1 - 1 file changed, 1 deletion(-) diff --git a/maintain-tidb-using-tiup.md b/maintain-tidb-using-tiup.md index 2e56995b2349..a4273f41f637 100644 --- a/maintain-tidb-using-tiup.md +++ b/maintain-tidb-using-tiup.md @@ -168,7 +168,6 @@ tiup cluster patch test-cluster /tmp/tidb-hotfix.tar.gz -R tidb tiup cluster patch test-cluster /tmp/tidb-hotfix.tar.gz -N 172.16.4.5:4000 ``` - ## 关闭集群 关闭集群操作会按 Drainer -> TiFlash -> TiDB -> Pump -> TiKV -> PD 的顺序关闭整个 TiDB 集群所有组件(同时也会关闭监控组件): From 4e222e917ce13f6adde65811da1c7d5029556d6e Mon Sep 17 00:00:00 2001 From: kissmydb Date: Thu, 21 May 2020 22:47:53 +0800 Subject: [PATCH 3/9] Update maintain-tidb-using-tiup.md Co-authored-by: Lilian Lee --- maintain-tidb-using-tiup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintain-tidb-using-tiup.md b/maintain-tidb-using-tiup.md index a4273f41f637..4327158583b0 100644 --- a/maintain-tidb-using-tiup.md +++ b/maintain-tidb-using-tiup.md @@ -152,7 +152,7 @@ Global Flags: -y, --yes 跳过所有的确认步骤 ``` -例如,有一个 TiDB 的 hotfix 包放在 `/tmp/tidb-hotfix.tar.gz`,如果此时想要替换集群上的所有 TiDB,则可以执行: +例如,有一个 TiDB 的 hotfix 包放在 `/tmp/tidb-hotfix.tar.gz` 目录下。如果此时想要替换集群上的所有 TiDB,则可以执行以下命令: {{< copyable "shell-regular" >}} From aef43f740aa4c7a297315f4072247616de92db19 Mon Sep 17 00:00:00 2001 From: wangxj <44355590+together-wang@users.noreply.github.com> Date: Fri, 22 May 2020 11:08:03 +0800 Subject: [PATCH 4/9] Update maintain-tidb-using-tiup.md Co-authored-by: Lilian Lee --- maintain-tidb-using-tiup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintain-tidb-using-tiup.md b/maintain-tidb-using-tiup.md index 4327158583b0..9046e379a0f3 100644 --- a/maintain-tidb-using-tiup.md +++ b/maintain-tidb-using-tiup.md @@ -124,7 +124,7 @@ server_configs: 然后执行 `tiup cluster reload ${cluster-name} -N tidb` 命令滚动重启。 -## 更新组件 +## Hotfix 版本替换 常规的升级集群可以使用 upgrade 命令,但是在某些场景下(例如 Debug),可能需要用一个临时的包替换正在运行的组件,此时可以用 patch 命令: From f0d54cff5b1a967b300374afb0231b3e64ae4fef Mon Sep 17 00:00:00 2001 From: wangxj <44355590+together-wang@users.noreply.github.com> Date: Fri, 22 May 2020 11:11:14 +0800 Subject: [PATCH 5/9] Update maintain-tidb-using-tiup.md --- maintain-tidb-using-tiup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintain-tidb-using-tiup.md b/maintain-tidb-using-tiup.md index 9046e379a0f3..a0db05f745d6 100644 --- a/maintain-tidb-using-tiup.md +++ b/maintain-tidb-using-tiup.md @@ -126,7 +126,7 @@ server_configs: ## Hotfix 版本替换 -常规的升级集群可以使用 upgrade 命令,但是在某些场景下(例如 Debug),可能需要用一个临时的包替换正在运行的组件,此时可以用 patch 命令: +常规的升级集群请参考 [升级文档](https://github.com/pingcap/docs-cn/blob/master/tiup/tiup-cluster.md#%E5%8D%87%E7%BA%A7%E6%93%8D%E4%BD%9C),但是在某些场景下(例如 Debug),可能需要用一个临时的包替换正在运行的组件,此时可以用 patch 命令: {{< copyable "shell-root" >}} From dad60ffbd2ccd407049a47f3ff7171d3193921ae Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 26 May 2020 20:32:12 +0800 Subject: [PATCH 6/9] Update maintain-tidb-using-tiup.md --- maintain-tidb-using-tiup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintain-tidb-using-tiup.md b/maintain-tidb-using-tiup.md index a0db05f745d6..ad18d27dcafc 100644 --- a/maintain-tidb-using-tiup.md +++ b/maintain-tidb-using-tiup.md @@ -126,7 +126,7 @@ server_configs: ## Hotfix 版本替换 -常规的升级集群请参考 [升级文档](https://github.com/pingcap/docs-cn/blob/master/tiup/tiup-cluster.md#%E5%8D%87%E7%BA%A7%E6%93%8D%E4%BD%9C),但是在某些场景下(例如 Debug),可能需要用一个临时的包替换正在运行的组件,此时可以用 patch 命令: +常规的升级集群请参考 [升级文档](/tiup/tiup-cluster.md#升级操作),但是在某些场景下(例如 Debug),可能需要用一个临时的包替换正在运行的组件,此时可以用 `patch` 命令: {{< copyable "shell-root" >}} From 463d98f952ca61833ad0aecdbeab8fd7c8962d38 Mon Sep 17 00:00:00 2001 From: wangxj <44355590+together-wang@users.noreply.github.com> Date: Tue, 26 May 2020 22:22:07 +0800 Subject: [PATCH 7/9] Update maintain-tidb-using-tiup.md Co-authored-by: Lilian Lee --- maintain-tidb-using-tiup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintain-tidb-using-tiup.md b/maintain-tidb-using-tiup.md index ad18d27dcafc..7d78214093b8 100644 --- a/maintain-tidb-using-tiup.md +++ b/maintain-tidb-using-tiup.md @@ -152,7 +152,7 @@ Global Flags: -y, --yes 跳过所有的确认步骤 ``` -例如,有一个 TiDB 的 hotfix 包放在 `/tmp/tidb-hotfix.tar.gz` 目录下。如果此时想要替换集群上的所有 TiDB,则可以执行以下命令: +例如,有一个 TiDB 实例的 hotfix 包放在 `/tmp/tidb-hotfix.tar.gz` 目录下。如果此时想要替换集群上的所有 TiDB 实例,则可以执行以下命令: {{< copyable "shell-regular" >}} From 7bf5273db8e51fad3dba118828fe8d98484c3c2a Mon Sep 17 00:00:00 2001 From: wangxj <44355590+together-wang@users.noreply.github.com> Date: Tue, 26 May 2020 22:22:23 +0800 Subject: [PATCH 8/9] Update maintain-tidb-using-tiup.md Co-authored-by: Lilian Lee --- maintain-tidb-using-tiup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintain-tidb-using-tiup.md b/maintain-tidb-using-tiup.md index 7d78214093b8..a912fa4d7fa4 100644 --- a/maintain-tidb-using-tiup.md +++ b/maintain-tidb-using-tiup.md @@ -160,7 +160,7 @@ Global Flags: tiup cluster patch test-cluster /tmp/tidb-hotfix.tar.gz -R tidb ``` -或者只替换其中一个 TiDB: +或者只替换其中一个 TiDB 实例: {{< copyable "shell-regular" >}} From ecfafcf6cde37212bb2592df10e22a48f31fbc1a Mon Sep 17 00:00:00 2001 From: Keke Yi <40977455+yikeke@users.noreply.github.com> Date: Tue, 26 May 2020 22:28:32 +0800 Subject: [PATCH 9/9] Update maintain-tidb-using-tiup.md --- maintain-tidb-using-tiup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintain-tidb-using-tiup.md b/maintain-tidb-using-tiup.md index a912fa4d7fa4..3115a906b0ae 100644 --- a/maintain-tidb-using-tiup.md +++ b/maintain-tidb-using-tiup.md @@ -126,7 +126,7 @@ server_configs: ## Hotfix 版本替换 -常规的升级集群请参考 [升级文档](/tiup/tiup-cluster.md#升级操作),但是在某些场景下(例如 Debug),可能需要用一个临时的包替换正在运行的组件,此时可以用 `patch` 命令: +常规的升级集群请参考[升级文档](/tiup/tiup-cluster.md#升级操作),但是在某些场景下(例如 Debug),可能需要用一个临时的包替换正在运行的组件,此时可以用 `patch` 命令: {{< copyable "shell-root" >}}