Skip to content

Commit

Permalink
add --user
Browse files Browse the repository at this point in the history
  • Loading branch information
hfxsd committed Jan 22, 2025
1 parent 0ae0a9b commit 79ea33d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
6 changes: 4 additions & 2 deletions production-deployment-using-tiup.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,18 @@ For more configuration description, see the following configuration examples:
> **Note:**
>
> You can use secret keys or interactive passwords for security authentication when you deploy TiDB using TiUP:
> You can securely authenticate users used for initialization when deploying a cluster via TiUP (specified via `--user`) using either a key or a cross-password:
>
> - If you use secret keys, specify the path of the keys through `-i` or `--identity_file`.
> - If you use passwords, add the `-p` flag to enter the password interaction window.
> - If password-free login to the target machine has been configured, no authentication is required.
>
> In general, TiUP creates the user and group specified in the `topology.yaml` file on the target machine, with the following exceptions:
> In general, the users and groups used by TiUP to actually execute the processes (specified via `topology.yaml`, and the default value is `tidb`) are created automatically on the target machine, with the following exceptions:
>
> - The user name configured in `topology.yaml` already exists on the target machine.
> - You have used the `--skip-create-user` option in the command line to explicitly skip the step of creating the user.
>
> Regardless of whether the users and groups agreed upon in `topology.yaml` are created automatically, TiUP automatically generates a pair of ssh keys and sets up a secret-free login for that user on each machine. This user and ssh key will be used to manage the machine for all subsequent operations, while the user and password used for initialization will not be used any more after the deployment is complete.
Before you run the `deploy` command, use the `check` and `check --apply` commands to detect and automatically repair potential risks in the cluster:
Expand Down
29 changes: 4 additions & 25 deletions quick-start-with-tidb.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,6 @@ Other requirements for the target machine include:

1. Download and install TiUP:

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

```shell
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
```
Expand All @@ -312,24 +310,18 @@ Other requirements for the target machine include:
>
> After the installation, TiUP displays the absolute path of the corresponding Shell profile file. You need to modify `${your_shell_profile}` in the following `source` command according to the path.

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

```shell
source ${your_shell_profile}
```

3. Install the cluster component of TiUP:

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

```shell
tiup cluster
```

4. If the TiUP cluster is already installed on the machine, update the software version:

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

```shell
tiup update --self && tiup update cluster
```
Expand All @@ -339,8 +331,6 @@ Other requirements for the target machine include:
1. Modify `/etc/ssh/sshd_config`, and set `MaxSessions` to `20`.
2. Restart the `sshd` service:

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

```shell
service sshd restart
```
Expand All @@ -349,8 +339,6 @@ Other requirements for the target machine include:

Create and edit the [topology configuration file](/tiup/tiup-cluster-topology-reference.md) according to the following template, and name it as `topo.yaml`:

{{< copyable "" >}}

```yaml
# # Global variables are applied to all deployments and used as the default value of
# # the deployments if a specific deployment value is missing.
Expand Down Expand Up @@ -418,15 +406,14 @@ Other requirements for the target machine include:
7. Execute the cluster deployment command:
{{< copyable "shell-regular" >}}
```shell
tiup cluster deploy <cluster-name> <version> ./topo.yaml --user root -p
```
- `<cluster-name>`: Set the cluster name
- `<version>`: Set the TiDB cluster version, such as `v8.5.0`. You can see all the supported TiDB versions by running the `tiup list tidb` command
- `-p`: Specify the password used to connect to the target machine.
- `<cluster-name>`: sets the cluster name.
- `<version>`: sets the TiDB cluster version, such as `v8.5.0`. You can see all the supported TiDB versions by running the `tiup list tidb` command.
- `--user`: specifies the user who initializes the environment.
- `-p`: specifies the password used to connect to the target machine.
> **Note:**
>
Expand All @@ -441,8 +428,6 @@ Other requirements for the target machine include:
8. Start the cluster:
{{< copyable "shell-regular" >}}
```shell
tiup cluster start <cluster-name>
```
Expand All @@ -469,16 +454,12 @@ Other requirements for the target machine include:
- To view the cluster list:
{{< copyable "shell-regular" >}}
```shell
tiup cluster list
```
- To view the cluster topology and status:
{{< copyable "shell-regular" >}}
```shell
tiup cluster display <cluster-name>
```
Expand All @@ -491,8 +472,6 @@ Other requirements for the target machine include:
2. Run the following command after the service is stopped:
{{< copyable "shell-regular" >}}
```shell
tiup clean --all
```
Expand Down

0 comments on commit 79ea33d

Please sign in to comment.