Skip to content

Commit

Permalink
3.0 use manual cluster bootstrap (#3981)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyaksenov authored Dec 28, 2023
1 parent b02b66e commit 745169d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To run the cluster, go to the `sharding` directory in the terminal and perform t
1. Install dependencies defined in the `*.rockspec` file:

```console
$ tt build
$ tt build sharded_cluster
```

2. Run the cluster:
Expand All @@ -23,16 +23,25 @@ To run the cluster, go to the `sharding` directory in the terminal and perform t
```console
$ tt connect sharded_cluster:router-a-001
```

4. Perform the initial cluster bootstrap:

```console
sharded_cluster:router-a-001> require('vshard').router.bootstrap()
---
- true
...
```

4. Insert test data:
5. Insert test data:

```console
sharded_cluster:router-a-001> insert_data()
---
...
```

5. Connect to storages in different replica sets to see how data is distributed across nodes:
6. Connect to storages in different replica sets to see how data is distributed across nodes:

a. `storage-a-001`:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
local vshard = require('vshard')

vshard.router.bootstrap()

function put(id, band_name, year)
local bucket_id = vshard.router.bucket_id_mpcrc32({ id })
vshard.router.callrw(bucket_id, 'put', { id, bucket_id, band_name, year })
Expand Down

0 comments on commit 745169d

Please sign in to comment.