Skip to content

Commit

Permalink
cherry pick pingcap#2108 to release-3.1
Browse files Browse the repository at this point in the history
Signed-off-by: sre-bot <sre-bot@pingcap.com>
  • Loading branch information
TomShawn authored and sre-bot committed Mar 27, 2020
1 parent 5ee51dc commit 6a62f78
Show file tree
Hide file tree
Showing 23 changed files with 61 additions and 57 deletions.
4 changes: 2 additions & 2 deletions _index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ TiDB ("Ti" stands for Titanium) is an open-source NewSQL database that supports

TiDB can be deployed on-premise or in-cloud. The following deployment options are officially supported by PingCAP:

- [Ansible Deployment](/how-to/deploy/orchestrated/ansible.md): This guide describes how to deploy TiDB using Ansible. It is strongly recommended for production deployment.
- [Ansible Offline Deployment](/how-to/deploy/orchestrated/offline-ansible.md): If your environment has no access to the internet, you can follow this guide to see how to deploy a TiDB cluster offline using Ansible.
- [Ansible Deployment](/how-to/deploy/orchestrated/ansible.md): This guide describes how to deploy TiDB using TiDB Ansible. It is strongly recommended for production deployment.
- [Ansible Offline Deployment](/how-to/deploy/orchestrated/offline-ansible.md): If your environment has no access to the internet, you can follow this guide to see how to deploy a TiDB cluster offline using TiDB Ansible.
- [Docker Deployment](/how-to/deploy/orchestrated/docker.md): This guide describes how to deploy TiDB using Docker.
- Kubernetes Deployment:

Expand Down
12 changes: 6 additions & 6 deletions faq/tidb.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ For details, see [Software and Hardware Recommendations](/how-to/deploy/hardware

### Install and deploy

#### Deploy TiDB using Ansible (recommended)
#### Deploy TiDB using TiDB Ansible (recommended)

See [Ansible Deployment](/how-to/deploy/orchestrated/ansible.md).

Expand Down Expand Up @@ -245,9 +245,9 @@ Check the time difference between the machine time of the monitor and the time w
| enable_slow_query_log | to record the slow query log of TiDB into a single file: ({{ deploy_dir }}/log/tidb_slow_query.log). False by default, to record it into the TiDB log |
| deploy_without_tidb | the Key-Value mode, deploy only PD, TiKV and the monitoring service, not TiDB; set the IP of the tidb_servers host group to null in the `inventory.ini` file |

#### Deploy TiDB offline using Ansible
#### Deploy TiDB offline using TiDB Ansible

It is not recommended to deploy TiDB offline using Ansible. If the Control Machine has no access to external network, you can deploy TiDB offline using Ansible. For details, see [Offline Deployment Using Ansible](/how-to/deploy/orchestrated/offline-ansible.md).
It is not recommended to deploy TiDB offline using TiDB Ansible. If the Control Machine has no access to external network, you can deploy TiDB offline using TiDB Ansible. For details, see [Offline Deployment Using TiDB Ansible](/how-to/deploy/orchestrated/offline-ansible.md).

#### How to deploy TiDB quickly using Docker Compose on a single machine?

Expand Down Expand Up @@ -302,7 +302,7 @@ Two possible reasons and solutions:

### Upgrade

#### How to perform rolling updates using Ansible?
#### How to perform rolling updates using TiDB Ansible?

- Apply rolling updates to the TiKV node (only update the TiKV service).

Expand All @@ -322,7 +322,7 @@ When you apply rolling updates to the TiDB services, the running application is

#### How to upgrade when I deploy TiDB using Binary?

It is not recommended to deploy TiDB using Binary. The support for upgrading using Binary is not as friendly as using Ansible. It is recommended to deploy TiDB using Ansible.
It is not recommended to deploy TiDB using Binary. The support for upgrading using Binary is not as friendly as using TiDB Ansible. It is recommended to deploy TiDB using TiDB Ansible.

#### Should I upgrade TiKV or all components generally?

Expand Down Expand Up @@ -385,7 +385,7 @@ By default, TiDB/PD/TiKV outputs standard error in the logs. If a log file is sp

#### How to safely stop TiDB?

If the cluster is deployed using Ansible, you can use the `ansible-playbook stop.yml` command to stop the TiDB cluster. If the cluster is not deployed using Ansible, `kill` all the services directly. The components of TiDB will do `graceful shutdown`.
If the cluster is deployed using TiDB Ansible, you can use the `ansible-playbook stop.yml` command to stop the TiDB cluster. If the cluster is not deployed using TiDB Ansible, `kill` all the services directly. The components of TiDB will do `graceful shutdown`.

#### Can `kill` be executed in TiDB?

Expand Down
4 changes: 2 additions & 2 deletions how-to/deploy/data-migration-with-ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Make sure you have logged in to the Control Machine using the `tidb` user accoun

Make sure you have logged in to the Control Machine using the `tidb` user account.

It is required to use `pip` to install Ansible and its dependencies, otherwise a compatibility issue occurs. Currently, DM-Ansible is compatible with Ansible 2.5 or later.
It is required to use `pip` to install DM-Ansible and its dependencies, otherwise a compatibility issue occurs. Currently, DM-Ansible is compatible with Ansible 2.5 or later.

1. Install DM-Ansible and the dependencies on the Control Machine:

Expand All @@ -158,7 +158,7 @@ It is required to use `pip` to install Ansible and its dependencies, otherwise a
sudo pip install -r ./requirements.txt
```

Ansible and the related dependencies are in the `dm-ansible/requirements.txt` file.
DM-Ansible and the related dependencies are in the `dm-ansible/requirements.txt` file.

2. View the version of Ansible:

Expand Down
2 changes: 1 addition & 1 deletion how-to/deploy/geographic-redundancy/location-awareness.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ category: how-to

PD schedules according to the topology of the TiKV cluster to maximize the TiKV's capability for disaster recovery.

Before you begin, see [Deploy TiDB Using Ansible (Recommended)](/how-to/deploy/orchestrated/ansible.md) and [Deploy TiDB Using Docker](/how-to/deploy/orchestrated/docker.md).
Before you begin, see [Deploy TiDB Using TiDB Ansible (Recommended)](/how-to/deploy/orchestrated/ansible.md) and [Deploy TiDB Using Docker](/how-to/deploy/orchestrated/docker.md).

## TiKV reports the topological information

Expand Down
24 changes: 14 additions & 10 deletions how-to/deploy/orchestrated/ansible.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: Deploy TiDB Using Ansible
summary: Use Ansible to deploy a TiDB cluster.
title: Deploy TiDB Using TiDB Ansible
summary: Use TiDB Ansible to deploy a TiDB cluster.
category: how-to
---

# Deploy TiDB Using Ansible
# Deploy TiDB Using TiDB Ansible

This guide describes how to deploy a TiDB cluster using Ansible. For the production environment, it is recommended to deploy TiDB using Ansible.
This guide describes how to deploy a TiDB cluster using TiDB Ansible. For the production environment, it is recommended to deploy TiDB using TiDB Ansible.

## Overview

Expand Down Expand Up @@ -42,7 +42,11 @@ Before you start, make sure you have:

> **Note:**
>
<<<<<<< HEAD
> When you deploy TiDB using Ansible, **use SSD disks for the data directory of TiKV and PD nodes**. Otherwise, it cannot pass the check. If you only want to try TiDB out and explore the features, it is recommended to [deploy TiDB using Docker Compose](https://pingcap.com/docs/dev/how-to/get-started/deploy-tidb-from-docker-compose/) on a single machine.
=======
> When you deploy TiDB using TiDB Ansible, **use SSD disks for the data directory of TiKV and PD nodes**. Otherwise, it cannot pass the check. If you only want to try TiDB out and explore the features, it is recommended to [deploy TiDB using Docker Compose](/how-to/get-started/deploy-tidb-from-docker-compose.md) on a single machine.
>>>>>>> 0aaad48... *: unify ansible names (#2108)
2. A Control Machine that meets the following requirements:

Expand Down Expand Up @@ -166,13 +170,13 @@ git clone -b $tag https://github.com/pingcap/tidb-ansible.git
If you have questions regarding which version to use, email to info@pingcap.com for more information or [file an issue](https://github.com/pingcap/tidb-ansible/issues/new).

## Step 4: Install Ansible and its dependencies on the Control Machine
## Step 4: Install TiDB Ansible and its dependencies on the Control Machine

Make sure you have logged in to the Control Machine using the `tidb` user account.

It is required to use `pip` to install Ansible and its dependencies, otherwise a compatibility issue occurs. Currently, the release-2.0, release-2.1, release-3.1, and master branches of TiDB Ansible are compatible with Ansible 2.4 ~ 2.7.11 (2.4 ≤ Ansible ≤ 2.7.11).

1. Install Ansible and the dependencies on the Control Machine:
1. Install TiDB Ansible and the dependencies on the Control Machine:

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

Expand All @@ -183,7 +187,7 @@ It is required to use `pip` to install Ansible and its dependencies, otherwise a

The version information of Ansible and dependencies is in the `tidb-ansible/requirements.txt` file.

2. View the version of Ansible:
2. View the version of TiDB Ansible:

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

Expand Down Expand Up @@ -636,7 +640,7 @@ To enable the following control variables, use the capitalized `True`. To disabl
| deploy_without_tidb | the Key-Value mode, deploy only PD, TiKV and the monitoring service, not TiDB; set the IP of the tidb_servers host group to null in the `inventory.ini` file |
| alertmanager_target | optional: If you have deployed `alertmanager` separately, you can configure this variable using the `alertmanager_host:alertmanager_port` format |
| grafana_admin_user | the username of Grafana administrator; default `admin` |
| grafana_admin_password | the password of Grafana administrator account; default `admin`; used to import Dashboard and create the API key using Ansible; update this variable if you have modified it through Grafana web |
| grafana_admin_password | the password of Grafana administrator account; default `admin`; used to import Dashboard and create the API key using TiDB Ansible; update this variable if you have modified it through Grafana web |
| collect_log_recent_hours | to collect the log of recent hours; default the recent 2 hours |
| enable_bandwidth_limit | to set a bandwidth limit when pulling the diagnostic data from the target machines to the Control Machine; used together with the `collect_bandwidth_limit` variable |
| collect_bandwidth_limit | the limited bandwidth when pulling the diagnostic data from the target machines to the Control Machine; unit: Kbit/s; default 10000, indicating 10Mb/s; for the cluster topology of multiple TiKV instances on each TiKV node, you need to divide the number of the TiKV instances on each TiKV node |
Expand Down Expand Up @@ -741,7 +745,7 @@ Because TiDB is compatible with MySQL, you must use the MySQL client to connect

## Deployment FAQs

This section lists the common questions about deploying TiDB using Ansible.
This section lists the common questions about deploying TiDB using TiDB Ansible.

### How to customize the port?

Expand Down Expand Up @@ -944,7 +948,7 @@ ansible-playbook start.yml

### Error: You need to install jmespath prior to running json_query filter

1. See [Install Ansible and its dependencies on the Control Machine](#step-4-install-ansible-and-its-dependencies-on-the-control-machine) and use `pip` to install Ansible and the corresponding dependencies in the Control Machine. The `jmespath` dependent package is installed by default.
1. See [Install TiDB Ansible and its dependencies on the Control Machine](#step-4-install-tidb-ansible-and-its-dependencies-on-the-control-machine) and use `pip` to install TiDB Ansible and the corresponding dependencies in the Control Machine. The `jmespath` dependent package is installed by default.

2. Run the following command to check whether `jmespath` is successfully installed:

Expand Down
24 changes: 12 additions & 12 deletions how-to/deploy/orchestrated/offline-ansible.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: Deploy TiDB Offline Using Ansible
summary: Use Ansible to deploy a TiDB cluster offline.
title: Deploy TiDB Offline Using TiDB Ansible
summary: Use TiDB Ansible to deploy a TiDB cluster offline.
category: how-to
---

# Deploy TiDB Offline Using Ansible
# Deploy TiDB Offline Using TiDB Ansible

This guide describes how to deploy a TiDB cluster offline using Ansible.
This guide describes how to deploy a TiDB cluster offline using TiDB Ansible.

## Prepare

Expand Down Expand Up @@ -57,19 +57,19 @@ Take the following steps to install system dependencies on the Control Machine i

> **Note:**
>
> If `pip` is already installed to your system, make sure that the version is 8.1.2 or later. Otherwise, compatibility error occurs when you install Ansible and its dependencies offline.
> If `pip` is already installed to your system, make sure that the version is 8.1.2 or later. Otherwise, compatibility error occurs when you install TiDB Ansible and its dependencies offline.
## Step 2: Create the `tidb` user on the Control Machine and generate the SSH key

See [Create the `tidb` user on the Control Machine and generate the SSH key](/how-to/deploy/orchestrated/ansible.md#step-2-create-the-tidb-user-on-the-control-machine-and-generate-the-ssh-key).

## Step 3: Install Ansible and its dependencies offline on the Control Machine
## Step 3: Install TiDB Ansible and its dependencies offline on the Control Machine

Currently, all the versions of Ansible from 2.4 to 2.7.11 are supported. The versions of Ansible and the related dependencies are listed in the `tidb-ansible/requirements.txt` file. The following installation steps take Ansible 2.5 as an example.
Currently, all the versions of TiDB Ansible from 2.4 to 2.7.11 are supported. The versions of TiDB Ansible and the related dependencies are listed in the `tidb-ansible/requirements.txt` file. The following installation steps take Ansible 2.5 as an example.

1. Download [Ansible 2.5 offline installation package](https://download.pingcap.org/ansible-2.5.0-pip.tar.gz) on the download machine and then upload it to the Control Machine.

2. Install Ansible and its dependencies offline.
2. Install TiDB Ansible and its dependencies offline.

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

Expand All @@ -80,9 +80,9 @@ Currently, all the versions of Ansible from 2.4 to 2.7.11 are supported. The ver
./install_ansible.sh
```

3. View the version of Ansible.
3. View the version of TiDB Ansible.

After Ansible is installed, you can view the version using `ansible --version`.
After TiDB Ansible is installed, you can view the version using `ansible --version`.

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

Expand All @@ -96,9 +96,9 @@ Currently, all the versions of Ansible from 2.4 to 2.7.11 are supported. The ver

## Step 4: Download TiDB Ansible and TiDB packages on the download machine

1. Install Ansible on the download machine.
1. Install TiDB Ansible on the download machine.

Use the following method to install Ansible online on the download machine installed with the CentOS 7 system. After Ansible is installed, you can view the version using `ansible --version`.
Use the following method to install Ansible online on the download machine installed with the CentOS 7 system. After TiDB Ansible is installed, you can view the version using `ansible --version`.

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

Expand Down
2 changes: 1 addition & 1 deletion how-to/monitor/monitor-a-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ curl http://127.0.0.1:2379/pd/api/v1/stores
The metrics interface monitors the state and performance of the entire TiDB cluster.
- If you use Ansible to deploy the TiDB cluster, the monitoring system (Prometheus and Grafana) is deployed at the same time.
- If you use TiDB Ansible to deploy the TiDB cluster, the monitoring system (Prometheus and Grafana) is deployed at the same time.
- If you use other deployment ways, [deploy Prometheus and Grafana](#deploy-prometheus-and-grafana) before using this interface.
After Prometheus and Grafana are successfully deployed, [configure Grafana](#configure-grafana).
Expand Down
2 changes: 1 addition & 1 deletion how-to/scale/horizontally.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The capacity of a TiDB cluster can be increased or reduced without affecting onl

> **Note:**
>
> If your TiDB cluster is deployed using Ansible, see [Scale the TiDB Cluster Using TiDB Ansible](/how-to/scale/with-ansible.md).
> If your TiDB cluster is deployed using TiDB Ansible, see [Scale the TiDB Cluster Using TiDB Ansible](/how-to/scale/with-ansible.md).
The following part shows you how to add or delete PD, TiKV or TiDB nodes.

Expand Down
2 changes: 1 addition & 1 deletion how-to/upgrade/from-previous-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This document is targeted for users who want to upgrade from TiDB 2.0, 2.1, or 3
TiDB Ansible release-3.1 depends on Ansible 2.4.2 ~ 2.7.11 (`2.4.2 ≦ ansible ≦ 2.7.11`, Ansible 2.7.11 recommended) and the Python modules of `jinja2 ≧ 2.9.6` and `jmespath ≧ 0.9.0`.

To make it easy to manage dependencies, use `pip` to install Ansible and its dependencies. For details, see [Install Ansible and its dependencies on the Control Machine](/how-to/deploy/orchestrated/ansible.md#step-4-install-ansible-and-its-dependencies-on-the-control-machine). For offline environment, see [Install Ansible and its dependencies offline on the Control Machine](/how-to/deploy/orchestrated/offline-ansible.md#step-3-install-ansible-and-its-dependencies-offline-on-the-control-machine).
To make it easy to manage dependencies, use `pip` to install Ansible and its dependencies. For details, see [Install Ansible and its dependencies on the Control Machine](/how-to/deploy/orchestrated/ansible.md#step-4-install-tidb-ansible-and-its-dependencies-on-the-control-machine). For offline environment, see [Install Ansible and its dependencies offline on the Control Machine](/how-to/deploy/orchestrated/offline-ansible.md#step-3-install-tidb-ansible-and-its-dependencies-offline-on-the-control-machine).

After the installation is finished, you can view the version information using the following command:

Expand Down
4 changes: 2 additions & 2 deletions overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ TiDB ("Ti" stands for Titanium) is an open-source NewSQL database that supports

TiDB can be deployed on-premise or in-cloud. The following deployment options are officially supported by PingCAP:

- [Ansible Deployment](/how-to/deploy/orchestrated/ansible.md): This guide describes how to deploy TiDB using Ansible. It is strongly recommended for production deployment.
- [Ansible Offline Deployment](/how-to/deploy/orchestrated/offline-ansible.md): If your environment has no access to the internet, you can follow this guide to see how to deploy a TiDB cluster offline using Ansible.
- [Ansible Deployment](/how-to/deploy/orchestrated/ansible.md): This guide describes how to deploy TiDB using TiDB Ansible. It is strongly recommended for production deployment.
- [Ansible Offline Deployment](/how-to/deploy/orchestrated/offline-ansible.md): If your environment has no access to the internet, you can follow this guide to see how to deploy a TiDB cluster offline using TiDB Ansible.
- [Docker Deployment](/how-to/deploy/orchestrated/docker.md): This guide describes how to deploy TiDB using Docker.
- Kubernetes Deployment:

Expand Down
2 changes: 1 addition & 1 deletion reference/key-monitoring-metrics/overview-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ category: reference

# Key Metrics

If you use Ansible to deploy the TiDB cluster, the monitoring system is deployed at the same time. For more information, see [TiDB Monitoring Framework Overview](/how-to/monitor/overview.md).
If you use TiDB Ansible to deploy the TiDB cluster, the monitoring system is deployed at the same time. For more information, see [TiDB Monitoring Framework Overview](/how-to/monitor/overview.md).

The Grafana dashboard is divided into a series of sub dashboards which include Overview, PD, TiDB, TiKV, Node\_exporter, Disk Performance, and so on. A lot of metrics are there to help you diagnose.

Expand Down
2 changes: 1 addition & 1 deletion reference/key-monitoring-metrics/pd-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ category: reference

# Key Monitoring Metrics of PD

If you use Ansible to deploy the TiDB cluster, the monitoring system is deployed at the same time. For more information, see [Overview of the Monitoring Framework](/how-to/monitor/overview.md).
If you use TiDB Ansible to deploy the TiDB cluster, the monitoring system is deployed at the same time. For more information, see [Overview of the Monitoring Framework](/how-to/monitor/overview.md).

The Grafana dashboard is divided into a series of sub dashboards which include Overview, PD, TiDB, TiKV, Node\_exporter, Disk Performance, and so on. A lot of metrics are there to help you diagnose.

Expand Down
2 changes: 1 addition & 1 deletion reference/key-monitoring-metrics/tidb-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ category: reference

# TiDB Monitoring Metrics

If you use Ansible to deploy the TiDB cluster, the monitoring system is deployed at the same time. For more information, see [TiDB Monitoring Framework Overview](/how-to/monitor/overview.md).
If you use TiDB Ansible to deploy the TiDB cluster, the monitoring system is deployed at the same time. For more information, see [TiDB Monitoring Framework Overview](/how-to/monitor/overview.md).

The Grafana dashboard is divided into a series of sub dashboards which include Overview, PD, TiDB, TiKV, Node\_exporter, Disk Performance, and so on. The TiDB dashboard consists of the TiDB panel and the TiDB Summary panel, and what displays on the TiDB Summary panel also displays on the TiDB panel. A lot of metrics are there to help you diagnose.

Expand Down

0 comments on commit 6a62f78

Please sign in to comment.