From 79aeb4c1fe750d8741adfdf2cb005426b191b7d9 Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Wed, 14 Apr 2021 13:45:57 +0800 Subject: [PATCH 1/3] add 3 tiup docs --- tiup/tiup-component-cluster-rename.md | 36 ++++++++++++++++ tiup/tiup-component-cluster-restart.md | 53 +++++++++++++++++++++++ tiup/tiup-component-dm-import.md | 60 ++++++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 tiup/tiup-component-cluster-rename.md create mode 100644 tiup/tiup-component-cluster-restart.md create mode 100644 tiup/tiup-component-dm-import.md diff --git a/tiup/tiup-component-cluster-rename.md b/tiup/tiup-component-cluster-rename.md new file mode 100644 index 0000000000000..bff99db4a2b49 --- /dev/null +++ b/tiup/tiup-component-cluster-rename.md @@ -0,0 +1,36 @@ +--- +title: tiup cluster rename +--- + +# tiup cluster rename + +The cluster name is specified when [the cluster is deployed](/tiup/tiup-component-cluster-deploy.md). If you want to change the cluster name after the cluster is deployed, you can use the command `tiup cluster rename`. + +> **Note:** +> +> If the tiup cluster is configured with the `dashboard_dir` field of `grafana_servers`, when you execute the command `tiup cluster rename` to rename the cluster, the following additional steps are required: +> +> + For the `*.json` files in the local dashboards directory, update the `datasource` field of each file to the new cluster name, because the value of `datasource` must be the name of the cluster. +> + 执行 `tiup cluster reload -R grafana` 命令 +> + Execute the command `tiup cluster reload -R grafana`. + +## Syntax + +```shell +tiup cluster rename [flags] +``` + +- ``: The old cluster name. +- ``: The new cluster name. + +## Options + +### -h, --help + +- Prints help information. +- Data type: `BOOLEAN` +- Default: false + +## Outputs + +The execution log of the tiup-cluster \ 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 0000000000000..5213ff681873a --- /dev/null +++ b/tiup/tiup-component-cluster-restart.md @@ -0,0 +1,53 @@ +--- +title: tiup cluster restart +--- + +# tiup cluster restart + +The command `tiup cluster 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 cluster 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` +- Default: false + +## Outputs + +The log of the service restart process. \ 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 0000000000000..d7508927f5ca0 --- /dev/null +++ b/tiup/tiup-component-dm-import.md @@ -0,0 +1,60 @@ +--- +title: tiup dm import +--- + +# tiup dm import + +In DM v1.0, the cluster is basically deployed using TiDB Ansible. TiUP DM provides the `import` command to import v1.0 clusters and redeploy the clusters in DM v2.0. + +> **Note:** +> +> - The command does not support importing DM Portal components from DM v1.0 clusters. +> - Before importing the cluster, stop running the original cluster first. +> - For data migration tasks that need to be upgraded to v2.0, do not execute `stop-task` on these tasks. +> - The command only supports importing to DM v2.0.0-rc.2 and later versions. +> - The `import` command is used to import a DM v1.0 cluster to a new DM v2.0 cluster. If you need to import data migration tasks to an existing v2.0 cluster, refer to [Manually Upgrade TiDB Data Migration from v1.0.x to v2.0.x](https://docs.pingcap.com/tidb-data-migration/stable/manually-upgrade-dm-1.0-to-2.0) +> - The deployment directories of some components might be different from those in the original cluster. You can check it with the `display` command. +> - Before importing the cluster, run `tiup update --self && tiup update dm` to upgrade TiUP DM components to the latest version. +> - After the cluster is imported, there is only one DM-master node in the cluster. You can refer to [the `scale out` command](/tiup/tiup-component-dm-scale-out.md) to scale out the DM-master node. + +## Syntax + +```shell +tiup dm import [flags] +``` + +## Options + +### -v, --cluster-version + +- Specifies the version number for redeploying. You must use a version later than v2.0.0-rc.2 (including v2.0.0-rc.2). +- Data type: `STRING` +- This option is **required** to execute the command. + +### -d, --dir + +- Specifies the directory of TiDB Ansible. +- Data type: `STRING` +- If this option is not specified in the command, the current directory is the default directory. + +### --inventory + +- Specifies the name of the Ansible inventory file. +- Data type: `STRING` +- If this option is not specified in the command, the default file name is `"inventory.ini"`. + +### --rename + +- Renames the imported cluster. +- Data type: `STRING` +- If this option is not specified in the command, the default cluster name is the `cluster_name` specified in the inventory file. + +### -h, --help + +- Prints help information. +- Data type: `BOOLEAN` +- Default: false + +## Outputs + +The log of the importing process. From d68d64a944edd554cba2936e8ba0514d97085524 Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Wed, 14 Apr 2021 13:51:12 +0800 Subject: [PATCH 2/3] refine and unify expressions --- tiup/tiup-component-cluster-rename.md | 5 ++--- tiup/tiup-component-cluster-restart.md | 2 +- tiup/tiup-component-dm-import.md | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tiup/tiup-component-cluster-rename.md b/tiup/tiup-component-cluster-rename.md index bff99db4a2b49..e86870f3f4e7b 100644 --- a/tiup/tiup-component-cluster-rename.md +++ b/tiup/tiup-component-cluster-rename.md @@ -11,7 +11,6 @@ The cluster name is specified when [the cluster is deployed](/tiup/tiup-componen > If the tiup cluster is configured with the `dashboard_dir` field of `grafana_servers`, when you execute the command `tiup cluster rename` to rename the cluster, the following additional steps are required: > > + For the `*.json` files in the local dashboards directory, update the `datasource` field of each file to the new cluster name, because the value of `datasource` must be the name of the cluster. -> + 执行 `tiup cluster reload -R grafana` 命令 > + Execute the command `tiup cluster reload -R grafana`. ## Syntax @@ -29,8 +28,8 @@ tiup cluster rename [flags] - Prints help information. - Data type: `BOOLEAN` -- Default: false +- 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 the tiup-cluster \ No newline at end of file +The execution log of the 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 5213ff681873a..425d2ce4496ee 100644 --- a/tiup/tiup-component-cluster-restart.md +++ b/tiup/tiup-component-cluster-restart.md @@ -46,7 +46,7 @@ tiup cluster restart [flags] - Prints help information. - Data type: `BOOLEAN` -- Default: false +- 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 diff --git a/tiup/tiup-component-dm-import.md b/tiup/tiup-component-dm-import.md index d7508927f5ca0..fd5f023e10bf2 100644 --- a/tiup/tiup-component-dm-import.md +++ b/tiup/tiup-component-dm-import.md @@ -53,7 +53,7 @@ tiup dm import [flags] - Prints help information. - Data type: `BOOLEAN` -- Default: false +- 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 From c3046671681dbecd8df8206b50e5c31480328815 Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Thu, 15 Apr 2021 11:14:22 +0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Grace Cai --- tiup/tiup-component-cluster-rename.md | 4 ++-- tiup/tiup-component-cluster-restart.md | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tiup/tiup-component-cluster-rename.md b/tiup/tiup-component-cluster-rename.md index e86870f3f4e7b..6042bbced0c00 100644 --- a/tiup/tiup-component-cluster-rename.md +++ b/tiup/tiup-component-cluster-rename.md @@ -8,7 +8,7 @@ The cluster name is specified when [the cluster is deployed](/tiup/tiup-componen > **Note:** > -> If the tiup cluster is configured with the `dashboard_dir` field of `grafana_servers`, when you execute the command `tiup cluster rename` to rename the cluster, the following additional steps are required: +> If the `dashboard_dir` field of `grafana_servers` is configured for the TiUP cluster, after you execute the command `tiup cluster rename` to rename the cluster, the following additional steps are required: > > + For the `*.json` files in the local dashboards directory, update the `datasource` field of each file to the new cluster name, because the value of `datasource` must be the name of the cluster. > + Execute the command `tiup cluster reload -R grafana`. @@ -32,4 +32,4 @@ tiup cluster rename [flags] ## Outputs -The execution log of the tiup-cluster. \ No newline at end of file +The execution log of the tiup-cluster. diff --git a/tiup/tiup-component-cluster-restart.md b/tiup/tiup-component-cluster-restart.md index 425d2ce4496ee..0da657da69415 100644 --- a/tiup/tiup-component-cluster-restart.md +++ b/tiup/tiup-component-cluster-restart.md @@ -18,14 +18,12 @@ tiup cluster 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` +- 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-cluster-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:** @@ -34,8 +32,8 @@ tiup cluster 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-cluster-display.md) returned by the `tiup cluster display` command. +- Data type: `STRING` - If this option is not specified, TiUP restarts nodes of all roles by default. > **Note:** @@ -50,4 +48,4 @@ tiup cluster restart [flags] ## Outputs -The log of the service restart process. \ No newline at end of file +The log of the service restart process.