forked from pingcap/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: add TiKV overview, installation, and client driver (pingcap#472)
* *: add TiKV Quick Start Guide * tikv: update code display effect * tikv: update the ParseInt code * tikv: fix a step typo * tikv: update wording * tikv, readme: reorganize TiKV documents * tikv, readme: reorganize the structure and update content based on comments * tikv, readme: add Install TiKV Using Docker Compose * tikv: add two links to API usage * tikv, readme: update file name and readme * tikv: update wording * tikv: update two links
- Loading branch information
Showing
6 changed files
with
568 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
title: Install and Deploy TiKV Using Docker Compose | ||
category: user guide | ||
--- | ||
|
||
# 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. | ||
|
||
## Prerequisites | ||
|
||
- Install Docker and Docker Compose. | ||
|
||
``` | ||
sudo yum install docker docker-compose | ||
``` | ||
- Install Helm. | ||
``` | ||
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash | ||
``` | ||
## Install and deploy | ||
1. Download `tidb-docker-compose`. | ||
``` | ||
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. | ||
``` | ||
cd tidb-docker-compose/compose | ||
networkMode: host | ||
``` | ||
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 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", you have successfully deployed a TiKV cluster. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
--- | ||
title: Install and Deploy TiKV Using Binary Files | ||
category: user guide | ||
--- | ||
|
||
# Install and Deploy TiKV Using Binary Files | ||
|
||
This guide describes how to deploy a TiKV cluster using binary files. | ||
|
||
- To quickly understand and try TiKV, see [Deploy the TiKV cluster on a single machine](#deploy-the-tikv-cluster-on-a-single-machine). | ||
- To try TiKV out and explore the features, see [Deploy the TiKV cluster on multiple nodes for test](#deploy-the-tikv-cluster-on-multiple-nodes-for-test). | ||
|
||
## Deploy the TiKV cluster on a single machine | ||
|
||
This section describes how to deploy TiKV on a single machine installed with the Linux system. Take the following steps: | ||
|
||
1. Download the official binary package. | ||
|
||
```bash | ||
# Download the package. | ||
wget https://download.pingcap.org/tidb-latest-linux-amd64.tar.gz | ||
wget http://download.pingcap.org/tidb-latest-linux-amd64.sha256 | ||
|
||
# Check the file integrity. If the result is OK, the file is correct. | ||
sha256sum -c tidb-latest-linux-amd64.sha256 | ||
|
||
# Extract the package. | ||
tar -xzf tidb-latest-linux-amd64.tar.gz | ||
cd tidb-latest-linux-amd64 | ||
``` | ||
|
||
2. Start PD. | ||
|
||
```bash | ||
./bin/pd-server --name=pd1 \ | ||
--data-dir=pd1 \ | ||
--client-urls="http://127.0.0.1:2379" \ | ||
--peer-urls="http://127.0.0.1:2380" \ | ||
--initial-cluster="pd1=http://127.0.0.1:2380" \ | ||
--log-file=pd1.log | ||
``` | ||
|
||
3. Start TiKV. | ||
|
||
To start the 3 TiKV instances, open a new terminal tab or window, come to the `tidb-latest-linux-amd64` directory, and start the instances using the following command: | ||
|
||
```bash | ||
./bin/tikv-server --pd-endpoints="127.0.0.1:2379" \ | ||
--addr="127.0.0.1:20160" \ | ||
--data-dir=tikv1 \ | ||
--log-file=tikv1.log | ||
./bin/tikv-server --pd-endpoints="127.0.0.1:2379" \ | ||
--addr="127.0.0.1:20161" \ | ||
--data-dir=tikv2 \ | ||
--log-file=tikv2.log | ||
./bin/tikv-server --pd-endpoints="127.0.0.1:2379" \ | ||
--addr="127.0.0.1:20162" \ | ||
--data-dir=tikv3 \ | ||
--log-file=tikv3.log | ||
``` | ||
|
||
You can use the [pd-ctl](https://github.com/pingcap/pd/tree/master/pdctl) tool to verify whether PD and TiKV are successfully deployed: | ||
|
||
``` | ||
./bin/pd-ctl store -d -u http://127.0.0.1:2379 | ||
``` | ||
If the state of all the TiKV instances is "Up", you have successfully deployed a TiKV cluster. | ||
## Deploy the TiKV cluster on multiple nodes for test | ||
This section describes how to deploy TiKV on multiple nodes. If you want to test TiKV with a limited number of nodes, you can use one PD instance to test the entire cluster. | ||
Assume that you have four nodes, you can deploy 1 PD instance and 3 TiKV instances. For details, see the following table: | ||
| Name | Host IP | Services | | ||
| :-- | :-- | :------------------- | | ||
| Node1 | 192.168.199.113 | PD1 | | ||
| Node2 | 192.168.199.114 | TiKV1 | | ||
| Node3 | 192.168.199.115 | TiKV2 | | ||
| Node4 | 192.168.199.116 | TiKV3 | | ||
To deploy a TiKV cluster with multiple nodes for test, take the following steps: | ||
1. Download the official binary package on each node. | ||
```bash | ||
# Download the package. | ||
wget https://download.pingcap.org/tidb-latest-linux-amd64.tar.gz | ||
wget http://download.pingcap.org/tidb-latest-linux-amd64.sha256 | ||
# Check the file integrity. If the result is OK, the file is correct. | ||
sha256sum -c tidb-latest-linux-amd64.sha256 | ||
# Extract the package. | ||
tar -xzf tidb-latest-linux-amd64.tar.gz | ||
cd tidb-latest-linux-amd64 | ||
``` | ||
2. Start PD on Node1. | ||
```bash | ||
./bin/pd-server --name=pd1 \ | ||
--data-dir=pd1 \ | ||
--client-urls="http://192.168.199.113:2379" \ | ||
--peer-urls="http://192.168.199.113:2380" \ | ||
--initial-cluster="pd1=http://192.168.199.113:2380" \ | ||
--log-file=pd1.log | ||
``` | ||
3. Log in and start TiKV on other nodes: Node2, Node3 and Node4. | ||
Node2: | ||
```bash | ||
./bin/tikv-server --pd-endpoints="192.168.199.113:2379" \ | ||
--addr="192.168.199.114:20160" \ | ||
--data-dir=tikv1 \ | ||
--log-file=tikv1.log | ||
``` | ||
Node3: | ||
```bash | ||
./bin/tikv-server --pd-endpoints="192.168.199.113:2379" \ | ||
--addr="192.168.199.115:20160" \ | ||
--data-dir=tikv2 \ | ||
--log-file=tikv2.log | ||
``` | ||
Node4: | ||
```bash | ||
./bin/tikv-server --pd-endpoints="192.168.199.113:2379" \ | ||
--addr="192.168.199.116:20160" \ | ||
--data-dir=tikv3 \ | ||
--log-file=tikv3.log | ||
``` | ||
You can use the [pd-ctl](https://github.com/pingcap/pd/tree/master/pdctl) tool to verify whether PD and TiKV are successfully deployed: | ||
``` | ||
./pd-ctl store -d -u http://192.168.199.113:2379 | ||
``` | ||
The result displays the store count and detailed information regarding each store. If the state of all the TiKV instances is "Up", you have successfully deployed a TiKV cluster. |
Oops, something went wrong.