tikv/

directory
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2022 License: Apache-2.0, Apache-2.0

README

tikv

Container solution for Tikv. Learn more about Tikv in official documentation.

Upstream

Build instruction for docker containers partially copied from: (https://github.com/tikv/tikv/blob/release-5.3/Dockerfile)

Disclaimer

This is not an official Google product.

About

This image contains an installation of Tikv.

For more information, see the Official Image Marketplace Page.

Prerequisites

Configure gcloud as a Docker credential helper:

gcloud auth configure-docker
Pull command
docker -- pull marketplace.gcr.io/google/tikv5

Dockerfile for this image can be found here

Table of Contents

Using Docker

Consult Marketplace container documentation for additional information about setting up your Docker environment.

Running Tikv

This section describes how to spin up an Tikv service using this image.

Running Tikv standalone

Use the following content for the docker-compose.yml file, then run docker-compose up.

---
version: '3'

services:
  pd:
    image: marketplace.gcr.io/google/tikv5
    ports:
      - 2379:2379
    command:
      - /pd-server
      - --name=pd
      - --client-urls=http://0.0.0.0:2379
      - --peer-urls=http://0.0.0.0:2380
      - --advertise-client-urls=http://pd:2379
      - --advertise-peer-urls=http://pd:2380
    restart: on-failure
  
  tikv:
    image: marketplace.gcr.io/google/tikv5
    ports:
      - 20160:20160
    command:
      - /tikv-server
      - --addr=0.0.0.0:20160
      - --advertise-addr=tikv:20160
      - --pd=pd:2379
    depends_on:
      - pd
    restart: on-failure
Running Tikv cluster

Use the following content for the docker-compose.yml file, then run docker-compose up.

---
version: '3'

services:
  pd0:
    image: marketplace.gcr.io/google/tikv5
    ports:
      - 2379:2379
    command:
      - /pd-server
      - --name=pd0
      - --client-urls=http://0.0.0.0:2379
      - --peer-urls=http://0.0.0.0:2380
      - --advertise-client-urls=http://pd0:2379
      - --advertise-peer-urls=http://pd0:2380
      - --initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380
    restart: on-failure

  pd1:
    image: marketplace.gcr.io/google/tikv5
    ports:
      - 2380:2379
    command:
      - /pd-server
      - --name=pd1
      - --client-urls=http://0.0.0.0:2379
      - --peer-urls=http://0.0.0.0:2380
      - --advertise-client-urls=http://pd1:2379
      - --advertise-peer-urls=http://pd1:2380
      - --initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380
    restart: on-failure
  
  pd2:
    image: marketplace.gcr.io/google/tikv5
    volumes:
      - data:/data
    ports:
      - 2381:2379
    command:
      - /pd-server
      - --name=pd2
      - --client-urls=http://0.0.0.0:2379
      - --peer-urls=http://0.0.0.0:2380
      - --advertise-client-urls=http://pd2:2379
      - --advertise-peer-urls=http://pd2:2380
      - --initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380
      - --data-dir=/data/pd2
    restart: on-failure
  

  tikv0:
    image: marketplace.gcr.io/google/tikv5
    ports:
      - 20160:20160
    command:
      - /tikv-server
      - --addr=0.0.0.0:20160
      - --advertise-addr=tikv0:20160
      - --pd=pd0:2379,pd1:2379,pd2:2379
    depends_on:
      - pd0
      - pd1
      - pd2
    restart: on-failure

  tikv1:
    image: marketplace.gcr.io/google/tikv5
    ports:
      - 20161:20160
    command:
      - /tikv-server
      - --addr=0.0.0.0:20160
      - --advertise-addr=tikv1:20160
      - --pd=pd0:2379,pd1:2379,pd2:2379
    depends_on:
      - pd0
      - pd1
      - pd2
    restart: on-failure

  tikv2:
    image: marketplace.gcr.io/google/tikv5
    ports:
      - 20162:20160
    command:
      - /tikv-server
      - --addr=0.0.0.0:20160
      - --advertise-addr=tikv2:20160
      - --pd=pd0:2379,pd1:2379,pd2:2379
    depends_on:
      - pd0
      - pd1
      - pd2
    restart: on-failure
Use a persistent data volume
---
version: '3'

services:
  pd0:
    image: marketplace.gcr.io/google/tikv5
    volumes:
      - data:/data
    ports:
      - 2379:2379
    command:
      - /pd-server
      - --name=pd0
      - --client-urls=http://0.0.0.0:2379
      - --peer-urls=http://0.0.0.0:2380
      - --advertise-client-urls=http://pd0:2379
      - --advertise-peer-urls=http://pd0:2380
      - --initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380
      - --data-dir=/data/pd0
    restart: on-failure

  pd1:
    image: marketplace.gcr.io/google/tikv5
    volumes:
      - data:/data
    ports:
      - 2380:2379
    command:
      - /pd-server
      - --name=pd1
      - --client-urls=http://0.0.0.0:2379
      - --peer-urls=http://0.0.0.0:2380
      - --advertise-client-urls=http://pd1:2379
      - --advertise-peer-urls=http://pd1:2380
      - --initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380
      - --data-dir=/data/pd1
    restart: on-failure
  
  pd2:
    image: marketplace.gcr.io/google/tikv5
    volumes:
      - data:/data
    ports:
      - 2381:2379
    command:
      - /pd-server
      - --name=pd2
      - --client-urls=http://0.0.0.0:2379
      - --peer-urls=http://0.0.0.0:2380
      - --advertise-client-urls=http://pd2:2379
      - --advertise-peer-urls=http://pd2:2380
      - --initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380
      - --data-dir=/data/pd2
    restart: on-failure
  

  tikv0:
    image: marketplace.gcr.io/google/tikv5
    volumes:
      - data:/data
    ports:
      - 20160:20160
    command:
      - /tikv-server
      - --addr=0.0.0.0:20160
      - --advertise-addr=tikv0:20160
      - --data-dir=/data/tikv0
      - --pd=pd0:2379,pd1:2379,pd2:2379
    depends_on:
      - pd0
      - pd1
      - pd2
    restart: on-failure

  tikv1:
    image: marketplace.gcr.io/google/tikv5
    volumes:
      - data:/data
    ports:
      - 20161:20160
    command:
      - /tikv-server
      - --addr=0.0.0.0:20160
      - --advertise-addr=tikv1:20160
      - --data-dir=/data/tikv1
      - --pd=pd0:2379,pd1:2379,pd2:2379
    depends_on:
      - pd0
      - pd1
      - pd2
    restart: on-failure

  tikv2:
    image: marketplace.gcr.io/google/tikv5
    volumes:
      - data:/data
    ports:
      - 20162:20160
    command:
      - /tikv-server
      - --addr=0.0.0.0:20160
      - --advertise-addr=tikv2:20160
      - --data-dir=/data/tikv2
      - --pd=pd0:2379,pd1:2379,pd2:2379
    depends_on:
      - pd0
      - pd1
      - pd2
    restart: on-failure

volumes:
  data:

References

Ports

These are the ports exposed by the container image.

Port Description
TCP 2379 PD client port
TCP 2380 PD peer port
TCP 20160 Tikv client port
TCp 20180 Tikv status port

Environment Variables

Tikv doesn't support any ENVs, instead you should use command line parameters. You can see full list of acceptable parameters on the official Tikv docs.

Volumes

These are the filesystem paths used by the container image.

Path Description
/tmp/tikv/store Default data dir, can be changed by --data-dir
"" Log path can be set by --log-file. Otherwise, logs are written to stderr

Directories

Path Synopsis
5
templates

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL