Skip to content

Commit 745169d

Browse files
3.0 use manual cluster bootstrap (#3981)
1 parent b02b66e commit 745169d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To run the cluster, go to the `sharding` directory in the terminal and perform t
99
1. Install dependencies defined in the `*.rockspec` file:
1010

1111
```console
12-
$ tt build
12+
$ tt build sharded_cluster
1313
```
1414

1515
2. Run the cluster:
@@ -23,16 +23,25 @@ To run the cluster, go to the `sharding` directory in the terminal and perform t
2323
```console
2424
$ tt connect sharded_cluster:router-a-001
2525
```
26+
27+
4. Perform the initial cluster bootstrap:
28+
29+
```console
30+
sharded_cluster:router-a-001> require('vshard').router.bootstrap()
31+
---
32+
- true
33+
...
34+
```
2635

27-
4. Insert test data:
36+
5. Insert test data:
2837

2938
```console
3039
sharded_cluster:router-a-001> insert_data()
3140
---
3241
...
3342
```
3443

35-
5. Connect to storages in different replica sets to see how data is distributed across nodes:
44+
6. Connect to storages in different replica sets to see how data is distributed across nodes:
3645

3746
a. `storage-a-001`:
3847

doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/router.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
local vshard = require('vshard')
22

3-
vshard.router.bootstrap()
4-
53
function put(id, band_name, year)
64
local bucket_id = vshard.router.bucket_id_mpcrc32({ id })
75
vshard.router.callrw(bucket_id, 'put', { id, bucket_id, band_name, year })

0 commit comments

Comments
 (0)