Run TiKV in your local environment using Docker Compose

This guide describes how to quickly deploy a TiKV testing cluster using Docker Compose on a single machine. Currently, this installation method is supported only on Linux.


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

  • Docker (17.06.0 or later) and Docker Compose

    sudo yum install docker docker-compose
  • Helm

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

    sudo yum install git

Install and deploy

  1. Clone tidb-docker-compose

    git clone https://github.com/pingcap/tidb-docker-compose.git
    cd tidb-docker-compose
  2. Edit the compose/values.yaml file to configure the networkMode and host and comment the tidb section out.

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

    helm template compose > generated-docker-compose.yml
  4. Create and start the cluster using the generated-docker-compose.yml file

    docker-compose -f generated-docker-compose.yml 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:

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

If the state of all the TiKV instances is Up then you have successfully deployed a TiKV cluster!