Run TiKV using Ansible or Docker

We are currently refactoring our documentation. Please excuse any problems you may find and report them here.

Typical deployments of TiKV include a number of components:

  • 3+ TiKV nodes
  • 3+ Placement Driver (PD) nodes
  • 1 Monitoring node
  • 1 or more client application or query layer (like TiDB)
TiKV is deployed alongside a Placement Driver (PD) cluster. PD is the cluster manager of TiKV, which periodically checks replication constraints to balance load and data automatically.

Your first steps into TiKV require only the following:

After you set up the environment, follow through the docker-compose guide to get a test setup of TiKV running on your machine.

Production usage is typically done via automation requiring:

If you have your production environment ready, follow through the Ansible deployment guide. You may optionally choose unsupported manual Docker deployment or binary deployment strategies.

Finally, if you want to build your own binary TiKV you should consult the README of the repository.

System requirements

The minimum specifications for testing or developing TiKV or PD are:

  • 2+ core
  • 8+ GB RAM
  • An SSD

TiKV hosts must support the x86-64 architecture and the SSE 4.2 instruction set.

TiKV works well in VMWare, KVM, and Xen virtual machines.

Production Specifications

The suggested PD specifications for production are:

  • 3+ nodes
  • 4+ cores
  • 8+ GB RAM
  • 200+ GB SSD
  • 10 Gigabit ethernet (2x preferred)

The suggested TiKV specifications for production are:

  • 3+ nodes
  • 16+ cores
  • 32+ GB RAM
  • a less than 1.5 TB SSD

Network requirements

TiKV requires the following network port configuration to run. Based on the TiKV deployment in actual environments, the administrator can open relevant ports in the network side and host side.

ComponentDefault PortDescription
TiKV20160the TiKV communication port
PD2380the inter-node communication port within the PD cluster
Pump8250the Pump communication port
Drainer8249the Drainer communication port
Prometheus9090the communication port for the Prometheus service
Pushgateway9091the aggregation and report port for TiKV, and PD monitor
Node_exporter9100the communication port to report the system information of each TiKV cluster node
Blackbox_exporter9115the Blackbox_exporter communication port, used to monitor the ports in the TiKV cluster
Grafana3000the port for the external Web monitoring service and client (Browser) access
Grafana8686the grafana_collector communication port, used to export the Dashboard as the PDF format
Kafka_exporter9308the Kafka_exporter communication port, used to monitor the binlog Kafka cluster

Web browser requirements

Based on the Prometheus and Grafana platform, TiKV provides a visual data monitoring solution to monitor the TiKV cluster status. To access the Grafana monitor interface, it is recommended to use a higher version of Microsoft IE, Google Chrome or Mozilla Firefox.