-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add tiup no-sudo doc #19753
base: master
Are you sure you want to change the base?
add tiup no-sudo doc #19753
Conversation
Welcome @Yujie-Xie! |
Hi @Yujie-Xie. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@kaaaaaaang: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Co-authored-by: xixirangrang <hfxsd@hotmail.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/ok-to-test |
Co-authored-by: xixirangrang <hfxsd@hotmail.com>
@@ -0,0 +1,212 @@ | |||
--- | |||
title: 使用 TiUP no-sudo 模式部署运维 TiDB 线上集群 | |||
summary: 介绍如何使用 TiUP no-sudo 模式部署运维 TiDB 线上集群 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
summary: 介绍如何使用 TiUP no-sudo 模式部署运维 TiDB 线上集群 | |
summary: 了解如何使用 TiUP no-sudo 模式部署运维 TiDB 线上集群。 |
|
||
## 准备用户并配置 SSH 互信 | ||
|
||
1. 以 `tidb` 用户为例,你需要依次登录到所有的部署目标机器,并以 `root` 用户使用如下命令创建一个普通用户 `tidb`。在 no-sudo 模式下,不需要为 `tidb` 用户配置 sudo 免密,即无需将 `tidb` 用户加入 `sudoers` 中。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. 以 `tidb` 用户为例,你需要依次登录到所有的部署目标机器,并以 `root` 用户使用如下命令创建一个普通用户 `tidb`。在 no-sudo 模式下,不需要为 `tidb` 用户配置 sudo 免密,即无需将 `tidb` 用户加入 `sudoers` 中。 | |
1. 以 `tidb` 用户为例。依次登录所有的部署目标机器,并以 `root` 用户使用如下命令创建一个普通用户 `tidb`。在 no-sudo 模式下,不需要为 `tidb` 用户配置 sudo 免密,即无需将 `tidb` 用户加入 `sudoers` 文件中。 |
└─3358 /usr/bin/pulseaudio --daemonize=no --log-target=journal | ||
``` | ||
|
||
执行 `systemctl --user`。如果没有报错,说明 `systemd user` 模式已经正常启动。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议采用子步骤,因为是一个具体操作。
执行 `systemctl --user`。如果没有报错,说明 `systemd user` 模式已经正常启动。 | |
3. 执行 `systemctl --user`。如果没有报错,说明 `systemd` user 模式已经正常启动。 |
3. 使用 `root` 用户执行以下命令,为 systemd 用户 `tidb` 启用驻留。 | ||
|
||
```bash | ||
loginctl enable-linger tidb | ||
``` | ||
|
||
更多详情,请参考 [systemd 用户实例的自动启动](https://wiki.archlinux.org/title/Systemd/User#Automatic_start-up_of_systemd_user_instances)。 | ||
|
||
3. 在中控机使用 ssh-keygen 生成密钥,并将公钥复制到其他部署机器,完成 SSH 互信。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 这里开始建议另起一个 step 3,上面
systemd user
模式正常启动已完成 step 2。 - 使用
ssh-keygen
这一步是否要提供具体的操作命令?
3. 使用 `root` 用户执行以下命令,为 systemd 用户 `tidb` 启用驻留。 | |
```bash | |
loginctl enable-linger tidb | |
``` | |
更多详情,请参考 [systemd 用户实例的自动启动](https://wiki.archlinux.org/title/Systemd/User#Automatic_start-up_of_systemd_user_instances)。 | |
3. 在中控机使用 ssh-keygen 生成密钥,并将公钥复制到其他部署机器,完成 SSH 互信。 | |
3. 使用 `root` 用户执行以下命令,为 systemd 用户 `tidb` 启用驻留。 | |
```bash | |
loginctl enable-linger tidb | |
``` | |
更多详情,参见 [systemd 用户实例的自动启动](https://wiki.archlinux.org/title/Systemd/User#Automatic_start-up_of_systemd_user_instances)。 | |
4. 在中控机上使用 `ssh-keygen` 生成密钥,并将公钥复制到其他部署机器,完成 SSH 互信。 |
|
||
2. 编辑拓扑文件。 | ||
|
||
相比以往的模式,使用 no-sudo 模式的 TiUP 时,需要在 `topology.yaml` 的 `global` 模块中新增一行 `systemd_mode: "user"`。该 `systemd_mode` 参数用于设置是否使用 `systemd user` 模式。如果不设置该参数,其默认值为 `system`,表示需要使用 sudo 权限。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里“以往的”是指 sudo 模式吗?
相比以往的模式,使用 no-sudo 模式的 TiUP 时,需要在 `topology.yaml` 的 `global` 模块中新增一行 `systemd_mode: "user"`。该 `systemd_mode` 参数用于设置是否使用 `systemd user` 模式。如果不设置该参数,其默认值为 `system`,表示需要使用 sudo 权限。 | |
相比以往的 sudo 模式,使用 no-sudo 模式的 TiUP 时,需要在 `topology.yaml` 的 `global` 模块中新增一行 `systemd_mode: "user"`。该 `systemd_mode` 参数用于设置是否使用 `systemd user` 模式。如果不设置该参数,其默认值为 `system`,表示需要使用 sudo 权限。 |
adduser tidb | ||
``` | ||
|
||
2. 在每台部署目标机器上,为 `tidb` 用户启动 `systemd user` 模式。该步骤是必须的,请勿跳过。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文里只给 systemd
加了行内代码格式,请确认下保持两边一致。
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions (in Chinese).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?