Skip to content

Commit aa294d2

Browse files
tisonkungregwebsti-chi-bot
authored
*: rephrase quickstart section of README (tikv#9954)
* *: rephrase quickstart section of README Signed-off-by: tison <[email protected]> * link to TiUP document instead of inline it Signed-off-by: tison <[email protected]> * Update README.md Co-authored-by: Greg Weber <[email protected]> Signed-off-by: tison <[email protected]> Co-authored-by: Greg Weber <[email protected]> Co-authored-by: Ti Chi Robot <[email protected]>
1 parent 0b46e60 commit aa294d2

File tree

2 files changed

+91
-14
lines changed

2 files changed

+91
-14
lines changed

README.md

+51-14
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,67 @@ You can see the [TiKV Roadmap](docs/ROADMAP.md).
7373

7474
When a node starts, the metadata of the Node, Store and Region are recorded into PD. The status of each Region and Store is reported to PD regularly.
7575

76-
## Try TiKV
76+
## Quick start
7777

78-
TiKV was originally a component of [TiDB](https://github.com/pingcap/tidb). To run TiKV you must build and run it with PD, which is used to manage a TiKV cluster. You can use TiKV together with TiDB or separately on its own.
78+
### Deploy a playground with TiUP
7979

80-
We provide multiple deployment methods, but it is recommended to use our Ansible deployment for production environment. The TiKV documentation is available on [TiKV's website](https://tikv.org/docs/4.0/concepts/overview/).
80+
The most quickest to try out TiKV with TiDB is using TiUP, a component manager for TiDB.
8181

82-
### Testing deployment
82+
You can see [this page](https://docs.pingcap.com/tidb/stable/quick-start-with-tidb#deploy-a-local-test-environment-using-tiup-playground) for a step by step tutorial.
8383

84-
- [Try TiKV and TiDB](https://tikv.org/docs/4.0/tasks/try/introduction/)
84+
### Deploy a playground with binary
8585

86-
You can use [`tidb-docker-compose`](https://github.com/pingcap/tidb-docker-compose/) to quickly test TiKV and TiDB on a single machine. This is the easiest way. For other ways, see [TiDB documentation](https://docs.pingcap.com/).
86+
TiKV is able to run separatedly with PD, which is the minimal deployment required.
8787

88-
- Try TiKV separately
88+
1. Download and extract binaries.
8989

90-
- [Deploy TiKV Using Docker Stack](https://tikv.org/docs/4.0/tasks/try/docker-stack/): To quickly test TiKV separately without TiDB on a single machine
91-
- [Deploy TiKV Using Docker](https://tikv.org/docs/4.0/tasks/deploy/docker/): To deploy a multi-node TiKV testing cluster using Docker
92-
- [Deploy TiKV Using Binary Files](https://tikv.org/docs/4.0/tasks/deploy/binary/): To deploy a TiKV cluster using binary files on a single node or on multiple nodes
90+
```bash
91+
$ export TIKV_VERSION=v4.0.12
92+
$ export GOOS=darwin # only {darwin, linux} are supported
93+
$ export GOARCH=amd64 # only {amd64, arm64} are supported
94+
$ curl -O https://tiup-mirrors.pingcap.com/tikv-$TIKV_VERSION-$GOOS-$GOARCH.tar.gz
95+
$ curl -O https://tiup-mirrors.pingcap.com/pd-$TIKV_VERSION-$GOOS-$GOARCH.tar.gz
96+
$ tar -xzf tikv-$TIKV_VERSION-$GOOS-$GOARCH.tar.gz
97+
$ tar -xzf pd-$TIKV_VERSION-$GOOS-$GOARCH.tar.gz
98+
```
9399

94-
### Production deployment
100+
2. Start PD instance.
95101

96-
For the production environment, use [TiDB Ansible](https://github.com/pingcap/tidb-ansible) to deploy the cluster.
102+
```bash
103+
$ ./pd-server --name=pd --data-dir=/tmp/pd/data --client-urls="http://127.0.0.1:2379" --peer-urls="http://127.0.0.1:2380" --initial-cluster="pd=http://127.0.0.1:2380" --log-file=/tmp/pd/log/pd.log
104+
```
97105

98-
- [Deploy TiDB Using Ansible](https://docs.pingcap.com/tidb/stable/online-deployment-using-ansible)
99-
- [Deploy TiKV separately Using Ansible](https://tikv.org/docs/4.0/tasks/deploy/ansible/)
106+
3. Start TiKV instance.
107+
108+
```bash
109+
$ ./tikv-server --pd-endpoints="127.0.0.1:2379" --addr="127.0.0.1:20160" --data-dir=/tmp/tikv/data --log-file=/tmp/tikv/log/tikv.log
110+
```
111+
112+
4. Install TiKV Client(Python) and verify the deployment, required Python 3.5+.
113+
114+
```bash
115+
$ pip3 install -i https://test.pypi.org/simple/ tikv-client
116+
```
117+
118+
```python
119+
from tikv_client import RawClient
120+
121+
client = RawClient.connect("127.0.0.1:2379")
122+
123+
client.put(b'foo', b'bar')
124+
print(client.get(b'foo')) # b'bar'
125+
126+
client.put(b'foo', b'baz')
127+
print(client.get(b'foo')) # b'baz'
128+
```
129+
130+
### Deploy a cluster with TiUP
131+
132+
You can see [this manual](./doc/deploy.md) of production-like cluster deployment presented by @c4pt0r.
133+
134+
### Build from source
135+
136+
See [CONTRIBUTING.md](./CONTRIBUTING.md).
100137

101138
## Client drivers
102139

doc/deploy.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Deploy a TiKV production cluster
2+
3+
### Deploy a cluster with TiUP
4+
5+
We provide multiple deployment methods, but it is recommended to use our TiUP deployment for production environment.
6+
7+
1. Ensure SSH connectivity between tiup's machine and several target nodes
8+
2. topo.yaml:
9+
10+
```yaml
11+
global:
12+
user: "ubuntu"
13+
ssh_port: 22
14+
deploy_dir: "whatever"
15+
data_dir: "whatever"
16+
17+
pd_servers:
18+
- host: x.x.x.x
19+
- host: y.y.y.y
20+
- host: z.z.z.z
21+
22+
tikv_servers:
23+
- host: x.x.x.x
24+
- host: y.y.y.y
25+
- host: z.z.z.z
26+
27+
monitoring_servers:
28+
- host: a.a.a.a
29+
30+
grafana_servers:
31+
- host: b.b.b.b
32+
33+
alertmanager_servers:
34+
- host: c.c.c.c
35+
```
36+
37+
3. `$ tiup cluster deploy foobar v4.0.0 ./topo.yaml --user ubuntu -i ~/.ssh/id_rsa`
38+
4. `$ tiup cluster start foobar`
39+
5. You're all set!
40+

0 commit comments

Comments
 (0)