From 30effb8c9997f54153986d09f8b425ba437ab4fb Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Wed, 23 Jun 2021 17:26:27 +0800 Subject: [PATCH] Delete docker deployment docs --- deploy-test-cluster-using-docker-compose.md | 185 ----------------- dev-guide/deploy.md | 2 +- faq/deploy-and-maintain-faq.md | 4 - production-deployment-using-tiup.md | 2 +- test-deployment-using-docker.md | 213 -------------------- 5 files changed, 2 insertions(+), 404 deletions(-) delete mode 100644 deploy-test-cluster-using-docker-compose.md delete mode 100644 test-deployment-using-docker.md diff --git a/deploy-test-cluster-using-docker-compose.md b/deploy-test-cluster-using-docker-compose.md deleted file mode 100644 index 4ee24748070ec..0000000000000 --- a/deploy-test-cluster-using-docker-compose.md +++ /dev/null @@ -1,185 +0,0 @@ ---- -title: TiDB Docker Compose Deployment -summary: Use Docker Compose to quickly deploy a TiDB testing cluster. -aliases: ['/docs/dev/deploy-test-cluster-using-docker-compose/','/docs/dev/how-to/get-started/deploy-tidb-from-docker-compose/'] ---- - -# TiDB Docker Compose Deployment - -> **Warning:** -> -> The Docker Compose deployment method provided in this document is no longer maintained. If you want to test TiDB, it is recommended to refer to [Quick Start Guide for the TiDB Database Platform](/quick-start-with-tidb.md) for deployment. For **production environment**, **do not use** Docker Compose for deployment, but [deploy TiDB with TiUP](/production-deployment-using-tiup.md) or [TiDB Operator in Kubernetes](https://docs.pingcap.com/tidb-in-kubernetes/stable/deploy-tidb-operator). - -This document describes how to quickly deploy a TiDB testing cluster with a single command using [Docker Compose](https://docs.docker.com/compose/overview). - -With Docker Compose, you can use a YAML file to configure application services in multiple containers. Then, with a single command, you can create and start all the services from your configuration. - -## Prerequisites - -Make sure you have installed the following items on your machine: - -- [Git](https://git-scm.com/downloads) -- [Docker Compose](https://docs.docker.com/compose/install/) -- [MySQL Client](https://dev.mysql.com/downloads/mysql/) - -## Deploy TiDB using Docker Compose - -1. Download `tidb-docker-compose`. - - ```bash - git clone https://github.com/pingcap/tidb-docker-compose.git - ``` - -2. Change the directory to tidb-docker-compose and get the latest TiDB Docker Images: - - ```bash - cd tidb-docker-compose && docker-compose pull - ``` - -3. Start the TiDB cluster: - - ```bash - docker-compose up -d - ``` - -4. Use the MySQL client to connect to TiDB to read and write data: - - ``` - mysql -h 127.0.0.1 -P 4000 -u root - ``` - -## Monitor the cluster - -After you have successfully deployed a TiDB cluster, you can now monitor the TiDB cluster using one of the following methods: - -- Use Grafana to view the status of the cluster via [http://localhost:3000](http://localhost:3000) with the default account name and password: `admin` and `admin`. -- Use [TiDB-Vision](https://github.com/pingcap/tidb-vision), a cluster visualization tool, to see data transfer and load-balancing inside your cluster via [http://localhost:8010](http://localhost:8010). - -## Customize the cluster - -After the deployment is completed, the following components are deployed by default: - -- 3 PD instances, 3 TiKV instances, 1 TiDB instance -- Monitoring components: Prometheus, Pushgateway, Grafana -- Data visualization component: tidb-vision - -To customize the cluster, you can edit the `docker-compose.yml` file directly. It is recommended to generate `docker-compose.yml` using the [Helm](https://helm.sh) template engine, because manual editing is tedious and error-prone. - -1. Install Helm. - - [Helm](https://helm.sh) can be used as a template rendering engine. Make sure your Helm version >= 2.9.0 and < 3.0.0. - - To use Helm, you only need to download its binary file: - - ```bash - curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash - ``` - - For macOS, you can also install Helm using the following command in Homebrew: - - ```bash - brew install helm@2 - brew link --force helm@2 - ``` - -2. Download `tidb-docker-compose`. - - ```bash - git clone https://github.com/pingcap/tidb-docker-compose.git - ``` - -3. Customize the cluster. - - ```bash - cd tidb-docker-compose - vim compose/values.yaml # custom the cluster size, docker image, port mapping and so on - ``` - - You can modify the configuration in `values.yaml`, such as the cluster size, TiDB image version, and so on. - - [tidb-vision](https://github.com/pingcap/tidb-vision) is the data visualization interface of the TiDB cluster, used to visually display the PD scheduling on TiKV data. If you do not need this component, comment out the `tidbVision` section. - - For PD, TiKV, TiDB and tidb-vision, you can build Docker images from GitHub source code or local files for development and testing. - - - To build PD, TiKV or TiDB images from the locally compiled binary file, you need to comment out the `image` field and copy the compiled binary file to the corresponding `pd/bin/pd-server`, `tikv/bin/tikv-server`, `tidb/bin/tidb-server`. - - To build the tidb-vision image from local, you need to comment out the `image` field and copy the tidb-vision project to `tidb-vision/tidb-vision`. - -4. Generate the `docker-compose.yml` file. - - ```bash - helm template compose > generated-docker-compose.yml - ``` - -5. Create and start the cluster using the generated `docker-compose.yml` file. - - ```bash - docker-compose -f generated-docker-compose.yml pull # Get the latest Docker images - docker-compose -f generated-docker-compose.yml up -d - ``` - -6. Access the cluster. - - ```bash - mysql -h 127.0.0.1 -P 4000 -u root - ``` - - Access the Grafana monitoring interface: - - - Default address: - - Default account name: admin - - Default password: admin - - If tidb-vision is enabled, you can access the cluster data visualization interface: . - -## Access the Spark shell and load TiSpark - -Insert some sample data to the TiDB cluster: - -```bash -$ docker-compose exec tispark-master bash -$ cd /opt/spark/data/tispark-sample-data -$ mysql -h tidb -P 4000 -u root < dss.ddl -``` - -After the sample data is loaded into the TiDB cluster, you can access the Spark shell using `docker-compose exec tispark-master /opt/spark/bin/spark-shell`. - -```bash -$ docker-compose exec tispark-master /opt/spark/bin/spark-shell -... -Spark context available as 'sc' (master = local[*], app id = local-1527045927617). -Spark session available as 'spark'. -Welcome to - ____ __ - / __/__ ___ _____/ /__ - _\ \/ _ \/ _ `/ __/ '_/ - /___/ .__/\_,_/_/ /_/\_\ version 2.1.1 - /_/ - -Using Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_172) -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import org.apache.spark.sql.TiContext -... -scala> val ti = new TiContext(spark) -... -scala> ti.tidbMapDatabase("TPCH_001") -... -scala> spark.sql("select count(*) from lineitem").show -+--------+ -|count(1)| -+--------+ -| 60175| -+--------+ -``` - -You can also access Spark with Python or R using the following commands: - -``` -docker-compose exec tispark-master /opt/spark/bin/pyspark -docker-compose exec tispark-master /opt/spark/bin/sparkR -``` - -For more details about TiSpark, see [TiSpark Quick Start Guide](/get-started-with-tispark.md). - -Here is [a 5-minute tutorial](https://pingcap.com/blog/how_to_spin_up_an_htap_database_in_5_minutes_with_tidb_tispark/) for macOS users that shows how to spin up a standard TiDB cluster using Docker Compose on your local computer. diff --git a/dev-guide/deploy.md b/dev-guide/deploy.md index 3abd6f965896b..8a9a89e6796e6 100644 --- a/dev-guide/deploy.md +++ b/dev-guide/deploy.md @@ -5,7 +5,7 @@ draft: true # Build for Deployment -The easiest way to deploy TiDB is to use Docker Compose, see [TiDB Docker Compose Deployment](/deploy-test-cluster-using-docker-compose.md). For more deployment methods, see [TiDB deployment methods](/_index.md). +The easiest way to deploy TiDB is to use Docker Compose, see . ## Before you begin diff --git a/faq/deploy-and-maintain-faq.md b/faq/deploy-and-maintain-faq.md index 8e81c5901e28c..0e8a79dbe9158 100644 --- a/faq/deploy-and-maintain-faq.md +++ b/faq/deploy-and-maintain-faq.md @@ -104,10 +104,6 @@ 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 | -### How to deploy TiDB quickly using Docker Compose on a single machine? - -You can use Docker Compose to build a TiDB cluster locally, including the cluster monitoring components. You can also customize the version and number of instances for each component. The configuration file can also be customized. You can only use this deployment method for testing and development environment. For details, see [TiDB Docker Compose Deployment](/deploy-test-cluster-using-docker-compose.md). - ### How to separately record the slow query log in TiDB? How to locate the slow query SQL statement? 1. The slow query definition for TiDB is in the TiDB configuration file. The `slow-threshold: 300` parameter is used to configure the threshold value of the slow query (unit: millisecond). diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index 9b9b907b8bbc1..e44f0bbd6fda0 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -1,7 +1,7 @@ --- title: Deploy a TiDB Cluster Using TiUP summary: Learn how to easily deploy a TiDB cluster using TiUP. -aliases: ['/docs/dev/production-deployment-using-tiup/','/docs/dev/how-to/deploy/orchestrated/tiup/','/docs/dev/tiflash/deploy-tiflash/','/docs/dev/reference/tiflash/deploy/','/tidb/dev/deploy-tidb-from-dbdeployer/','/docs/dev/deploy-tidb-from-dbdeployer/','/docs/dev/how-to/get-started/deploy-tidb-from-dbdeployer/','/tidb/dev/deploy-tidb-from-homebrew/','/docs/dev/deploy-tidb-from-homebrew/','/docs/dev/how-to/get-started/deploy-tidb-from-homebrew/','/tidb/dev/production-offline-deployment-using-tiup','/docs/dev/production-offline-deployment-using-tiup/','/tidb/dev/deploy-tidb-from-binary','/tidb/dev/production-deployment-from-binary-tarball','/tidb/dev/test-deployment-from-binary-tarball'] +aliases: ['/docs/dev/production-deployment-using-tiup/','/docs/dev/how-to/deploy/orchestrated/tiup/','/docs/dev/tiflash/deploy-tiflash/','/docs/dev/reference/tiflash/deploy/','/tidb/dev/deploy-tidb-from-dbdeployer/','/docs/dev/deploy-tidb-from-dbdeployer/','/docs/dev/how-to/get-started/deploy-tidb-from-dbdeployer/','/tidb/dev/deploy-tidb-from-homebrew/','/docs/dev/deploy-tidb-from-homebrew/','/docs/dev/how-to/get-started/deploy-tidb-from-homebrew/','/tidb/dev/production-offline-deployment-using-tiup','/docs/dev/production-offline-deployment-using-tiup/','/tidb/dev/deploy-tidb-from-binary','/tidb/dev/production-deployment-from-binary-tarball','/tidb/dev/test-deployment-from-binary-tarball','/tidb/dev/deploy-test-cluster-using-docker-compose','/tidb/dev/test-deployment-using-docker'] --- # Deploy a TiDB Cluster Using TiUP diff --git a/test-deployment-using-docker.md b/test-deployment-using-docker.md deleted file mode 100644 index 8e467c04d6044..0000000000000 --- a/test-deployment-using-docker.md +++ /dev/null @@ -1,213 +0,0 @@ ---- -title: Deploy TiDB Using Docker -summary: Use Docker to manually deploy a multi-node TiDB cluster on multiple machines. -aliases: ['/docs/dev/test-deployment-using-docker/','/docs/dev/how-to/deploy/orchestrated/docker/'] ---- - -# Deploy TiDB Using Docker - -> **Warning:** -> -> The Docker deployment method provided in this document is no longer maintained. If you want to test TiDB, it is recommended to refer to [Quick Start Guide for the TiDB Database Platform](/quick-start-with-tidb.md) for deployment. For **production environment**, **do not use** Docker Compose for deployment, but [deploy TiDB with TiUP](/production-deployment-using-tiup.md) or [TiDB Operator in Kubernetes](https://docs.pingcap.com/tidb-in-kubernetes/stable/deploy-tidb-operator). - -This document shows you how to manually deploy a multi-node TiDB cluster on multiple machines using Docker. - -To learn more, see [TiDB architecture](/tidb-architecture.md) and [Software and Hardware Recommendations](/hardware-and-software-requirements.md). - -## Preparation - -Before you start, make sure that you have: - -+ Installed the latest version of [Docker](https://www.docker.com/products/docker) -+ Pulled the latest images of TiDB, TiKV and PD from [Docker Hub](https://hub.docker.com/u/pingcap). If not, pull the images using the following commands: - - ```bash - docker pull pingcap/tidb:latest - docker pull pingcap/tikv:latest - docker pull pingcap/pd:latest - ``` - -## Multi nodes deployment - -Assume we have 6 machines with the following details: - -| Host Name | IP | Services | Data Path | -| --------- | ------------- | ---------- | --------- | -| **host1** | 192.168.1.101 | PD1 & TiDB | /data | -| **host2** | 192.168.1.102 | PD2 | /data | -| **host3** | 192.168.1.103 | PD3 | /data | -| **host4** | 192.168.1.104 | TiKV1 | /data | -| **host5** | 192.168.1.105 | TiKV2 | /data | -| **host6** | 192.168.1.106 | TiKV3 | /data | - -### 1. Start PD - -Start PD1 on the **host1** - -```bash -docker run -d --name pd1 \ - -p 2379:2379 \ - -p 2380:2380 \ - -v /etc/localtime:/etc/localtime:ro \ - -v /data:/data \ - pingcap/pd:latest \ - --name="pd1" \ - --data-dir="/data/pd1" \ - --client-urls="http://0.0.0.0:2379" \ - --advertise-client-urls="http://192.168.1.101:2379" \ - --peer-urls="http://0.0.0.0:2380" \ - --advertise-peer-urls="http://192.168.1.101:2380" \ - --initial-cluster="pd1=http://192.168.1.101:2380,pd2=http://192.168.1.102:2380,pd3=http://192.168.1.103:2380" -``` - -Start PD2 on the **host2** - -```bash -docker run -d --name pd2 \ - -p 2379:2379 \ - -p 2380:2380 \ - -v /etc/localtime:/etc/localtime:ro \ - -v /data:/data \ - pingcap/pd:latest \ - --name="pd2" \ - --data-dir="/data/pd2" \ - --client-urls="http://0.0.0.0:2379" \ - --advertise-client-urls="http://192.168.1.102:2379" \ - --peer-urls="http://0.0.0.0:2380" \ - --advertise-peer-urls="http://192.168.1.102:2380" \ - --initial-cluster="pd1=http://192.168.1.101:2380,pd2=http://192.168.1.102:2380,pd3=http://192.168.1.103:2380" -``` - -Start PD3 on the **host3** - -```bash -docker run -d --name pd3 \ - -p 2379:2379 \ - -p 2380:2380 \ - -v /etc/localtime:/etc/localtime:ro \ - -v /data:/data \ - pingcap/pd:latest \ - --name="pd3" \ - --data-dir="/data/pd3" \ - --client-urls="http://0.0.0.0:2379" \ - --advertise-client-urls="http://192.168.1.103:2379" \ - --peer-urls="http://0.0.0.0:2380" \ - --advertise-peer-urls="http://192.168.1.103:2380" \ - --initial-cluster="pd1=http://192.168.1.101:2380,pd2=http://192.168.1.102:2380,pd3=http://192.168.1.103:2380" -``` - -### 2. Start TiKV - -Start TiKV1 on the **host4** - -```bash -docker run -d --name tikv1 \ - -p 20160:20160 \ - -v /etc/localtime:/etc/localtime:ro \ - -v /data:/data \ - pingcap/tikv:latest \ - --addr="0.0.0.0:20160" \ - --advertise-addr="192.168.1.104:20160" \ - --data-dir="/data/tikv1" \ - --pd="192.168.1.101:2379,192.168.1.102:2379,192.168.1.103:2379" -``` - -Start TiKV2 on the **host5** - -```bash -docker run -d --name tikv2 \ - -p 20160:20160 \ - -v /etc/localtime:/etc/localtime:ro \ - -v /data:/data \ - pingcap/tikv:latest \ - --addr="0.0.0.0:20160" \ - --advertise-addr="192.168.1.105:20160" \ - --data-dir="/data/tikv2" \ - --pd="192.168.1.101:2379,192.168.1.102:2379,192.168.1.103:2379" -``` - -Start TiKV3 on the **host6** - -```bash -docker run -d --name tikv3 \ - -p 20160:20160 \ - -v /etc/localtime:/etc/localtime:ro \ - -v /data:/data \ - pingcap/tikv:latest \ - --addr="0.0.0.0:20160" \ - --advertise-addr="192.168.1.106:20160" \ - --data-dir="/data/tikv3" \ - --pd="192.168.1.101:2379,192.168.1.102:2379,192.168.1.103:2379" -``` - -### 3. Start TiDB - -Start TiDB on the **host1** - -```bash -docker run -d --name tidb \ - -p 4000:4000 \ - -p 10080:10080 \ - -v /etc/localtime:/etc/localtime:ro \ - pingcap/tidb:latest \ - --store=tikv \ - --path="192.168.1.101:2379,192.168.1.102:2379,192.168.1.103:2379" -``` - -### 4. Use the MySQL client to connect to TiDB - -Install the [MySQL client](http://dev.mysql.com/downloads/mysql/) on **host1** and run: - -```bash -$ mysql -h 127.0.0.1 -P 4000 -u root -D test -mysql> show databases; -+--------------------+ -| Database | -+--------------------+ -| INFORMATION_SCHEMA | -| PERFORMANCE_SCHEMA | -| mysql | -| test | -+--------------------+ -4 rows in set (0.00 sec) -``` - -### How to customize the configuration file - -The TiKV and PD can be started with a specified configuration file, which includes some advanced parameters, for the performance tuning. - -Assume that the path to configuration file of PD and TiKV on the host is `/path/to/config/pd.toml` and `/path/to/config/tikv.toml` - -You can start TiKV and PD as follows: - -```bash -docker run -d --name tikv1 \ - -p 20160:20160 \ - -v /etc/localtime:/etc/localtime:ro \ - -v /data:/data \ - -v /path/to/config/tikv.toml:/tikv.toml:ro \ - pingcap/tikv:latest \ - --addr="0.0.0.0:20160" \ - --advertise-addr="192.168.1.104:20160" \ - --data-dir="/data/tikv1" \ - --pd="192.168.1.101:2379,192.168.1.102:2379,192.168.1.103:2379" \ - --config="/tikv.toml" -``` - -```bash -docker run -d --name pd1 \ - -p 2379:2379 \ - -p 2380:2380 \ - -v /etc/localtime:/etc/localtime:ro \ - -v /data:/data \ - -v /path/to/config/pd.toml:/pd.toml:ro \ - pingcap/pd:latest \ - --name="pd1" \ - --data-dir="/data/pd1" \ - --client-urls="http://0.0.0.0:2379" \ - --advertise-client-urls="http://192.168.1.101:2379" \ - --peer-urls="http://0.0.0.0:2380" \ - --advertise-peer-urls="http://192.168.1.101:2380" \ - --initial-cluster="pd1=http://192.168.1.101:2380,pd2=http://192.168.1.102:2380,pd3=http://192.168.1.103:2380" \ - --config="/pd.toml" -```