From e38401298569d2b0f23be0ee0bef51006587566b Mon Sep 17 00:00:00 2001 From: Calvin Weng Date: Mon, 11 Nov 2019 16:02:23 +0800 Subject: [PATCH] fix indent and update some code copying tags (2.1) (#2032) --- .../deploy/data-migration-with-ansible.md | 6 +- .../deploy/data-migration-with-ansible.md | 60 ++++++++++++------- .../deploy/data-migration-with-ansible.md | 6 +- .../deploy/data-migration-with-ansible.md | 6 +- 4 files changed, 49 insertions(+), 29 deletions(-) diff --git a/dev/how-to/deploy/data-migration-with-ansible.md b/dev/how-to/deploy/data-migration-with-ansible.md index 034572441e5c..99197cc0e0b9 100644 --- a/dev/how-to/deploy/data-migration-with-ansible.md +++ b/dev/how-to/deploy/data-migration-with-ansible.md @@ -448,9 +448,9 @@ dm-worker2 ansible_host=172.16.10.73 source_id="mysql-replica-02" server_id=102 ansible_user = tidb ``` - > **注意:** - > - > 请勿将 `ansible_user` 设为 `root`,因为 `tidb-ansible` 限制服务需以普通用户运行。 + > **注意:** + > + > 请勿将 `ansible_user` 设为 `root`,因为 `tidb-ansible` 限制服务需以普通用户运行。 运行以下命令。如果所有服务都返回 `tidb`,则 SSH 互信配置成功。 diff --git a/v2.1/how-to/deploy/data-migration-with-ansible.md b/v2.1/how-to/deploy/data-migration-with-ansible.md index 098a7bfff981..786f320a422a 100644 --- a/v2.1/how-to/deploy/data-migration-with-ansible.md +++ b/v2.1/how-to/deploy/data-migration-with-ansible.md @@ -405,30 +405,38 @@ dm-worker2 ansible_host=172.16.10.73 source_id="mysql-replica-02" server_id=102 ansible_user = tidb ``` - > **注意:** - > - > 请勿将 `ansible_user` 设为 `root`,因为 `tidb-ansible` 限制服务需以普通用户运行。 + > **注意:** + > + > 请勿将 `ansible_user` 设为 `root`,因为 `tidb-ansible` 限制服务需以普通用户运行。 运行以下命令。如果所有服务都返回 `tidb`,则 SSH 互信配置成功。 + {{< copyable "shell-regular" >}} + ```bash ansible -i inventory.ini all -m shell -a 'whoami' ``` 运行以下命令。如果所有服务都返回 `root`,则 `tidb` 用户免密 sudo 操作配置成功。 + {{< copyable "shell-regular" >}} + ```bash ansible -i inventory.ini all -m shell -a 'whoami' -b ``` 2. 修改内核参数,并部署 DM 集群组件和监控组件。 + {{< copyable "shell-regular" >}} + ```bash ansible-playbook deploy.yml ``` 3. 启动 DM 集群。 + {{< copyable "shell-regular" >}} + ```bash ansible-playbook start.yml ``` @@ -439,8 +447,10 @@ dm-worker2 ansible_host=172.16.10.73 source_id="mysql-replica-02" server_id=102 如果您需要关闭一个 DM 集群,运行以下命令: +{{< copyable "shell-regular" >}} + ```bash -$ ansible-playbook stop.yml +ansible-playbook stop.yml ``` 该操作会按顺序关闭整个 DM 集群中的所有组件,包括 DM-master,DM-worker,以及监控组件。 @@ -469,36 +479,46 @@ dm_master ansible_host=172.16.10.71 dm_master_port=18261 1. 使用 `tidb` 账户登录至中控机,进入 `/home/tidb` 目录,然后备份`dm-ansible` 文件夹。 - ``` - $ cd /home/tidb - $ mv dm-ansible dm-ansible-bak + {{< copyable "shell-regular" >}} + + ```bash + cd /home/tidb && \ + mv dm-ansible dm-ansible-bak ``` 2. 下载指定版本 DM-Ansible,解压。 - ``` - $ cd /home/tidb - $ wget http://download.pingcap.org/dm-ansible-{version}.tar.gz - $ tar -xzvf dm-ansible-latest.tar.gz - $ mv dm-ansible-latest dm-ansible + {{< copyable "shell-regular" >}} + + ```bash + cd /home/tidb && \ + wget http://download.pingcap.org/dm-ansible-{version}.tar.gz && \ + tar -xzvf dm-ansible-latest.tar.gz && \ + mv dm-ansible-latest dm-ansible ``` 3. 迁移 `inventory.ini` 配置文件。 - ``` - $ cd /home/tidb - $ cp dm-ansible-bak/inventory.ini dm-ansible/inventory.ini + {{< copyable "shell-regular" >}} + + ```bash + cd /home/tidb && \ + cp dm-ansible-bak/inventory.ini dm-ansible/inventory.ini ``` 4. 迁移 `dmctl` 配置。 - ``` - $ cd /home/tidb/dm-ansible-bak/dmctl - $ cp * /home/tidb/dm-ansible/dmctl/ + {{< copyable "shell-regular" >}} + + ```bash + cd /home/tidb/dm-ansible-bak/dmctl && \ + cp * /home/tidb/dm-ansible/dmctl/ ``` 5. 用 Playbook 下载最新的 DM 二进制文件。此文件会自动替换 `/home/tidb/dm-ansible/resource/bin/` 目录下的二进制文件。 - ``` - $ ansible-playbook local_prepare.yml + {{< copyable "shell-regular" >}} + + ```bash + ansible-playbook local_prepare.yml ``` diff --git a/v3.0/how-to/deploy/data-migration-with-ansible.md b/v3.0/how-to/deploy/data-migration-with-ansible.md index 192c2e0433ff..5bf7256ec88d 100644 --- a/v3.0/how-to/deploy/data-migration-with-ansible.md +++ b/v3.0/how-to/deploy/data-migration-with-ansible.md @@ -449,9 +449,9 @@ dm-worker2 ansible_host=172.16.10.73 source_id="mysql-replica-02" server_id=102 ansible_user = tidb ``` - > **注意:** - > - > 请勿将 `ansible_user` 设为 `root`,因为 `tidb-ansible` 限制服务需以普通用户运行。 + > **注意:** + > + > 请勿将 `ansible_user` 设为 `root`,因为 `tidb-ansible` 限制服务需以普通用户运行。 运行以下命令。如果所有服务都返回 `tidb`,则 SSH 互信配置成功。 diff --git a/v3.1/how-to/deploy/data-migration-with-ansible.md b/v3.1/how-to/deploy/data-migration-with-ansible.md index 9afd6acdf778..19bc7a5d7e7c 100644 --- a/v3.1/how-to/deploy/data-migration-with-ansible.md +++ b/v3.1/how-to/deploy/data-migration-with-ansible.md @@ -448,9 +448,9 @@ dm-worker2 ansible_host=172.16.10.73 source_id="mysql-replica-02" server_id=102 ansible_user = tidb ``` - > **注意:** - > - > 请勿将 `ansible_user` 设为 `root`,因为 `tidb-ansible` 限制服务需以普通用户运行。 + > **注意:** + > + > 请勿将 `ansible_user` 设为 `root`,因为 `tidb-ansible` 限制服务需以普通用户运行。 运行以下命令。如果所有服务都返回 `tidb`,则 SSH 互信配置成功。