From 97fd605c85d1d22ed20450ba4aa904a8735718ea Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Wed, 14 Apr 2021 14:01:33 +0800 Subject: [PATCH 1/9] add 3 tiup docs --- tiup/tiup-component-dm-patch.md | 68 ++++++++++++++++++++++++++ tiup/tiup-component-dm-restart.md | 51 ++++++++++++++++++++ tiup/tiup-component-dm.md | 79 +++++++++++++++++++++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 tiup/tiup-component-dm-patch.md create mode 100644 tiup/tiup-component-dm-restart.md create mode 100644 tiup/tiup-component-dm.md diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md new file mode 100644 index 0000000000000..0e3a06fcf154a --- /dev/null +++ b/tiup/tiup-component-dm-patch.md @@ -0,0 +1,68 @@ +--- +title: tiup dm patch +--- + +# tiup dm patch + +If you need to dynamically replace the binaries of a service while the cluster is running (namely, keep the cluster available during the replacement process), you can use the `tiup dm patch` command. After the command is executed, TiUP does the following things: + +- Uploads the binary package for replacement to the target machine. +- Takes the related nodes offline via the API. +- Stops the target service. +- Unpacks the binary package and replace the service. +- Starts the target service. + +## Syntax + +```shell +tiup dm patch [flags] +``` + +- ``: The name of the cluster to be operated. +- ``: The path to the binary package used for replacement. The steps to generate the package are as follows: + - Determine the name `${component}` (dm-master, dm-worker ...) of the component to be replaced (tidb, tikv, pd...), the `${version}` of the component (v2.0.0, v2.0.1 ...), and the operating system `${os}` and platform `${arch}` on which the component runs. + - Download the current component package using the command `wget https://tiup-mirrors.pingcap.com/${component}-${version}-${os}-${arch}.tar.gz -O /tmp/${component}-${version}-${os}-${arch}.tar.gz`. + - Run `mkdir -p /tmp/package && cd /tmp/package` to create a temporary directory to pack files. + - Run `tar xf /tmp/${component}-${version}-${os}-${arch}.tar.gz` to unpack the original binary package. + - Run `find .` to view the file structure in the temporary package directory. + - Copy the binary files or configuration files to the corresponding locations in the temporary directory. + - Run `tar czf /tmp/${component}-hotfix-${os}-${arch}.tar.gz *` to pack the files in the temporary directory. + - Finally, you can use `/tmp/${component}-hotfix-${os}-${arch}.tar.gz` as the `` in the `tiup cluster patch` command. + +## Options + +### --overwrite + +- After you patch a certain component (such as TiDB or TiKV), when the tiup cluster scales out the component, tiup-dm uses the original component version by default. To use the version that you patch when the cluster scales out in the future, you need to specified the option `--overwrite` in the command. +- Data type: `BOOLEAN` +- This option is disabled by default with the `false` value. To enable this option, add this option to the command, and either pass the `true` value or do not pass any value. + +### -N, --node + +- Specifies nodes to be replaced. The value of this option is a comma-separated list of node IDs. You can get the node ID from the first column of the [cluster status table](/tiup/tiup-component-cluster-display.md). +- Data type: `STRINGS` +- If this option is not specified, TiUP does not select any nodes to replace by default. + +> **Note:** +> +> If the option `-R, --role` is specified at the same time, TiUP then replaces service nodes that match both the requirements of `-N, --node` and `-R, --role`. + +### -R, --role + +- Specified roles to be replaced. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the [cluster status table](/tiup/tiup-component-cluster-display.md). +- Data type: `STRINGS` +- If this option is not specified, TiUP does not select any roles to replace by default. + +> **Note:** +> +> If the option `-N, --node` is specified at the same time, TiUP then replaces service nodes that match both the requirements of `-N, --node` and `-R, --role`. + +### -h, --help + +- Prints help information. +- Data type: `BOOLEAN` +- This option is disabled by default with the `false` value. To enable this option, add this option to the command, and either pass the `true` value or do not pass any value. + +## Outputs + +The execution log of 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 0000000000000..841aa4a68235f --- /dev/null +++ b/tiup/tiup-component-dm-restart.md @@ -0,0 +1,51 @@ +--- +title: tiup dm restart +--- + +# tiup dm restart + +The command `tiup dm restart` is used to restart all or some of the services of the specified cluster. + +> **Note:** +> +> During the restart process, the related services are unavailable for a period of time. + +## Syntax + +```shell +tiup dm restart [flags] +``` + +``: the name of the cluster to operate on. If you forget the cluster name, you can check it with the [cluster list](/tiup/tiup-component-cluster-list.md) command. + +## Options + +### -N, --node + +- Specifies the nodes to be restarted. The value of this option is a comma-separated list of node IDs. You can get the node ID from the first column of the [cluster status table](/tiup/tiup-component-cluster-display.md). +- Data type: `STRINGS` +- If this option is not specified, TiUP restarts all nodes by default. + +> **Note:** +> +> If the option `-R, --role` is specified at the same time, TiUP restarts service nodes that match both the requirements of `-N, --node` and `-R, --role`. + +### -R, --role + +- Specified roles of nodes to be restarted. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the [cluster status table](/tiup/tiup-component-cluster-display.md). +- Data type: `STRINGS` +- If this option is not specified, TiUP restarts nodes of all roles by default. + +> **Note:** +> +> If the option `-N, --node` is specified at the same time, TiUP restarts service nodes that match both the requirements of `-N, --node` and `-R, --role`. + +### -h, --help + +- Prints help information. +- Data type: `BOOLEAN` +- This option is disabled by default with the `false` value. To enable this option, add this option to the command, and either pass the `true` value or do not pass any value. + +## Outputs + +The log of the service restart process. \ 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 0000000000000..77342d7bc1be1 --- /dev/null +++ b/tiup/tiup-component-dm.md @@ -0,0 +1,79 @@ +--- +title: TiUP DM +--- + +# TiUP DM + +Similar to [TiUP Cluster](/tiup/tiup-component-cluster.md) which is used to manage TiDB clusters, TiUP DM is a cluster management component for DM clusters. You can use the TiUP DM component to perform daily operations and maintenance tasks of DM clusters, including deploying, starting, stopping, destroying, elastic scaling, upgrading DM clusters, and managing the configuration parameters of the DM cluster. + +## Syntax + +```shell +tiup dm [command] [flags] +``` + +`[command]` is used to pass the name of the command. See the [command list](#list-of-commands) for supported commands. + +## Options + +### --ssh + +- Specifies the SSH client to connect to the remote end (the machine where the TiDB service is deployed) for the command execution. +- Data type:`STRING` +- Support values: + + - `builtin`: Uses the built-in easyssh client of tiup-cluster as the SSH client. + - `system`: Uses the default SSH client of the current operating system. + - `none`: The SSH client is not used. The deployment is only for the current machine. + +- If this option is not specified in the command, `builtin` is used as the default value. + +### --ssh-timeout + +- Specifies the SSH connection timeout in seconds. +- Data type: `UINT` +- If this option is not specified in the command, the default timeout is `5` seconds. + +### --wait-timeout + +- Specifies the maximum waiting time (in seconds) for each step in the operation process. The operation process consists of many steps, such as specifying systemctl to start or stop services, and waiting for ports to be online or offline. Each step may take several seconds. If the execution time of a step exceeds the specified timeout, the step exits with an error. +- Data type:`UINT` +- If this option is not specified in the command, the maximum waiting time for each steps is `120` seconds. + +### -y, --yes + +- Skips the secondary confirmation of all risky operations. It is not recommended to use this option unless you use a script to call TiUP. +- Data type:`BOOLEAN` +- This option is disabled by default with the `false` value. To enable this option, add this option to the command, and either pass the `true` value or do not pass any value. + +### -v, --version + +- Prints the current version of TiUP Cluster. +- Data type:`BOOLEAN` +- This option is disabled by default with the `false` value. To enable this option, add this option to the command, and either pass the `true` value or do not pass any value. + +### -h, --help(boolean,默认 false) + +- Prints help information about the specified command. +- Data type: `BOOLEAN` +- This option is disabled by default with the `false` value. To enable this option, add this option to the command, and either pass the `true` value or do not pass any value. + +## List of commands + +- [import](/tiup/tiup-component-dm-import.md): Imports a DM v1.0 cluster deployed by DM-Ansible. +- [deploy](/tiup/tiup-component-dm-deploy.md): Deploys a cluster based on a specified topology. +- [list](/tiup/tiup-component-dm-list.md): Queries the list of deployed clusters. +- [display](/tiup/tiup-component-dm-display.md): Displays the status of a specified cluster. +- [start](/tiup/tiup-component-dm-start.md): Starts a specified cluster. +- [stop](/tiup/tiup-component-dm-stop.md): Stops a specified cluster. +- [restart](/tiup/tiup-component-dm-restart.md): Restarts a specified cluster. +- [scale-in](/tiup/tiup-component-dm-scale-in.md): Scales in a specified cluster. +- [scale-out](/tiup/tiup-component-dm-scale-out.md): Scales out a specified cluster. +- [upgrade](/tiup/tiup-component-dm-upgrade.md): Upgrades a specified cluster. +- [prune](/tiup/tiup-component-dm-prune.md): Cleans up instances in the Tombstone status for a specified cluster. +- [edit-config](/tiup/tiup-component-dm-edit-config.md): Modifies the configuration of a specified cluster. +- [reload](/tiup/tiup-component-dm-reload.md): Reloads the configuration of a specified cluster. +- [patch](/tiup/tiup-component-dm-patch.md): Replaces a specified service in a deployed cluster. +- [destroy](/tiup/tiup-component-dm-destroy.md): Destroys a specified cluster. +- [audit](/tiup/tiup-component-dm-audit.md): Queries the operation audit log of a specified cluster. +- [help](/tiup/tiup-component-dm-help.md): Prints help information. From 53d84dac2ca713548c1251697bc9bd58a0410ee4 Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Thu, 15 Apr 2021 11:04:01 +0800 Subject: [PATCH 2/9] Apply suggestions from code review Co-authored-by: Grace Cai --- tiup/tiup-component-dm-patch.md | 24 ++++++++++++------------ tiup/tiup-component-dm-restart.md | 10 +++++----- tiup/tiup-component-dm.md | 6 +++--- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index 0e3a06fcf154a..e9d8af1fc917e 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -4,12 +4,12 @@ title: tiup dm patch # tiup dm patch -If you need to dynamically replace the binaries of a service while the cluster is running (namely, keep the cluster available during the replacement process), you can use the `tiup dm patch` command. After the command is executed, TiUP does the following things: +If you need to dynamically replace the binaries of a service while the cluster is running (that is, to keep the cluster available during the replacement), you can use the `tiup dm patch` command. The command does the following: - Uploads the binary package for replacement to the target machine. -- Takes the related nodes offline via the API. +- Takes the related nodes offline using the API. - Stops the target service. -- Unpacks the binary package and replace the service. +- Unpacks the binary package and replaces the service. - Starts the target service. ## Syntax @@ -20,7 +20,7 @@ tiup dm patch [flags] - ``: The name of the cluster to be operated. - ``: The path to the binary package used for replacement. The steps to generate the package are as follows: - - Determine the name `${component}` (dm-master, dm-worker ...) of the component to be replaced (tidb, tikv, pd...), the `${version}` of the component (v2.0.0, v2.0.1 ...), and the operating system `${os}` and platform `${arch}` on which the component runs. + - Determine the name `${component}` (dm-master, dm-worker ...) of the component to be replaced, the `${version}` of the component (v2.0.0, v2.0.1 ...), and the operating system `${os}` and platform `${arch}` on which the component runs. - Download the current component package using the command `wget https://tiup-mirrors.pingcap.com/${component}-${version}-${os}-${arch}.tar.gz -O /tmp/${component}-${version}-${os}-${arch}.tar.gz`. - Run `mkdir -p /tmp/package && cd /tmp/package` to create a temporary directory to pack files. - Run `tar xf /tmp/${component}-${version}-${os}-${arch}.tar.gz` to unpack the original binary package. @@ -33,15 +33,15 @@ tiup dm patch [flags] ### --overwrite -- After you patch a certain component (such as TiDB or TiKV), when the tiup cluster scales out the component, tiup-dm uses the original component version by default. To use the version that you patch when the cluster scales out in the future, you need to specified the option `--overwrite` in the command. +- After you patch a certain component (such as TiDB or TiKV), when the tiup cluster scales out the component, tiup-dm uses the original component version by default. To use the version that you patch when the cluster scales out in the future, you need to specify the option `--overwrite` in the command. - Data type: `BOOLEAN` - This option is disabled by default with the `false` value. To enable this option, add this option to the command, and either pass the `true` value or do not pass any value. ### -N, --node -- Specifies nodes to be replaced. The value of this option is a comma-separated list of node IDs. You can get the node ID from the first column of the [cluster status table](/tiup/tiup-component-cluster-display.md). -- Data type: `STRINGS` -- If this option is not specified, TiUP does not select any nodes to replace by default. +- Specifies the nodes to be replaced. The value of this option is a comma-separated list of node IDs. You can get the node IDs from the first column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup cluster display` command. +- Data type: `STRING` +- If this option is not specified, TiUP selects all nodes to replace by default. > **Note:** > @@ -49,9 +49,9 @@ tiup dm patch [flags] ### -R, --role -- Specified roles to be replaced. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the [cluster status table](/tiup/tiup-component-cluster-display.md). -- Data type: `STRINGS` -- If this option is not specified, TiUP does not select any roles to replace by default. +- Specified the roles to be replaced. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup cluster display` command. +- Data type: `STRING` +- If this option is not specified, TiUP selects all roles to replace by default. > **Note:** > @@ -65,4 +65,4 @@ tiup dm patch [flags] ## Outputs -The execution log of tiup-dm. \ No newline at end of file +The execution log of tiup-dm. diff --git a/tiup/tiup-component-dm-restart.md b/tiup/tiup-component-dm-restart.md index 841aa4a68235f..e04eda8312108 100644 --- a/tiup/tiup-component-dm-restart.md +++ b/tiup/tiup-component-dm-restart.md @@ -22,8 +22,8 @@ tiup dm restart [flags] ### -N, --node -- Specifies the nodes to be restarted. The value of this option is a comma-separated list of node IDs. You can get the node ID from the first column of the [cluster status table](/tiup/tiup-component-cluster-display.md). -- Data type: `STRINGS` +- Specifies the nodes to be restarted. The value of this option is a comma-separated list of node IDs. You can get the node IDs from the first column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup cluster display` command. +- Data type: `STRING` - If this option is not specified, TiUP restarts all nodes by default. > **Note:** @@ -32,8 +32,8 @@ tiup dm restart [flags] ### -R, --role -- Specified roles of nodes to be restarted. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the [cluster status table](/tiup/tiup-component-cluster-display.md). -- Data type: `STRINGS` +- Specified the roles of nodes to be restarted. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup dm display` command. +- Data type: `STRING` - If this option is not specified, TiUP restarts nodes of all roles by default. > **Note:** @@ -48,4 +48,4 @@ tiup dm restart [flags] ## Outputs -The log of the service restart process. \ No newline at end of file +The log of the service restart process. diff --git a/tiup/tiup-component-dm.md b/tiup/tiup-component-dm.md index 77342d7bc1be1..1ad23750857ae 100644 --- a/tiup/tiup-component-dm.md +++ b/tiup/tiup-component-dm.md @@ -4,7 +4,7 @@ title: TiUP DM # TiUP DM -Similar to [TiUP Cluster](/tiup/tiup-component-cluster.md) which is used to manage TiDB clusters, TiUP DM is a cluster management component for DM clusters. You can use the TiUP DM component to perform daily operations and maintenance tasks of DM clusters, including deploying, starting, stopping, destroying, elastic scaling, upgrading DM clusters, and managing the configuration parameters of the DM cluster. +Similar to [TiUP Cluster](/tiup/tiup-component-cluster.md) which is used to manage TiDB clusters, TiUP DM is used to manage DM clusters. You can use the TiUP DM component to perform daily operations and maintenance tasks of DM clusters, including deploying, starting, stopping, destroying, elastic scaling, upgrading DM clusters, and managing the configuration parameters of DM clusters. ## Syntax @@ -48,11 +48,11 @@ tiup dm [command] [flags] ### -v, --version -- Prints the current version of TiUP Cluster. +- Prints the current version of TiUP DM. - Data type:`BOOLEAN` - This option is disabled by default with the `false` value. To enable this option, add this option to the command, and either pass the `true` value or do not pass any value. -### -h, --help(boolean,默认 false) +### -h, --help - Prints help information about the specified command. - Data type: `BOOLEAN` From 34639a016a80805c0c41c93c4f70f6ba9a23e098 Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Thu, 15 Apr 2021 11:07:06 +0800 Subject: [PATCH 3/9] Update tiup/tiup-component-dm-patch.md --- tiup/tiup-component-dm-patch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index e9d8af1fc917e..c41be3c7233c6 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -27,7 +27,7 @@ tiup dm patch [flags] - Run `find .` to view the file structure in the temporary package directory. - Copy the binary files or configuration files to the corresponding locations in the temporary directory. - Run `tar czf /tmp/${component}-hotfix-${os}-${arch}.tar.gz *` to pack the files in the temporary directory. - - Finally, you can use `/tmp/${component}-hotfix-${os}-${arch}.tar.gz` as the `` in the `tiup cluster patch` command. + - Finally, you can use `/tmp/${component}-hotfix-${os}-${arch}.tar.gz` as the `` in the `tiup dm patch` command. ## Options From a9f8dd329f91fdff15b9a58e2b2472d20751eba7 Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Thu, 15 Apr 2021 11:17:01 +0800 Subject: [PATCH 4/9] change `tiup cluster` to `tiup dm` --- tiup/tiup-component-dm-patch.md | 4 ++-- tiup/tiup-component-dm-restart.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index c41be3c7233c6..6f2e3b4377b0e 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -39,7 +39,7 @@ tiup dm patch [flags] ### -N, --node -- Specifies the nodes to be replaced. The value of this option is a comma-separated list of node IDs. You can get the node IDs from the first column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup cluster display` command. +- Specifies the nodes to be replaced. The value of this option is a comma-separated list of node IDs. You can get the node IDs from the first column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup dm display` command. - Data type: `STRING` - If this option is not specified, TiUP selects all nodes to replace by default. @@ -49,7 +49,7 @@ tiup dm patch [flags] ### -R, --role -- Specified the roles to be replaced. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup cluster display` command. +- Specified the roles to be replaced. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup dm display` command. - Data type: `STRING` - If this option is not specified, TiUP selects all roles to replace by default. diff --git a/tiup/tiup-component-dm-restart.md b/tiup/tiup-component-dm-restart.md index e04eda8312108..63e1b4a143734 100644 --- a/tiup/tiup-component-dm-restart.md +++ b/tiup/tiup-component-dm-restart.md @@ -22,7 +22,7 @@ tiup dm restart [flags] ### -N, --node -- Specifies the nodes to be restarted. The value of this option is a comma-separated list of node IDs. You can get the node IDs from the first column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup cluster display` command. +- Specifies the nodes to be restarted. The value of this option is a comma-separated list of node IDs. You can get the node IDs from the first column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup dm display` command. - Data type: `STRING` - If this option is not specified, TiUP restarts all nodes by default. From 6f3e6a921771b97a433af46356cf3e7aa1424b6f Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Thu, 15 Apr 2021 14:15:24 +0800 Subject: [PATCH 5/9] Update tiup-component-dm-patch.md --- tiup/tiup-component-dm-patch.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index 6f2e3b4377b0e..517632d0b35bf 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -19,15 +19,20 @@ tiup dm patch [flags] ``` - ``: The name of the cluster to be operated. -- ``: The path to the binary package used for replacement. The steps to generate the package are as follows: - - Determine the name `${component}` (dm-master, dm-worker ...) of the component to be replaced, the `${version}` of the component (v2.0.0, v2.0.1 ...), and the operating system `${os}` and platform `${arch}` on which the component runs. - - Download the current component package using the command `wget https://tiup-mirrors.pingcap.com/${component}-${version}-${os}-${arch}.tar.gz -O /tmp/${component}-${version}-${os}-${arch}.tar.gz`. - - Run `mkdir -p /tmp/package && cd /tmp/package` to create a temporary directory to pack files. - - Run `tar xf /tmp/${component}-${version}-${os}-${arch}.tar.gz` to unpack the original binary package. - - Run `find .` to view the file structure in the temporary package directory. - - Copy the binary files or configuration files to the corresponding locations in the temporary directory. - - Run `tar czf /tmp/${component}-hotfix-${os}-${arch}.tar.gz *` to pack the files in the temporary directory. - - Finally, you can use `/tmp/${component}-hotfix-${os}-${arch}.tar.gz` as the `` in the `tiup dm patch` command. +- ``: The path to the binary package used for replacement. + +### Preparation + +You need to pack the binary package required for this command in advance according to the following steps: + +- Determine the name `${component}` of the component to be replaced (dm-master, dm-worker ...), the `${version}` of the component (v2.0.0, v2.0.1 ...), and the operating system `${os}` and platform `${arch}` on which the component runs. +- Download the current component package using the command `wget https://tiup-mirrors.pingcap.com/${component}-${version}-${os}-${arch}.tar.gz -O /tmp/${component}-${version}-${os}-${arch}.tar.gz`. +- Run `mkdir -p /tmp/package && cd /tmp/package` to create a temporary directory to pack files. +- Run `tar xf /tmp/${component}-${version}-${os}-${arch}.tar.gz` to unpack the original binary package. +- Run `find .` to view the file structure in the temporary package directory. +- Copy the binary files or configuration files to the corresponding locations in the temporary directory. +- Run `tar czf /tmp/${component}-hotfix-${os}-${arch}.tar.gz *` to pack the files in the temporary directory. +- Finally, you can use `/tmp/${component}-hotfix-${os}-${arch}.tar.gz` as the value of `` in the `tiup dm patch` command. ## Options From 27af41dc9ed23c3a66a095e439ac8b31c2de1423 Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Thu, 15 Apr 2021 14:30:20 +0800 Subject: [PATCH 6/9] Apply suggestions from code review Co-authored-by: Grace Cai --- tiup/tiup-component-dm-patch.md | 4 ++-- tiup/tiup-component-dm-restart.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index 517632d0b35bf..0383d221a4471 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -44,7 +44,7 @@ You need to pack the binary package required for this command in advance accordi ### -N, --node -- Specifies the nodes to be replaced. The value of this option is a comma-separated list of node IDs. You can get the node IDs from the first column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup dm display` command. +- Specifies the nodes to be replaced. The value of this option is a comma-separated list of node IDs. You can get the node IDs from the first column of the cluster status table returned by the `[tiup dm display](/tiup/tiup-component-dm-display.md)` command. - Data type: `STRING` - If this option is not specified, TiUP selects all nodes to replace by default. @@ -54,7 +54,7 @@ You need to pack the binary package required for this command in advance accordi ### -R, --role -- Specified the roles to be replaced. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup dm display` command. +- Specified the roles to be replaced. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the cluster status table returned by the `[tiup dm display](/tiup/tiup-component-dm-display.md)` command. - Data type: `STRING` - If this option is not specified, TiUP selects all roles to replace by default. diff --git a/tiup/tiup-component-dm-restart.md b/tiup/tiup-component-dm-restart.md index 63e1b4a143734..ac1aadd61d8fc 100644 --- a/tiup/tiup-component-dm-restart.md +++ b/tiup/tiup-component-dm-restart.md @@ -22,7 +22,7 @@ tiup dm restart [flags] ### -N, --node -- Specifies the nodes to be restarted. The value of this option is a comma-separated list of node IDs. You can get the node IDs from the first column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup dm display` command. +- Specifies the nodes to be restarted. The value of this option is a comma-separated list of node IDs. You can get the node IDs from the first column of the cluster status table returned by the `[tiup dm display](/tiup/tiup-component-dm-display.md)` command. - Data type: `STRING` - If this option is not specified, TiUP restarts all nodes by default. @@ -32,7 +32,7 @@ tiup dm restart [flags] ### -R, --role -- Specified the roles of nodes to be restarted. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the [cluster status table](/tiup/tiup-component-dm-display.md) returned by the `tiup dm display` command. +- Specified the roles of nodes to be restarted. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the cluster status table returned by the `[tiup dm display](/tiup/tiup-component-dm-display.md)` command. - Data type: `STRING` - If this option is not specified, TiUP restarts nodes of all roles by default. From 5302d397da500ae9015db521a1814faa8ffdf8ae Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Thu, 15 Apr 2021 16:54:23 +0800 Subject: [PATCH 7/9] Update tiup/tiup-component-dm-restart.md Co-authored-by: JoyinQ <56883733+Joyinqin@users.noreply.github.com> --- tiup/tiup-component-dm-restart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-component-dm-restart.md b/tiup/tiup-component-dm-restart.md index ac1aadd61d8fc..278dab2aef4e1 100644 --- a/tiup/tiup-component-dm-restart.md +++ b/tiup/tiup-component-dm-restart.md @@ -32,7 +32,7 @@ tiup dm restart [flags] ### -R, --role -- Specified the roles of nodes to be restarted. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the cluster status table returned by the `[tiup dm display](/tiup/tiup-component-dm-display.md)` command. +- Specifies the roles of nodes to be restarted. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the cluster status table returned by the `[tiup dm display](/tiup/tiup-component-dm-display.md)` command. - Data type: `STRING` - If this option is not specified, TiUP restarts nodes of all roles by default. From 163a070fdb9e7b57f387b0936847baf77a2cd25e Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Thu, 15 Apr 2021 16:55:14 +0800 Subject: [PATCH 8/9] Update tiup/tiup-component-dm-patch.md --- tiup/tiup-component-dm-patch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index 0383d221a4471..710ec5c59a0b9 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -54,7 +54,7 @@ You need to pack the binary package required for this command in advance accordi ### -R, --role -- Specified the roles to be replaced. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the cluster status table returned by the `[tiup dm display](/tiup/tiup-component-dm-display.md)` command. +- Specifies the roles to be replaced. The value of this option is a comma-separated list of the roles of the nodes. You can get the roles of the nodes from the second column of the cluster status table returned by the `[tiup dm display](/tiup/tiup-component-dm-display.md)` command. - Data type: `STRING` - If this option is not specified, TiUP selects all roles to replace by default. From 8453c6d5cd1692741d3682c428cd492f3cee2c72 Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Thu, 15 Apr 2021 19:02:10 +0800 Subject: [PATCH 9/9] Apply suggestions from code review Co-authored-by: Allen Zhong Co-authored-by: SIGSEGV --- tiup/tiup-component-dm-patch.md | 2 +- tiup/tiup-component-dm.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index 710ec5c59a0b9..65d4641d0078b 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -38,7 +38,7 @@ You need to pack the binary package required for this command in advance accordi ### --overwrite -- After you patch a certain component (such as TiDB or TiKV), when the tiup cluster scales out the component, tiup-dm uses the original component version by default. To use the version that you patch when the cluster scales out in the future, you need to specify the option `--overwrite` in the command. +- After you patch a certain component (such as dm-worker), when the tiup-dm scales out the component, tiup-dm uses the original component version by default. To use the version that you patch when the cluster scales out in the future, you need to specify the option `--overwrite` in the command. - Data type: `BOOLEAN` - This option is disabled by default with the `false` value. To enable this option, add this option to the command, and either pass the `true` value or do not pass any value. diff --git a/tiup/tiup-component-dm.md b/tiup/tiup-component-dm.md index 1ad23750857ae..c988ea80c9ec9 100644 --- a/tiup/tiup-component-dm.md +++ b/tiup/tiup-component-dm.md @@ -24,7 +24,7 @@ tiup dm [command] [flags] - `builtin`: Uses the built-in easyssh client of tiup-cluster as the SSH client. - `system`: Uses the default SSH client of the current operating system. - - `none`: The SSH client is not used. The deployment is only for the current machine. + - `none`: No SSH client is used. The deployment is only for the current machine. - If this option is not specified in the command, `builtin` is used as the default value.