You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: op-guide/docker-compose.md
+59-6Lines changed: 59 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,22 @@
1
1
---
2
2
title: TiDB Docker Compose Deployment
3
+
summary: Deploy a TiDB testing cluster with a single command using Docker Compose.
3
4
category: operations
4
5
---
5
6
6
7
# TiDB Docker Compose Deployment
7
8
8
-
This document describes how to quickly deploy TiDB using [Docker Compose](https://docs.docker.com/compose/overview).
9
+
This document describes how to quickly deploy a TiDB testing cluster with a single command using [Docker Compose](https://docs.docker.com/compose/overview).
9
10
10
11
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.
11
12
12
-
You can use Docker Compose to deploy a TiDB test cluster with a single command. It is required to use Docker 17.06.0 or later.
13
+
## Prerequisites
14
+
15
+
Make sure you have installed the following items on your machine:
16
+
17
+
- Docker (17.06.0 or later)
18
+
- Docker Compose
19
+
- Git
13
20
14
21
## Deploy TiDB using Docker Compose
15
22
@@ -22,7 +29,8 @@ You can use Docker Compose to deploy a TiDB test cluster with a single command.
22
29
2. Create and start the cluster.
23
30
24
31
```bash
25
-
cd tidb-docker-compose && docker-compose up -d
32
+
cd tidb-docker-compose && docker-compose pull # Get the latest Docker images
33
+
docker-compose up -d
26
34
```
27
35
28
36
3. Access the cluster.
@@ -59,7 +67,7 @@ To customize the cluster, you can edit the `docker-compose.yml` file directly. I
59
67
60
68
For macOS, you can also install Helm using the following commandin Homebrew:
61
69
62
-
```
70
+
```bash
63
71
brew install kubernetes-helm
64
72
```
65
73
@@ -77,7 +85,7 @@ To customize the cluster, you can edit the `docker-compose.yml` file directly. I
77
85
vim values.yaml
78
86
```
79
87
80
-
Modify the configuration in`values.yaml`, such as the cluster size, TiDB image version, and so on.
88
+
You can modify the configuration in`values.yaml`, such as the cluster size, TiDB image version, and so on.
81
89
82
90
[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, leave `tidbVision` empty.
83
91
@@ -96,6 +104,7 @@ To customize the cluster, you can edit the `docker-compose.yml` file directly. I
96
104
5. Create and start the cluster using the generated `docker-compose.yml` file.
97
105
98
106
```bash
107
+
docker-compose -f generated-docker-compose.yaml pull # Get the latest Docker images
99
108
docker-compose -f generated-docker-compose.yml up -d
100
109
```
101
110
@@ -111,4 +120,48 @@ To customize the cluster, you can edit the `docker-compose.yml` file directly. I
111
120
- Default account name: admin
112
121
- Default password: admin
113
122
114
-
If tidb-vision is enabled, you can access the cluster data visualization interface: <http://localhost:8010>.
123
+
If tidb-vision is enabled, you can access the cluster data visualization interface: <http://localhost:8010>.
124
+
125
+
## Access the Spark shell and load TiSpark
126
+
127
+
Insert some sample data to the TiDB cluster:
128
+
129
+
```bash
130
+
$ docker-compose exec tispark-master bash
131
+
$ cd /opt/spark/data/tispark-sample-data
132
+
$ mysql -h tidb -P 4000 -u root < dss.ddl
133
+
```
134
+
135
+
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`.
Spark context available as 'sc' (master = local[*], app id = local-1527045927617).
141
+
Spark session available as 'spark'.
142
+
Welcome to
143
+
____ __
144
+
/ __/__ ___ _____/ /__
145
+
_\ \/ _ \/ _ `/ __/ '_/
146
+
/___/ .__/\_,_/_/ /_/\_\ version 2.1.1
147
+
/_/
148
+
149
+
Using Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_172)
150
+
Type in expressions to have them evaluated.
151
+
Type :help for more information.
152
+
153
+
scala> import org.apache.spark.sql.TiContext
154
+
...
155
+
scala> val ti = new TiContext(spark)
156
+
...
157
+
scala> ti.tidbMapDatabase("TPCH_001")
158
+
...
159
+
scala> spark.sql("select count(*) from lineitem").show
160
+
+--------+
161
+
|count(1)|
162
+
+--------+
163
+
| 60175|
164
+
+--------+
165
+
```
166
+
167
+
Here is [a 5-minute tutorial](https://www.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.
Copy file name to clipboardExpand all lines: tikv/deploy-tikv-docker-compose.md
+23-11Lines changed: 23 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,56 +1,68 @@
1
1
---
2
2
title: Install and Deploy TiKV Using Docker Compose
3
-
category: user guide
3
+
summary: Quickly deploy a TiKV testing cluster using Docker Compose.
4
+
category: operations
4
5
---
5
6
6
7
# Install and Deploy TiKV Using Docker Compose
7
8
8
-
This guide describes how to quickly deploy a TiKV cluster using [Docker Compose](https://github.com/pingcap/tidb-docker-compose/). Currently, this installation method only supports the Linux system.
9
+
This guide describes how to quickly deploy a TiKV testing cluster using [Docker Compose](https://github.com/pingcap/tidb-docker-compose/).
10
+
11
+
> **Note:** Currently, this installation method only supports the Linux system.
9
12
10
13
## Prerequisites
11
14
12
-
- Install Docker and Docker Compose.
15
+
Make sure you have installed the following items on your machine:
0 commit comments