Skip to content

Commit

Permalink
add more commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Yujie-Xie committed Feb 8, 2025
1 parent e197ab0 commit f6f0024
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
48 changes: 41 additions & 7 deletions tiup/tiup-cluster-no-sudo-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ This document focuses on how to use the TiUP no-sudo Mode to deploy a cluster.

2. Edit the topology file.

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`.
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`.
The rest is consistent with the old version.

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

```shell
```yaml
global:
user: "tidb"
systemd_mode: "user"
Expand All @@ -89,9 +89,9 @@ This document focuses on how to use the TiUP no-sudo Mode to deploy a cluster.
...
```

## Manual repair failed check items
## Manually repair failed check items

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

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

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

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.
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.

1. Install the numactl tool

Expand Down Expand Up @@ -177,8 +177,10 @@ Since in no-sudo mode, the `tidb` user does not have sudo permissions, executing
cat << EOF >>/etc/security/limits.conf
tidb soft nofile 1000000
tidb hard nofile 1000000
tidb soft stack 32768
tidb hard stack 32768
tidb soft stack 32768
tidb hard stack 32768
tidb soft core unlimited
tidb hard core unlimited
EOF
```
Expand All @@ -192,6 +194,38 @@ In order to use the `tidb` user prepared in the above steps and avoid re-creatin
tiup cluster deploy mycluster v8.1.0 topology.yaml --user tidb
```
Start cluster
{{< copyable "shell-regular" >}}
```shell
tiup cluster start mycluster
```
Scale-out cluster
{{< copyable "shell-regular" >}}
```shell
tiup cluster scale-out mycluster scale.yaml --user tidb
```
Scale-in cluster
{{< copyable "shell-regular" >}}
```shell
tiup cluster scale-in mycluster -N 192.168.124.27:20160
```
Upgrade cluster
{{< copyable "shell-regular" >}}
```shell
tiup cluster upgrade mycluster v8.2.0
```
## FAQ
1. When starting [email protected], an error occurs: Failed to fully start up daemon: Permission denied
Expand Down
2 changes: 2 additions & 0 deletions tiup/tiup-cluster-topology-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ The `global` section corresponds to the cluster's global configuration and has t

- `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.

- `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.

- `ssh_port`: Specifies the SSH port to connect to the target machine for operations. The default value is `22`.

- `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`.
Expand Down

0 comments on commit f6f0024

Please sign in to comment.