Skip to content

Commit

Permalink
fix indent and update some code copying tags (2.1) (#2032)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcalvin authored and lilin90 committed Nov 11, 2019
1 parent d9ff786 commit e384012
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 29 deletions.
6 changes: 3 additions & 3 deletions dev/how-to/deploy/data-migration-with-ansible.md
Expand Up @@ -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 互信配置成功。

Expand Down
60 changes: 40 additions & 20 deletions v2.1/how-to/deploy/data-migration-with-ansible.md
Expand Up @@ -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
```
Expand All @@ -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,以及监控组件。
Expand Down Expand Up @@ -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
```
6 changes: 3 additions & 3 deletions v3.0/how-to/deploy/data-migration-with-ansible.md
Expand Up @@ -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 互信配置成功。

Expand Down
6 changes: 3 additions & 3 deletions v3.1/how-to/deploy/data-migration-with-ansible.md
Expand Up @@ -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 互信配置成功。

Expand Down

0 comments on commit e384012

Please sign in to comment.