From 5e035307b9c5cccef27b25761526cde4c7b6aee5 Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Mon, 16 Mar 2020 15:40:47 +0800 Subject: [PATCH 1/5] add necessary actions on the target machines --- how-to/scale/with-ansible.md | 50 +++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/how-to/scale/with-ansible.md b/how-to/scale/with-ansible.md index a3a8a209fcad0..7fd02177cb46e 100644 --- a/how-to/scale/with-ansible.md +++ b/how-to/scale/with-ansible.md @@ -30,7 +30,9 @@ Assume that the topology is as follows: For example, if you want to add two TiDB nodes (node101, node102) with the IP addresses `172.16.10.101` and `172.16.10.102`, take the following steps: -1. Edit the `inventory.ini` file and append the node information: +1. Edit the `inventory.ini` file and the `hosts.ini` file, and append the node information: + + - Edit the `inventory.ini` file: ```ini [tidb_servers] @@ -86,11 +88,51 @@ For example, if you want to add two TiDB nodes (node101, node102) with the IP ad | node8 | 172.16.10.8 | TiKV3 | | node9 | 172.16.10.9 | TiKV4 | -2. Initialize the newly added node: + - Edit the `hosts.ini` file: + ```ini + [servers] + 172.16.10.1 + 172.16.10.2 + 172.16.10.3 + 172.16.10.4 + 172.16.10.5 + 172.16.10.6 + 172.16.10.7 + 172.16.10.8 + 172.16.10.9 + 172.16.10.101 + 172.16.10.102 + [all:vars] + username = tidb + ntp_server = pool.ntp.org ``` - ansible-playbook bootstrap.yml -l 172.16.10.101,172.16.10.102 - ``` + +2. Initialize the newly added node: + + 1. Configure the SSH mutual trust and sudo rules of the deployment machine on the central control machine: + + {{< copyable "shell-regular" >}} + + ```bash + ansible-playbook -i hosts.ini create_users.yml -l 172.16.10.101,172.16.10.102 -u root -k + ``` + + 2. Install the NTP service on the deployment target machine: + + {{< copyable "shell-regular" >}} + + ```bash + ansible-playbook -i hosts.ini deploy_ntp.yml -u tidb -b + ``` + + 3. Initialize the node on the deployment target machine: + + {{< copyable "shell-regular" >}} + + ```bash + ansible-playbook bootstrap.yml -l 172.16.10.101,172.16.10.102 + ``` > **Note:** > From e2035e2cb8c03d788ba9ef1754d4e473b08552ca Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Mon, 16 Mar 2020 16:10:02 +0800 Subject: [PATCH 2/5] refine format --- how-to/scale/with-ansible.md | 108 +++++++++++++++++------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/how-to/scale/with-ansible.md b/how-to/scale/with-ansible.md index 7fd02177cb46e..4f4be51e59063 100644 --- a/how-to/scale/with-ansible.md +++ b/how-to/scale/with-ansible.md @@ -34,43 +34,43 @@ For example, if you want to add two TiDB nodes (node101, node102) with the IP ad - Edit the `inventory.ini` file: - ```ini - [tidb_servers] - 172.16.10.4 - 172.16.10.5 - 172.16.10.101 - 172.16.10.102 - - [pd_servers] - 172.16.10.1 - 172.16.10.2 - 172.16.10.3 - - [tikv_servers] - 172.16.10.6 - 172.16.10.7 - 172.16.10.8 - 172.16.10.9 - - [monitored_servers] - 172.16.10.1 - 172.16.10.2 - 172.16.10.3 - 172.16.10.4 - 172.16.10.5 - 172.16.10.6 - 172.16.10.7 - 172.16.10.8 - 172.16.10.9 - 172.16.10.101 - 172.16.10.102 - - [monitoring_servers] - 172.16.10.3 - - [grafana_servers] - 172.16.10.3 - ``` + ```ini + [tidb_servers] + 172.16.10.4 + 172.16.10.5 + 172.16.10.101 + 172.16.10.102 + + [pd_servers] + 172.16.10.1 + 172.16.10.2 + 172.16.10.3 + + [tikv_servers] + 172.16.10.6 + 172.16.10.7 + 172.16.10.8 + 172.16.10.9 + + [monitored_servers] + 172.16.10.1 + 172.16.10.2 + 172.16.10.3 + 172.16.10.4 + 172.16.10.5 + 172.16.10.6 + 172.16.10.7 + 172.16.10.8 + 172.16.10.9 + 172.16.10.101 + 172.16.10.102 + + [monitoring_servers] + 172.16.10.3 + + [grafana_servers] + 172.16.10.3 + ``` Now the topology is as follows: @@ -90,23 +90,23 @@ For example, if you want to add two TiDB nodes (node101, node102) with the IP ad - Edit the `hosts.ini` file: - ```ini - [servers] - 172.16.10.1 - 172.16.10.2 - 172.16.10.3 - 172.16.10.4 - 172.16.10.5 - 172.16.10.6 - 172.16.10.7 - 172.16.10.8 - 172.16.10.9 - 172.16.10.101 - 172.16.10.102 - [all:vars] - username = tidb - ntp_server = pool.ntp.org - ``` + ```ini + [servers] + 172.16.10.1 + 172.16.10.2 + 172.16.10.3 + 172.16.10.4 + 172.16.10.5 + 172.16.10.6 + 172.16.10.7 + 172.16.10.8 + 172.16.10.9 + 172.16.10.101 + 172.16.10.102 + [all:vars] + username = tidb + ntp_server = pool.ntp.org + ``` 2. Initialize the newly added node: From 1542211a643e9e23f2d5e02b5596fe46f8e44634 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Tue, 17 Mar 2020 14:18:23 +0800 Subject: [PATCH 3/5] how-to: make indentations --- how-to/scale/with-ansible.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/how-to/scale/with-ansible.md b/how-to/scale/with-ansible.md index 4f4be51e59063..0cc7bf2282fec 100644 --- a/how-to/scale/with-ansible.md +++ b/how-to/scale/with-ansible.md @@ -72,21 +72,21 @@ For example, if you want to add two TiDB nodes (node101, node102) with the IP ad 172.16.10.3 ``` - Now the topology is as follows: - - | Name | Host IP | Services | - | ---- | ------- | -------- | - | node1 | 172.16.10.1 | PD1 | - | node2 | 172.16.10.2 | PD2 | - | node3 | 172.16.10.3 | PD3, Monitor | - | node4 | 172.16.10.4 | TiDB1 | - | node5 | 172.16.10.5 | TiDB2 | - | **node101** | **172.16.10.101**|**TiDB3** | - | **node102** | **172.16.10.102**|**TiDB4** | - | node6 | 172.16.10.6 | TiKV1 | - | node7 | 172.16.10.7 | TiKV2 | - | node8 | 172.16.10.8 | TiKV3 | - | node9 | 172.16.10.9 | TiKV4 | + Now the topology is as follows: + + | Name | Host IP | Services | + | ---- | ------- | -------- | + | node1 | 172.16.10.1 | PD1 | + | node2 | 172.16.10.2 | PD2 | + | node3 | 172.16.10.3 | PD3, Monitor | + | node4 | 172.16.10.4 | TiDB1 | + | node5 | 172.16.10.5 | TiDB2 | + | **node101** | **172.16.10.101**|**TiDB3** | + | **node102** | **172.16.10.102**|**TiDB4** | + | node6 | 172.16.10.6 | TiKV1 | + | node7 | 172.16.10.7 | TiKV2 | + | node8 | 172.16.10.8 | TiKV3 | + | node9 | 172.16.10.9 | TiKV4 | - Edit the `hosts.ini` file: From 90b3dd72e554f56e4e53d0351e2fd54d5d92ed91 Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Tue, 17 Mar 2020 17:05:55 +0800 Subject: [PATCH 4/5] Update how-to/scale/with-ansible.md Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com> --- how-to/scale/with-ansible.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/how-to/scale/with-ansible.md b/how-to/scale/with-ansible.md index 0cc7bf2282fec..18f13918c9f0f 100644 --- a/how-to/scale/with-ansible.md +++ b/how-to/scale/with-ansible.md @@ -108,7 +108,7 @@ For example, if you want to add two TiDB nodes (node101, node102) with the IP ad ntp_server = pool.ntp.org ``` -2. Initialize the newly added node: +2. Initialize the newly added node. 1. Configure the SSH mutual trust and sudo rules of the deployment machine on the central control machine: From 77386e65676d9fa38c48f1a0df19c56874843bd8 Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Tue, 17 Mar 2020 18:25:09 +0800 Subject: [PATCH 5/5] Update how-to/scale/with-ansible.md Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com> --- how-to/scale/with-ansible.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/how-to/scale/with-ansible.md b/how-to/scale/with-ansible.md index 18f13918c9f0f..0d29313d667ab 100644 --- a/how-to/scale/with-ansible.md +++ b/how-to/scale/with-ansible.md @@ -30,7 +30,7 @@ Assume that the topology is as follows: For example, if you want to add two TiDB nodes (node101, node102) with the IP addresses `172.16.10.101` and `172.16.10.102`, take the following steps: -1. Edit the `inventory.ini` file and the `hosts.ini` file, and append the node information: +1. Edit the `inventory.ini` file and the `hosts.ini` file, and append the node information. - Edit the `inventory.ini` file: