Skip to content

ProsonulHaque/tikv-go-client-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TiKV Go-client-example

This is a demo project which demonstrates the use of TiKV database.

Understand the storage layer of a TiKV cluster

TiKV Github

TiKV Go-Client

Install Locally

TiKV in 5 Minutes

Docker Commands

Use Docker to deploy a TiKV cluster on multiple nodes

Step 1: Pull the latest images of TiKV and PD from Docker Hub

Start Docker and pull the latest images of TiKV and PD from Docker Hub using the following command:

docker pull pingcap/tikv:latestdocker pull pingcap/pd:latest

Step 2: Start PD1 on Node1:

sudo docker run -d --name pd1 \
-p 2379:2379 \
-p 2380:2380 \
-v /etc/localtime:/etc/localtime:ro \
-v /data:/data \
pingcap/pd:latest \
--name="pd1" \
--data-dir="/data/pd1" \
--client-urls="http://0.0.0.0:2379" \
--advertise-client-urls="http://192.168.10.226:2379" \
--peer-urls="http://0.0.0.0:2380" \
--advertise-peer-urls="http://192.168.10.226:2380" \
--initial-cluster="pd1=http://192.168.10.226:2380"

Step 3: Start TiKV1 on Node2:

sudo docker run -d --name tikv1 \
-p 20160:20160 \
-v /etc/localtime:/etc/localtime:ro \
-v /data:/data \pingcap/tikv:latest \
--addr="0.0.0.0:20160" \
--advertise-addr="192.168.10.226:20160" \
--data-dir="/data/tikv1" \
--pd="192.168.10.226:2379"

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

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

*** Replace 192.168.10.226 with your IPv4 address.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published