Skip to content

Commit f6f0024

Browse files
committed
add more commands
1 parent e197ab0 commit f6f0024

File tree

2 files changed

+43
-7
lines changed

2 files changed

+43
-7
lines changed

tiup/tiup-cluster-no-sudo-mode.md

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ This document focuses on how to use the TiUP no-sudo Mode to deploy a cluster.
7373

7474
2. Edit the topology file.
7575

76-
Compared with the previous mode, TiUP using no-sudo mode needs to add `systemd_mode: "user"` to topology.yaml global block. If this parameter is not set, its default value is `system`, indicating that sudo permissions are required. In addition, no-sudo mode cannot use `/data` as `deploy_dir` and `data_dir` because there will be permission issues, and you need to choose a path that ordinary users can access. The example below uses relative paths and the final paths used are `/home/tidb/data/tidb-deploy` and `/home/tidb/data/tidb-data`.
76+
Compared with the previous mode, TiUP using no-sudo mode needs to add the line `systemd_mode: "user"` in the global block of topology.yaml. The `systemd_mode` parameter is used to indicate whether to use systemd user mode. If this parameter is not set, its default value is `system`, indicating that sudo permissions are required. In addition, no-sudo mode cannot use `/data` as `deploy_dir` and `data_dir` because there will be permission issues, and you need to choose a path that ordinary users can access. The example below uses relative paths and the final paths used are `/home/tidb/data/tidb-deploy` and `/home/tidb/data/tidb-data`.
7777
The rest is consistent with the old version.
7878

7979
{{< copyable "shell-regular" >}}
8080

81-
```shell
81+
```yaml
8282
global:
8383
user: "tidb"
8484
systemd_mode: "user"
@@ -89,9 +89,9 @@ This document focuses on how to use the TiUP no-sudo Mode to deploy a cluster.
8989
...
9090
```
9191

92-
## Manual repair failed check items
92+
## Manually repair failed check items
9393

94-
Executing `tiup cluster check topology.yaml` will display some failed check items, examples:
94+
Executing `tiup cluster check topology.yaml --user tidb` will display some failed check items, examples:
9595

9696
{{< copyable "shell-regular" >}}
9797

@@ -112,7 +112,7 @@ Node Check Result Message
112112
192.168.124.27 service Fail service firewalld is running but should be stopped
113113
```
114114

115-
Since in no-sudo mode, the `tidb` user does not have sudo permissions, executing `tiup cluster check topology.yaml --apply` will not be able to automatically repair failed check items due to insufficient permissions. Therefore, some operations need to be performed manually on the deployment machines using the `root` user.
115+
Since in no-sudo mode, the `tidb` user does not have sudo permissions, executing `tiup cluster check topology.yaml --apply --user tidb` will not be able to automatically repair failed check items due to insufficient permissions. Therefore, some operations need to be performed manually on the deployment machines using the `root` user.
116116

117117
1. Install the numactl tool
118118

@@ -177,8 +177,10 @@ Since in no-sudo mode, the `tidb` user does not have sudo permissions, executing
177177
cat << EOF >>/etc/security/limits.conf
178178
tidb soft nofile 1000000
179179
tidb hard nofile 1000000
180-
tidb soft stack 32768
181-
tidb hard stack 32768
180+
tidb soft stack 32768
181+
tidb hard stack 32768
182+
tidb soft core unlimited
183+
tidb hard core unlimited
182184
EOF
183185
```
184186
@@ -192,6 +194,38 @@ In order to use the `tidb` user prepared in the above steps and avoid re-creatin
192194
tiup cluster deploy mycluster v8.1.0 topology.yaml --user tidb
193195
```
194196
197+
Start cluster
198+
199+
{{< copyable "shell-regular" >}}
200+
201+
```shell
202+
tiup cluster start mycluster
203+
```
204+
205+
Scale-out cluster
206+
207+
{{< copyable "shell-regular" >}}
208+
209+
```shell
210+
tiup cluster scale-out mycluster scale.yaml --user tidb
211+
```
212+
213+
Scale-in cluster
214+
215+
{{< copyable "shell-regular" >}}
216+
217+
```shell
218+
tiup cluster scale-in mycluster -N 192.168.124.27:20160
219+
```
220+
221+
Upgrade cluster
222+
223+
{{< copyable "shell-regular" >}}
224+
225+
```shell
226+
tiup cluster upgrade mycluster v8.2.0
227+
```
228+
195229
## FAQ
196230
1. When starting [email protected], an error occurs: Failed to fully start up daemon: Permission denied
197231

tiup/tiup-cluster-topology-reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ The `global` section corresponds to the cluster's global configuration and has t
4242

4343
- `group`: The user group to which a user belongs. It is specified when the user is created. The value defaults to that of the `<user>` field. If the specified group does not exist, it is automatically created.
4444

45+
- `systemd_mode`: The systemd mode used on the target machine during cluster deployment. The default value is `system`. If it is set to `user`, it means that sudo permissions are not used on the target machine, that is, the TiUP no-sudo mode is used.
46+
4547
- `ssh_port`: Specifies the SSH port to connect to the target machine for operations. The default value is `22`.
4648

4749
- `enable_tls`: Specifies whether to enable TLS for the cluster. After TLS is enabled, the generated TLS certificate must be used for connections between components or between the client and the component. The default value is `false`.

0 commit comments

Comments
 (0)