You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Active: active (running) since Mon 2024-01-29 03:30:51 EST; 1min 7s ago
@@ -57,11 +59,33 @@ This document describes how to use the TiUP no-sudo mode to deploy a cluster.
57
59
58
60
```shell
59
61
loginctl enable-linger tidb
62
+
loginctl show-user -p Linger tidb # This should show: Linger=yes
60
63
```
61
64
62
65
You can read the systemd documentation for reference, [Automatic start-up of systemd user instances](https://wiki.archlinux.org/title/Systemd/User#Automatic_start-up_of_systemd_user_instances).
63
66
64
-
4. Generate a key using `ssh-keygen` on the control machine, and copy the public key to the other deployment machines to establish SSH trust.
67
+
4. Generate a key using `ssh-keygen` on the control machine:
68
+
69
+
```shell
70
+
ssh-keygen
71
+
```
72
+
73
+
5. Copy the public key to the other machines in the cluster to establish SSH trust.
74
+
75
+
- If you have set a password for the `tidb` user, you can use `ssh-copy-id`command to copy the public key to the target machine.
76
+
77
+
```shell
78
+
ssh-copy-id tidb@host
79
+
```
80
+
81
+
You need to replace `host` with the hostname of the target machine and run this command on each of the other machines in the cluster.
82
+
83
+
- If you use a different method to copy the public key, make sure to check the permissions of the `/home/tidb/.ssh/authorized_keys` file after the copy.
@@ -73,9 +97,9 @@ This document describes how to use the TiUP no-sudo mode to deploy a cluster.
73
97
74
98
2. Edit the topology file.
75
99
76
-
Compared with the previous mode, when using TiUP in no-sudo mode, you need to add a line `systemd_mode: "user"`in the `global` module of the `topology.yaml` file. The `systemd_mode` parameter is used to set whether to use the `systemd user` mode. If this parameter is not set, the default value is `system`, meaning sudo permissions are required.
100
+
Compared with the regular mode, when using TiUP in no-sudo mode, you need to add a line `systemd_mode: "user"`in the `global` module of the `topology.yaml` file. The `systemd_mode` parameter is used to set whether to use the `systemd user` mode. If this parameter is not set, the default value is `system`, meaning sudo permissions are required.
77
101
78
-
Additionally, in no-sudo mode, because the non-root `tidb` user does not have permission to use the `/data` directory as `deploy_dir` or `data_dir`, you must selecta path accessible to non-root users. The following example uses relative paths and the final paths used are `/home/tidb/data/tidb-deploy` and `/home/tidb/data/tidb-data`. The rest of the topology file remains the same as in the previous mode.
102
+
Additionally, in no-sudo mode, because the non-root `tidb` user does not have permission to use the `/data` directory as `deploy_dir` or `data_dir`, you must selecta path accessible to non-root users. The following example uses relative paths, and the actual paths used are `/home/tidb/data/tidb-deploy` and `/home/tidb/data/tidb-data`. The rest of the topology file remains the same as in the regular mode. Another option is to use the root user to create the directories and then use `chown` to change the ownership to `tidb:tidb`.
79
103
80
104
```yaml
81
105
global:
@@ -90,6 +114,10 @@ This document describes how to use the TiUP no-sudo mode to deploy a cluster.
90
114
91
115
## Manually repair failed check items
92
116
117
+
>**Note:**
118
+
>
119
+
> If you use a minimal install, make sure the `tar` package is installed. Otherwise, the `tiup cluster check`command will fail.
120
+
93
121
Executing `tiup cluster check topology.yaml --user tidb` can generate some failed check items. The following is an example.
94
122
95
123
```shell
@@ -109,72 +137,22 @@ Node Check Result Message
109
137
192.168.124.27 service Fail service firewalld is running but should be stopped
110
138
```
111
139
112
-
In no-sudo mode, the `tidb` user does not have sudo permissions. As a result, running `tiup cluster check topology.yaml --apply --user tidb` cannot automatically fix the failed check items. You need to manually perform the following steps using the `root` user on the target machines:
113
-
114
-
1. Install the numactl tool.
115
-
116
-
```shell
117
-
sudo yum -y install numactl
118
-
```
119
-
120
-
2. Close swap.
121
-
122
-
```shell
123
-
swapoff -a ||exit 0
124
-
```
125
-
126
-
3. Disable transparent huge pages.
127
-
128
-
```shell
129
-
echo never > /sys/kernel/mm/transparent_hugepage/enabled
130
-
```
131
-
132
-
4. Start the `irqbalance` service.
140
+
In no-sudo mode, the `tidb` user does not have sudo permissions. As a result, running `tiup cluster check topology.yaml --apply --user tidb` cannot automatically fix the failed check items. You need to manually fix it by using the `root` user on the target machines.
133
141
134
-
```shell
135
-
systemctl start irqbalance
136
-
```
137
-
138
-
5. Stop the firewall and disable firewall auto-start.
For more information, see [TiDB Environment and System Configuration Check](/check-before-deployment.md). Note that you need to skip the step [Manually configure the SSH mutual trust and sudo without password](/check-before-deployment.md#manually-configure-the-ssh-mutual-trust-and-sudo-without-password) in the document.
169
143
170
144
## Deploy and manage the cluster
171
145
172
146
To use the `tidb` user created in preceding steps and avoid creating a new one, add `--user tidb` when running the following `deploy` command:
> You need to replace `v8.5.0`in the preceding command with the TiDB version that you want to deploy and `mycluster` with the name you want to give to your cluster.
0 commit comments