Skip to content

Commit

Permalink
op-guide, tikv: update docker compose deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
lilin90 committed Jun 12, 2018
1 parent 98a48fb commit 93e9a18
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
19 changes: 14 additions & 5 deletions op-guide/docker-compose.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
---
title: TiDB Docker Compose Deployment
summary: Deploy a TiDB testing cluster with a single command using Docker Compose.
category: operations
---

# TiDB Docker Compose Deployment

This document describes how to quickly deploy TiDB using [Docker Compose](https://docs.docker.com/compose/overview).
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.

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.
## Prerequisites

Make sure you have installed the following items on your machine:

- Docker (17.06.0 or later)
- Docker Compose
- Git

## Deploy TiDB using Docker Compose

Expand All @@ -22,7 +29,8 @@ You can use Docker Compose to deploy a TiDB test cluster with a single command.
2. Create and start the cluster.

```bash
cd tidb-docker-compose && docker-compose up -d
cd tidb-docker-compose && docker-compose pull # Get the latest Docker images
docker-compose up -d
```

3. Access the cluster.
Expand Down Expand Up @@ -59,7 +67,7 @@ To customize the cluster, you can edit the `docker-compose.yml` file directly. I

For macOS, you can also install Helm using the following command in Homebrew:

```
```bash
brew install kubernetes-helm
```

Expand All @@ -77,7 +85,7 @@ To customize the cluster, you can edit the `docker-compose.yml` file directly. I
vim values.yaml
```

Modify the configuration in `values.yaml`, such as the cluster size, TiDB image version, 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, leave `tidbVision` empty.

Expand All @@ -96,6 +104,7 @@ To customize the cluster, you can edit the `docker-compose.yml` file directly. I
5. Create and start the cluster using the generated `docker-compose.yml` file.

```bash
docker-compose -f generated-docker-compose.yaml pull # Get the latest Docker images
docker-compose -f generated-docker-compose.yml up -d
```

Expand Down
34 changes: 23 additions & 11 deletions tikv/deploy-tikv-docker-compose.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,68 @@
---
title: Install and Deploy TiKV Using Docker Compose
category: user guide
summary: Quickly deploy a TiKV testing cluster using Docker Compose.
category: operations
---

# Install and Deploy TiKV Using Docker Compose

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.
This guide describes how to quickly deploy a TiKV testing cluster using [Docker Compose](https://github.com/pingcap/tidb-docker-compose/).

> **Note:** Currently, this installation method only supports the Linux system.
## Prerequisites

- Install Docker and Docker Compose.
Make sure you have installed the following items on your machine:

```
- Docker (17.06.0 or later) and Docker Compose

```bash
sudo yum install docker docker-compose
```

- Install Helm.
- Helm

```
```bash
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
```

- Git

```
sudo yum install git
```

## Install and deploy

1. Download `tidb-docker-compose`.

```
```bash
git clone https://github.com/pingcap/tidb-docker-compose.git
```

2. Edit the `compose/values.yaml` file to configure `networkMode` to `host` and comment the TiDB section out.

```
```bash
cd tidb-docker-compose/compose
networkMode: host
```

3. Generate the `generated-docker-compose.yml` file.

```
```bash
helm template compose > generated-docker-compose.yml
```

4. Create and start the cluster using the `generated-docker-compose.yml` file.

```
```bash
docker-compose -f generated-docker-compose.yaml pull # Get the latest Docker images
docker-compose -f generated-docker-compose.yml up -d
```

You can check whether the TiKV cluster has been successfully deployed using the following command:

```
```bash
curl localhost:2379/pd/api/v1/stores
```

Expand Down

0 comments on commit 93e9a18

Please sign in to comment.