Skip to content

Commit 3030c76

Browse files
authored
Update maintain-tidb-using-tiup.md (pingcap#2693) (pingcap#2746)
Signed-off-by: sre-bot <sre-bot@pingcap.com>
1 parent 0a3e825 commit 3030c76

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

maintain-tidb-using-tiup.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ When the cluster is in operation, if you need to modify the parameters of a comp
110110
log.slow-threshold: 300
111111
```
112112

113-
For the parameter format, see the [TiUP parameter template](https://github.com/pingcap-incubator/tiup-cluster/blob/master/examples/topology.example.yaml).
113+
For the parameter format, see the [TiUP parameter template](https://github.com/pingcap/tiup/blob/master/examples/topology.example.yaml).
114114

115115
**Use `.` to represent the hierarchy of the configuration items**.
116116

@@ -134,7 +134,51 @@ server_configs:
134134
performance.txn-total-size-limit: 1073741824
135135
```
136136

137-
Then run the `tiup cluster reload ${cluster-name} -N tidb` command to rolling restart the TiDB component.
137+
Then, run the `tiup cluster reload ${cluster-name} -R tidb` command to rolling restart the TiDB component.
138+
139+
## Replace with a hotfix package
140+
141+
For normal upgrade, see [Upgrade TiDB Using TiUP](/upgrade-tidb-using-tiup.md). But in some scenarios, such as debugging, you might need to replace the currently running component with a temporary package. To achieve this, use the `patch` command:
142+
143+
{{< copyable "shell-root" >}}
144+
145+
```bash
146+
tiup cluster patch --help
147+
```
148+
149+
```
150+
Replace the remote package with a specified package and restart the service
151+
152+
Usage:
153+
cluster patch <cluster-name> <package-path> [flags]
154+
155+
Flags:
156+
-h, --help help for patch
157+
-N, --node strings Specify the nodes
158+
--overwrite Use this package in the future scale-out operations
159+
-R, --role strings Specify the role
160+
--transfer-timeout int Timeout in seconds when transferring PD and TiKV store leaders (default 300)
161+
162+
Global Flags:
163+
--ssh-timeout int Timeout in seconds to connect host via SSH, ignored for operations that don't need an SSH connection. (default 5)
164+
-y, --yes Skip all confirmations and assumes 'yes'
165+
```
166+
167+
If a TiDB hotfix package is in `/tmp/tidb-hotfix.tar.gz` and you want to replace all the TiDB packages in the cluster, run the following command:
168+
169+
{{< copyable "shell-regular" >}}
170+
171+
```bash
172+
tiup cluster patch test-cluster /tmp/tidb-hotfix.tar.gz -R tidb
173+
```
174+
175+
You can also replace only one TiDB package in the cluster:
176+
177+
{{< copyable "shell-regular" >}}
178+
179+
```bash
180+
tiup cluster patch test-cluster /tmp/tidb-hotfix.tar.gz -N 172.16.4.5:4000
181+
```
138182
139183
## Stop the cluster
140184

0 commit comments

Comments
 (0)