diff --git a/tiup/tiup-cluster-topology-reference.md b/tiup/tiup-cluster-topology-reference.md index 257894e5b31d2..8a4c90365cf13 100644 --- a/tiup/tiup-cluster-topology-reference.md +++ b/tiup/tiup-cluster-topology-reference.md @@ -647,6 +647,10 @@ tispark_workers: - `storage_retention`: The retention time of the Prometheus monitoring data. The default value is `"15d"`. - `rule_dir`: Specifies a local directory that should contain complete `*.rules.yml` files. These files are transferred to the target machine during the initialization phase of the cluster configuration as the rules for Prometheus. +- `remote_config`: Supports writing Prometheus data to the remote, or reading data from the remote. This field has two configurations: + - `remote_write`: See the Prometheus document [``](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write). + - `remote_read`: See the Prometheus document [``](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_read). +- `external_alertmanagers`: If the `external_alertmanagers` field is configured, Prometheus alerts the configuration behavior to the Alertmanager that is outside the cluster. This field is an array, each element of which is an external Alertmanager and consists of the `host` and `web_port` fields. - `os`: The operating system of the machine specified in `host`. If this field is not specified, the default value is the `os` value in `global`. @@ -670,6 +674,21 @@ A `monitoring_servers` configuration example is as follows: monitoring_servers: - host: 10.0.1.11 rule_dir: /local/rule/dir + remote_config: + remote_write: + - queue_config: + batch_send_deadline: 5m + capacity: 100000 + max_samples_per_send: 10000 + max_shards: 300 + url: http://127.0.0.1:8003/write + remote_read: + - url: http://127.0.0.1:8003/read + external_alertmanagers: + - host: 10.1.1.1 + web_port: 9093 + - host: 10.1.1.2 + web_port: 9094 ``` ### `grafana_servers` diff --git a/tiup/tiup-command-status.md b/tiup/tiup-command-status.md index 78791031b4c46..3529692ab3a6b 100644 --- a/tiup/tiup-command-status.md +++ b/tiup/tiup-command-status.md @@ -8,7 +8,7 @@ The `tiup status` command is used to view the operation information of the compo > **Note:** > -> You can only query the information of the following components: +> You can only check the information of the following components: > > - Components that are still in operation > - Components that run through the tag specified by `tiup -T/--tag` diff --git a/tiup/tiup-component-cluster-check.md b/tiup/tiup-component-cluster-check.md index 99b4dfd53bf1f..044c207e4f648 100644 --- a/tiup/tiup-component-cluster-check.md +++ b/tiup/tiup-component-cluster-check.md @@ -154,6 +154,26 @@ tiup cluster check [flags] > > If the `tiup cluster check ` command is used, you must add the `--cluster` option: `tiup cluster check --cluster`. +### -N, --node + +- Specifies the nodes to be checked. 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 cluster display`](/tiup/tiup-component-cluster-display.md) command. +- Data type: `STRINGS` +- If this option is not specified in the command, all nodes are checked by default. + +> **Note:** +> +> If the `-R, --role` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are checked. + +### -R, --role + +- Specifies the roles to be checked. The value of this option is a comma-separated list of node roles. You can get the roles of nodes from the second column of the cluster status table returned by the [`tiup cluster display`](/tiup/tiup-component-cluster-display.md) command. +- Data type: `STRINGS` +- If this option is not specified in the command, all roles are checked by default. + +> **Note:** +> +> If the `-N, --node` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are checked. + ### --enable-cpu - Enables the check of CPU core number. diff --git a/tiup/tiup-component-cluster-disable.md b/tiup/tiup-component-cluster-disable.md index 14142c8c771ec..a75d0c761b7b8 100644 --- a/tiup/tiup-component-cluster-disable.md +++ b/tiup/tiup-component-cluster-disable.md @@ -4,7 +4,7 @@ title: tiup cluster disable # tiup cluster disable -The `tiup cluster disable` command is used to disable the auto-enabling after restarting the machine where the cluster service is located. This command executes the `systemctl disable ` on the specified node to disable the auto-enabling of the service. +After restarting the machine on which the cluster service is located, the cluster service will be automatically enabled. To disable the auto-enabling of cluster service, you can use the `tiup cluster disable` command. This command executes `systemctl disable ` on the specified node to disable the auto-enabling of the service. ## Syntax @@ -12,29 +12,29 @@ The `tiup cluster disable` command is used to disable the auto-enabling after re tiup cluster disable [flags] ``` -``: the cluster whose auto-enabling service is to be disabled. +``: the cluster whose service auto-enabling is to be disabled. ## Options ### -N, --node -- Specifies the nodes whose auto-enabling service is to be disabled. The value of this option is a comma-separated list of node IDs. The node ID is the first column of the [cluster status](/tiup/tiup-component-cluster-display.md) table. -- Data type: `strings` -- Default: `[]`, which means no node is selected. +- Specifies the nodes whose service auto-enabling is to be disabled. 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 cluster display`](/tiup/tiup-component-cluster-display.md) command. +- Data type: `STRINGS` +- If this option is not specified in the command, the auto-enabling of all nodes is disabled by default. > **Note:** > -> If the `-R, --role` option is specified at the same time, the auto-enabling of services in their intersection is disabled. +> If the `-R, --role` option is specified at the same time, the auto-enabling of services that match both the specifications of `-N, --node` and `-R, --role` is disabled. ### -R, --role -- Data type: `strings` -- Default: `[]`, which means no role is selected. -- Specifies the roles whose auto-enabling service is to be disabled. The value of this option is a comma-separated list of node roles. The role is the second column of the [cluster status](/tiup/tiup-component-cluster-display.md) table. +- Specifies the roles whose service auto-enabling is to be disabled. The value of this option is a comma-separated list of node roles. You can get the roles of nodes from the second column of the cluster status table returned by the [`tiup cluster display`](/tiup/tiup-component-cluster-display.md) command. +- Data type: `STRINGS` +- If this option is not specified in the command, the auto-enabling of all roles is disabled by default. > **Note:** > -> If the `-N, --node` option is specified at the same time, the auto-enabling of services in their intersection is disabled. +> If the `-N, --node` option is specified at the same time, the auto-enabling of services that match both the specifications of `-N, --node` and `-R, --role` is disabled. ### -h, --help diff --git a/tiup/tiup-component-cluster-display.md b/tiup/tiup-component-cluster-display.md index 3eed2a1e91c1e..0ab1d0fc0f919 100644 --- a/tiup/tiup-component-cluster-display.md +++ b/tiup/tiup-component-cluster-display.md @@ -24,23 +24,23 @@ tiup cluster display [flags] ### -N, --node -- Specifies the node to query. If not specified, all nodes are queried. The value of this option is a comma-separated list of node IDs. The node ID is the first column of the [cluster status](/tiup/tiup-component-cluster-display.md) table. -- Data type: `strings` -- Default: `[]`, which means all nodes. +- Specifies the node to display. If this option is not specified, all nodes are displayed. The value of this option is a comma-separated list of node IDs. If you are not sure about the ID of a node, you can skip this option in the command to show the IDs and status of all nodes in the output. +- Data type: `STRINGS` +- If this option is not specified in the command, all nodes are checked by default. > **Note:** > -> If the `-R, --role` option is specified at the same time, then the service status in their intersection is queried. +> If the `-R, --role` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are checked. -### -R, --role strings +### -R, --role -- Specifies the role to query. If not specified, all roles are queried. The value of this option is a comma-separated list of node roles. The role is the second column of the [cluster status](/tiup/tiup-component-cluster-display.md) table. -- Data type: `strings` -- Default: `[]`, which means all roles. +- Specifies the role to display. If it is not specified, all roles are displayed. The value of this option is a comma-separated list of node roles. If you are not sure about the role deployed on a node, you can skip this option in the command to show the roles and status of all nodes in the output. +- Data type: `STRINGS` +- If this option is not specified in the command, all roles are displayed by default. > **Note:** > -> If the `-N, --node` option is specified at the same time, then the service status in their intersection is queried. +> If the `-N, --node` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are displayed. ### -h, --help diff --git a/tiup/tiup-component-cluster-enable.md b/tiup/tiup-component-cluster-enable.md index 7431182c4a440..1a0eeb98a8153 100644 --- a/tiup/tiup-component-cluster-enable.md +++ b/tiup/tiup-component-cluster-enable.md @@ -4,7 +4,7 @@ title: tiup cluster enable # tiup cluster enable -The `tiup cluster enable` command is used to set the self-enabling of the cluster service after a machine restarts. To enable the self-enabling of the service, this command executes `systemctl enable ` at the specified node. +The `tiup cluster enable` command is used to set the auto-enabling of the cluster service after a machine is restarted. This command enables the auto-enabling of the service by executing `systemctl enable ` at the specified node. > **Note:** > @@ -16,35 +16,35 @@ The `tiup cluster enable` command is used to set the self-enabling of the cluste tiup cluster enable [flags] ``` -``: the cluster whose auto-enabling service is to be enabled. +``: the cluster whose service auto-enabling is to be enabled. ## Options ### -N, --node -- Specifies the nodes whose auto-enabling service is to be enabled. The value of this option is a comma-separated list of node IDs. The node ID is the first column of the [cluster status](/tiup/tiup-component-cluster-display.md) table. -- Data type: `strings` -- Default: `[]`, which means no node is selected. +- Specifies the nodes whose service auto-enabling is to be enabled. 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 cluster display`](/tiup/tiup-component-cluster-display.md) command. +- Data type: `STRINGS` +- If this option is not specified in the command, the auto-enabling of all nodes is enabled by default. > **Note:** > -> If the `-R, --role` option is specified at the same time, the auto-enabling of services in their intersection is enabled. +> If the `-R, --role` option is specified at the same time, the auto-enabling of services that match both the specifications of `-N, --node` and `-R, --role` is enabled. ### -R, --role -- Specifies the roles whose auto-enabling service is to be enabled. The value of this option is a comma-separated list of node roles. The role is the second column of the [cluster status](/tiup/tiup-component-cluster-display.md) table. -- Data type: `strings` -- Default: `[]`, which means no role is selected. +- Specifies the roles whose service auto-enabling is to be enabled. The value of this option is a comma-separated list of node roles. You can get the roles of nodes from the second column of the cluster status table returned by the [`tiup cluster display`](/tiup/tiup-component-cluster-display.md) command. +- Data type: `STRINGS` +- If this option is not specified in the command, the auto-enabling of all roles is enabled by default. > **Note:** > -> If the `-N, --node` option is specified at the same time, the auto-enabling of services in their intersection is enabled. +> If the `-N, --node` option is specified at the same time, the auto-enabling of services that match both the specifications of `-N, --node` and `-R, --role` is enabled. ### -h, --help - Prints the 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. ## Output diff --git a/tiup/tiup-component-cluster-patch.md b/tiup/tiup-component-cluster-patch.md index f282a9d9e2135..d68e1bc4a3e5c 100644 --- a/tiup/tiup-component-cluster-patch.md +++ b/tiup/tiup-component-cluster-patch.md @@ -72,9 +72,9 @@ You need to pack the binary package required for this command in advance accordi > > 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`. -## --offline +### --offline -- Declares that the current cluster is not running. When the option is specified, TiUP does not migrate the service leader to another node or restart the service, but only replaces the binary files of cluster components. +- Declares that the current cluster is not running. When the option is specified, TiUP does not evict the service leader to another node or restart the service, but only replaces the binary files of cluster components. - 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-cluster-reload.md b/tiup/tiup-component-cluster-reload.md index 5cacc37185565..8986e26dbb041 100644 --- a/tiup/tiup-component-cluster-reload.md +++ b/tiup/tiup-component-cluster-reload.md @@ -25,7 +25,7 @@ tiup cluster reload [flags] ### --transfer-timeout - When restarting PD or TiKV, the leader of the restarted node is migrated to other nodes first, and the migration process takes some time. You can set the maximum wait time (in seconds) by setting `-transfer-timeout`. After the timeout, the service can be restarted directly without waiting. -- Data type: `uint` +- Data type: `UINT` - Default: 300 > **Note:** @@ -40,24 +40,24 @@ tiup cluster reload [flags] ### -N, --node -- Specifies the nodes to be restarted. If not specified, all nodes are restarted. The value of this option is a comma-separated list of node IDs. The node ID is the first column of the [cluster status](/tiup/tiup-component-cluster-display.md) table. -- Data type: `strings` -- Default: `[]`, which means all nodes are selected. +- Specifies the nodes to be restarted. If not specified, all nodes are 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 cluster display`](/tiup/tiup-component-cluster-display.md) command. +- Data type: `STRINGS` +- If this option is not specified in the command, all nodes are selected by default. > **Note:** > -> + If the `-R, --role` option is specified at the same time, then the service status in their intersection is restarted. +> + If the `-R, --role` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are restarted. > + If the `--skip-restart` option is specified, the `-N, --node` option is invalid. ### -R, --role - Specifies the roles to be restarted. If not specified, all roles are restarted. The value of this option is a comma-separated list of node roles. The role is the second column of the [cluster status](/tiup/tiup-component-cluster-display.md) table. -- Data type: `strings` -- Default: `[]`, which means all roles are selected. +- Data type: `STRINGS` +- If this option is not specified in the command, all roles are selected by default. > **Note:** > -> 1. If the `-N, --node` option is specified at the same time, the services in their intersection is restarted. +> 1. If the `-N, --node` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are restarted. > 2. If the `--skip-restart` option is specified, the `-R, --role` option is invalid. ### --skip-restart diff --git a/tiup/tiup-component-cluster-replay.md b/tiup/tiup-component-cluster-replay.md new file mode 100644 index 0000000000000..f5a375bcf4505 --- /dev/null +++ b/tiup/tiup-component-cluster-replay.md @@ -0,0 +1,25 @@ +--- +title: tiup cluster replay +--- + +# tiup cluster replay + +When you perform a cluster operation such as upgrade or restart, the operation might fail due to cluster environment issues. If you re-perform the operation, you need to perform all the steps from the very beginning. If the cluster is large, re-performing these steps will take a long time. In this case, you can use the `tiup cluster replay` command to retry the failed commands and skip the successfully performed steps. + +## Syntax + +```shell +tiup cluster replay [flags] +``` + +- ``: the `audit-id` of the command to be retried. You can view the historical commands and their `audit-id`s using the [`tiup cluster audit`](/tiup/tiup-component-cluster-audit.md) command. + +## Option + +### -h, --help + +Prints the help information. + +## Output + +The output of the command corresponding to ``. diff --git a/tiup/tiup-component-cluster-start.md b/tiup/tiup-component-cluster-start.md index 60c2299438af6..6f7085c557005 100644 --- a/tiup/tiup-component-cluster-start.md +++ b/tiup/tiup-component-cluster-start.md @@ -19,8 +19,8 @@ tiup cluster start [flags] ### -N, --node - Specifies the nodes to be started. 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` -- Default: `[]`. If this option is not specified in the command, all nodes are started. +- Data type: `STRINGS` +- If this option is not specified in the command, all nodes are started by default. > **Note:** > @@ -28,9 +28,9 @@ tiup cluster start [flags] ### -R, --role -- Specified the roles of nodes to be started. 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` -- Default: `[]`. If this option is not specified in the command, all roles are started. +- Specifies the roles of nodes to be started. 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: `STRINGS` +- If this option is not specified in the command, all roles are started by default. > **Note:** > diff --git a/tiup/tiup-component-cluster-stop.md b/tiup/tiup-component-cluster-stop.md index c208b82feddde..6c2b4d9cdc872 100644 --- a/tiup/tiup-component-cluster-stop.md +++ b/tiup/tiup-component-cluster-stop.md @@ -23,8 +23,8 @@ tiup cluster stop [flags] ### -N, --node - Specifies the nodes to be stopped. 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` -- Default: []. If this option is not specified in the command, the command stops all the nodes. +- Data type: `STRINGS` +- If this option is not specified in the command, the command stops all the nodes by default. > **Note:** > @@ -33,8 +33,8 @@ tiup cluster stop [flags] ### -R, --role - Specifies the roles of nodes to be stopped. 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` -- Default: []. If this option is not specified in the command, the command stops all the roles. +- Data type: `STRINGS` +- If this option is not specified in the command, the command stops all the roles by default. > **Note:** > diff --git a/tiup/tiup-component-cluster-template.md b/tiup/tiup-component-cluster-template.md new file mode 100644 index 0000000000000..1b6a47aa2e54a --- /dev/null +++ b/tiup/tiup-component-cluster-template.md @@ -0,0 +1,42 @@ +--- +title: tiup cluster template +--- + +# tiup cluster template + +Before deploying the cluster, you need to prepare a [topology file](/tiup/tiup-cluster-topology-reference.md) of the cluster. TiUP has a built-in topology file template, and you can modify this template to create the final topology file. To output the built-in template content, you can use the `tiup cluster template` command. + +## Syntax + +```shell +tiup cluster template [flags] +``` + +If this option is not specified, the output default template contains the following instances: + +- 3 PD instances +- 3 TiKV instances +- 1 TiDB instance +- 1 Prometheus instance +- 1 Grafana instance +- 1 Alertmanager instance + +## Options + +### --full + +- Outputs a detailed topology template that is commented with configurable parameters. To enable this option, add it to the command. +- If this option is not specified, the simple topology template is output by default. + +### --multi-dc + +- Outputs the topology template of multiple data centers. To enable this option, add it to the command. +- If this option is not specified, the topology template of a single data center is output by default. + +### -h, --help + +Prints the help information. + +## Output + +Outputs the topology template according to the specified options, which can be redirected to the topology file for deployment. diff --git a/tiup/tiup-component-cluster-upgrade.md b/tiup/tiup-component-cluster-upgrade.md index 2108f62be22a4..ea3189d29d824 100644 --- a/tiup/tiup-component-cluster-upgrade.md +++ b/tiup/tiup-component-cluster-upgrade.md @@ -43,6 +43,12 @@ tiup cluster upgrade [flags] - Data type: `BOOLEAN` - Default: false +### --offline + +- Declares that the current cluster is not running. When this option is specified, TiUP does not evict the service leader to another node or restart the service, but only replaces the binary files of the cluster components. +- 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 - Prints the help information. diff --git a/tiup/tiup-component-cluster.md b/tiup/tiup-component-cluster.md index 0d91dcd2e13f6..754b138fd040d 100644 --- a/tiup/tiup-component-cluster.md +++ b/tiup/tiup-component-cluster.md @@ -60,6 +60,7 @@ tiup cluster [command] [flags] ## Command list - [import](/tiup/tiup-component-cluster-import.md): imports a cluster deployed by Ansible +- [template](/tiup/tiup-component-cluster-template.md): outputs the topology template - [check](/tiup/tiup-component-cluster-check.md): checks a cluster before and after the deployment - [deploy](/tiup/tiup-component-cluster-deploy.md): deploys a cluster based on a specified topology - [list](/tiup/tiup-component-cluster-list.md): queries the list of deployed clusters @@ -78,6 +79,7 @@ tiup cluster [command] [flags] - [clean](/tiup/tiup-component-cluster-clean.md): deletes data from the specified cluster - [destroy](/tiup/tiup-component-cluster-destroy.md): destroys a specified cluster - [audit](/tiup/tiup-component-cluster-audit.md): queries the operation audit log of a specified cluster -- [enable](/tiup/tiup-component-cluster-enable.md): enables a specified cluster or service to start on boot -- [disable](/tiup/tiup-component-cluster-disable.md): disables a specified cluster or service to start on boot -- [help](/tiup/tiup-component-cluster-help.md): prints the help information +- [replay](/tiup/tiup-component-cluster-replay.md): retries the specified command +- [enable](/tiup/tiup-component-cluster-enable.md): enables the auto-enabling of the cluster service after a machine is restarted. +- [disable](/tiup/tiup-component-cluster-disable.md): disables the auto-enabling of the cluster service after a machine is restarted. +- [help](/tiup/tiup-component-cluster-help.md): prints the help information \ No newline at end of file diff --git a/tiup/tiup-component-dm-disable.md b/tiup/tiup-component-dm-disable.md new file mode 100644 index 0000000000000..d9abff9a6a75a --- /dev/null +++ b/tiup/tiup-component-dm-disable.md @@ -0,0 +1,45 @@ +--- +title: tiup dm disable +--- + +# tiup dm disable + +After restarting the machine on which the cluster service is located, the cluster service will be automatically enabled. To disable the auto-enabling of cluster service, you can use the `tiup dm disable` command. This command executes `systemctl disable ` on the specified node to disable the auto-enabling of the service. + +## Syntax + +```shell +tiup dm disable [flags] +``` + +`` is the cluster whose service auto-enabling is to be disabled. + +## Options + +### -N, --node + +- Specifies the nodes whose service auto-enabling is to be disabled. 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: `STRINGS` +- If this option is not specified in the command, the auto-enabling of all nodes is disabled by default. + +> **Note:** +> +> If the `-R, --role` option is specified at the same time, the auto-enabling of services that match both the specifications of `-N, --node` and `-R, --role` is disabled. + +### -R, --role + +- Specifies the roles whose service auto-enabling is to be disabled. The value of this option is a comma-separated list of node roles. You can get the roles of 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: `STRINGS` +- If this option is not specified in the command, the auto-enabling of all roles is disabled by default. + +> **Note:** +> +> If the `-N, --node` option is specified at the same time, the auto-enabling of services that match both the specifications of `-N, --node` and `-R, --role` is disabled. + +### -h, --help + +Prints the help information. + +## Output + +The execution log of the tiup-dm. diff --git a/tiup/tiup-component-dm-enable.md b/tiup/tiup-component-dm-enable.md new file mode 100644 index 0000000000000..8ed4d840bbb6c --- /dev/null +++ b/tiup/tiup-component-dm-enable.md @@ -0,0 +1,45 @@ +--- +title: tiup dm enable +--- + +# tiup dm enable + +The `tiup dm enable` command is used to set the auto-enabling of the cluster service after a machine is restarted. This command enables the auto-enabling of the service by executing `systemctl enable ` at the specified node. + +## Syntax + +```shell +tiup dm enable [flags] +``` + +`` is the cluster whose service auto-enabling is to be enabled. + +## Options + +### -N, --node + +- Specifies the nodes whose service auto-enabling is to be enabled. 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: `STRINGS` +- If this option is not specified in the command, the auto-enabling of all nodes is enabled by default. + +> **Note:** +> +> If the `-R, --role` option is specified at the same time, the auto-enabling of services that match both the specifications of `-N, --node` and `-R, --role` is enabled. + +### -R, --role + +- Specifies the roles whose service auto-enabling is to be enabled. The value of this option is a comma-separated list of node roles. You can get the roles of 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: `STRINGS` +- If this option is not specified in the command, the auto-enabling of all roles is enabled by default. + +> **Note:** +> +> If the `-N, --node` option is specified at the same time, the auto-enabling of services that match both the specifications of `-N, --node` and `-R, --role` is enabled. + +### -h, --help + +Prints the help information. + +## Output + +the execution log of tiup-dm. diff --git a/tiup/tiup-component-dm-patch.md b/tiup/tiup-component-dm-patch.md index 65d4641d0078b..45bca99d35dd0 100644 --- a/tiup/tiup-component-dm-patch.md +++ b/tiup/tiup-component-dm-patch.md @@ -62,6 +62,10 @@ You need to pack the binary package required for this command in advance accordi > > 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`. +### --offline + +- Declares that the current cluster is offline. When this option is specified, TiUP DM only replaces the binary files of the cluster components in place without restarting the service. + ### -h, --help - Prints help information. diff --git a/tiup/tiup-component-dm-reload.md b/tiup/tiup-component-dm-reload.md index ede64aeecde90..713915d4660bc 100644 --- a/tiup/tiup-component-dm-reload.md +++ b/tiup/tiup-component-dm-reload.md @@ -18,24 +18,24 @@ tiup dm reload [flags] ### -N, --node -- Specifies the nodes to be restarted. If not specified, all nodes are restarted. The value of this option is a comma-separated list of node IDs. The node ID is the first column of the [cluster status](/tiup/tiup-component-dm-display.md) table. -- Data type: `strings` -- Default: `[]`, which means all nodes are selected. +- Specifies the nodes to be restarted. If not specified, all nodes are 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: `STRINGS` +- If this option is not specified in the command, all nodes are selected by default. > **Note:** > -> + If the `-R, --role` option is specified at the same time, then the service status in their intersection is restarted. +> + If the `-R, --role` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are restarted. > + If the `--skip-restart` option is specified, the `-N, --node` option is invalid. ### -R, --role -- Specifies the roles to be restarted. If not specified, all roles are restarted. The value of this option is a comma-separated list of node roles. The role is the second column of the [cluster status](/tiup/tiup-component-dm-display.md) table. -- Data type: `strings` -- Default: `[]`, which means all roles are selected. +- Specifies the roles to be restarted. If not specified, all roles are restarted. The value of this option is a comma-separated list of node roles. You can get the roles of 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: `STRINGS` +- If this option is not specified in the command, all roles are selected by default. > **Note:** > -> + If the `-N, --node` option is specified at the same time, the services in their intersection is restarted. +> + If the `-N, --node` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are restarted. > + If the `--skip-restart` option is specified, the `-R, --role` option is invalid. ### --skip-restart @@ -58,4 +58,4 @@ After you specify the `--skip-restart` option, it only refreshes the configurati ## Output -The execution log of the tiup-dm. \ No newline at end of file +The execution log of the tiup-dm. diff --git a/tiup/tiup-component-dm-replay.md b/tiup/tiup-component-dm-replay.md new file mode 100644 index 0000000000000..64719e26c01e2 --- /dev/null +++ b/tiup/tiup-component-dm-replay.md @@ -0,0 +1,25 @@ +--- +title: tiup dm replay +--- + +# tiup dm replay + +When you perform a cluster operation such as upgrade or restart, the operation might fail due to cluster environment issues. If you re-perform the operation, you need to perform all the steps from the very beginning. If the cluster is large, re-performing these steps will take a long time. In this case, you can use the `tiup dm replay` command to retry the failed commands and skip the successfully performed steps. + +## Syntax + +```shell +tiup dm replay [flags] +``` + +- ``: the `audit-id` of the command to be retried. You can view the historical commands and their `audit-id`s using the [`tiup dm audit`](/tiup/tiup-component-dm-audit.md) command. + +## Option + +### -h, --help + +Prints the help information. + +## Output + +The output of the command corresponding to ``. diff --git a/tiup/tiup-component-dm-scale-in.md b/tiup/tiup-component-dm-scale-in.md index 8a13b80d0b1a0..581e98ddad170 100644 --- a/tiup/tiup-component-dm-scale-in.md +++ b/tiup/tiup-component-dm-scale-in.md @@ -19,7 +19,7 @@ tiup dm scale-in [flags] ### -N, --node - Specifies the nodes to be scaled in. If you need to scale in multiple nodes, split them by commas. -- Data type: `Strings` +- Data type: `STRINGS` - Default: no. This option is mandatory and the value must be not null. ### --force diff --git a/tiup/tiup-component-dm-start.md b/tiup/tiup-component-dm-start.md index 1b93e51491ad1..6532a7377567f 100644 --- a/tiup/tiup-component-dm-start.md +++ b/tiup/tiup-component-dm-start.md @@ -18,23 +18,23 @@ tiup dm start [flags] ### -N, --node -- Specifies the nodes to be started. If not specified, all nodes are started. The value of this option is a comma-separated list of node IDs. The node ID is the first column of the [cluster status](/tiup/tiup-component-dm-display.md) table. -- Data type: `strings` -- Default: `[]`. If this option is not specified in the command, all nodes are started. +- Specifies the nodes to be started. If not specified, all nodes are started. 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: `STRINGS` +- If this option is not specified in the command, all nodes are started. > **Note:** > -> If the `-R, --role` option is specified at the same time, then the services in their intersection are started. +> If the `-R, --role` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are started. ### -R, --role -- Specifies the roles to be started. If not specified, all roles are started. The value of this option is a comma-separated list of node roles. The role is the second column of the [cluster status](/tiup/tiup-component-dm-display.md) table. -- Data type: `strings` -- Default: `[]`. If this option is not specified in the command, all roles are started. +- Specifies the roles to be started. If not specified, all roles are started. The value of this option is a comma-separated list of node roles. You can get the roles of 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: `STRINGS` +- If this option is not specified in the command, all roles are started. > **Note:** > -> If the `-N, --node` option is specified at the same time, the services in their intersection are started. +> If the `-N, --node` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are started. ### -h, --help @@ -44,4 +44,4 @@ tiup dm start [flags] ## Output -The log of starting the service. \ No newline at end of file +The log of starting the service. diff --git a/tiup/tiup-component-dm-stop.md b/tiup/tiup-component-dm-stop.md index 9bfb529d8de8f..8a46ee87cae7d 100644 --- a/tiup/tiup-component-dm-stop.md +++ b/tiup/tiup-component-dm-stop.md @@ -22,23 +22,23 @@ tiup dm stop [flags] ### -N, --node -- Specifies the nodes to be stopped. If not specified, all nodes are stopped. The value of this option is a comma-separated list of node IDs. The node ID is the first column of the [cluster status](/tiup/tiup-component-dm-display.md) table. -- Data type: `strings` -- Default: `[]`, which means all nodes are selected. +- Specifies the nodes to be stopped. If not specified, all nodes are stopped. 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: `STRINGS` +- If this option is not specified in the command, all nodes are selected by default. > **Note:** > -> If the `-R, --role` option is specified at the same time, then the service status in their intersection is stopped. +> If the `-R, --role` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are stopped. ### -R, --role -- Specifies the roles to be stopped. If not specified, all roles are stopped. The value of this option is a comma-separated list of node roles. The role is the second column of the [cluster status](/tiup/tiup-component-dm-display.md) table. -- Data type: `strings` -- Default: `[]`, which means all roles are selected. +- Specifies the roles to be stopped. If not specified, all roles are stopped. The value of this option is a comma-separated list of node roles. You can get the roles of 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: `STRINGS` +- If this option is not specified in the command, all roles are selected by default. > **Note:** > -> If the `-N, --node` option is specified at the same time, the services in their intersection is stopped. +> If the `-N, --node` option is specified at the same time, only the service nodes that match both the specifications of `-N, --node` and `-R, --role` are stopped. ### -h, --help @@ -48,4 +48,4 @@ tiup dm stop [flags] ## Output -The log of stopping the service. \ No newline at end of file +The log of stopping the service. diff --git a/tiup/tiup-component-dm-template.md b/tiup/tiup-component-dm-template.md new file mode 100644 index 0000000000000..939474225248a --- /dev/null +++ b/tiup/tiup-component-dm-template.md @@ -0,0 +1,36 @@ +--- +title: tiup dm template +--- + +# tiup dm template + +Before deploying the cluster, you need to prepare a [topology file](/tiup/tiup-dm-topology-reference.md) of the cluster. TiUP has a built-in topology file template, and you can modify this template to create the final topology file. To output the built-in template content, you can use the `tiup dm template` command. + +## Syntax + +```shell +tiup dm template [flags] +``` + +If this option is not specified, the output default template contains the following instances: + +- 3 DM-master instances +- 3 DM-worker instances +- 1 Prometheus instance +- 1 Grafana instance +- 1 Alertmanager instance + +## Options + +### --full + +- Outputs a detailed topology template that is commented with configurable parameters. To enable this option, add it to the command. +- If this option is not specified, the simple topology template is output by default. + +### -h, --help + +Prints the help information. + +## Output + +Outputs the topology template according to the specified options, which can be redirected to the topology file for deployment. diff --git a/tiup/tiup-component-dm-upgrade.md b/tiup/tiup-component-dm-upgrade.md index 3540d619eb9eb..aa3cc8b96a8fb 100644 --- a/tiup/tiup-component-dm-upgrade.md +++ b/tiup/tiup-component-dm-upgrade.md @@ -17,6 +17,10 @@ tiup dm upgrade [flags] ## Options +### --offline + +- Declares that the current cluster is offline. When this option is specified, TiUP DM only replaces the binary files of the cluster components in place without restarting the service. + ### -h, --help - Prints the help information. diff --git a/tiup/tiup-component-dm.md b/tiup/tiup-component-dm.md index c988ea80c9ec9..4e3194f5a8073 100644 --- a/tiup/tiup-component-dm.md +++ b/tiup/tiup-component-dm.md @@ -61,6 +61,7 @@ tiup dm [command] [flags] ## List of commands - [import](/tiup/tiup-component-dm-import.md): Imports a DM v1.0 cluster deployed by DM-Ansible. +- [template](/tiup/tiup-component-dm-template.md): Outputs the topology template. - [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. @@ -76,4 +77,7 @@ tiup dm [command] [flags] - [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. +- [replay](/tiup/tiup-component-dm-replay.md): Replays the specified commands +- [enable](/tiup/tiup-component-dm-enable.md): Enables the auto-enabling of the cluster service after a machine is restarted. +- [disable](/tiup/tiup-component-dm-disable.md): Disables the auto-enabling of the cluster service after a machine is restarted. - [help](/tiup/tiup-component-dm-help.md): Prints help information. diff --git a/tiup/tiup-dm-topology-reference.md b/tiup/tiup-dm-topology-reference.md index a1e951a3aa232..b7b83d255e1f9 100644 --- a/tiup/tiup-dm-topology-reference.md +++ b/tiup/tiup-dm-topology-reference.md @@ -194,6 +194,10 @@ worker_servers: - `numa_node`: allocates the NUMA policy to the instance. Before specifying this field, you need to make sure that the target machine has [numactl](https://linux.die.net/man/8/numactl) installed. If this field is specified, cpubind and membind policies are allocated using [numactl](https://linux.die.net/man/8/numactl). This field is a string type. The field value is the ID of the NUMA node, such as "0,1" - `storage_retention`: specifies the retention time of the Prometheus monitoring data. The default value is "15d". - `rule_dir`: specifies a local directory where the complete `*.rules.yml` files are located. The files in the specified directory will be sent to the target machine as the Prometheus rules during the initialization phase of the cluster configuration. +- `remote_config`: Supports writing Prometheus data to the remote, or reading data from the remote. This field has two configurations: + - `remote_write`: See the Prometheus document [``](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write). + - `remote_read`: See the Prometheus document [``](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_read). +- `external_alertmanagers`: If the `external_alertmanagers` field is configured, Prometheus alerts the configuration behavior to the Alertmanager that is outside the cluster. This field is an array, each element of which is an external Alertmanager and consists of the `host` and `web_port` fields. - `os`: the operating system of the machine specified in the `host` field. If the field is not specified, the default value is the `os` value configured in the `global` section. - `arch`: the architecture of the machine specified in the `host` field. If the field is not specified, the default value is the `arch` value configured in the `global` section. - `resource_control`: resource control on this service. If this field is specified, the configuration of this field will be merged with the configuration of `resource_control` in the `global` section (if the two fields overlap, the configuration of this field takes effect), and then the configuration file of systemd is generated and distributed to the machine specified in the `host` field. The configuration rules of this field are the same as that of `resource_control` in the `global` section. @@ -214,6 +218,21 @@ A `monitoring_servers` configuration example is as follows: monitoring_servers: - host: 10.0.1.11 rule_dir: /local/rule/dir + remote_config: + remote_write: + - queue_config: + batch_send_deadline: 5m + capacity: 100000 + max_samples_per_send: 10000 + max_shards: 300 + url: http://127.0.0.1:8003/write + remote_read: + - url: http://127.0.0.1:8003/read\ + external_alertmanagers: + - host: 10.1.1.1 + web_port: 9093 + - host: 10.1.1.2 + web_port: 9094 ``` ### `grafana_servers`