Skip to content

3.0 use manual cluster bootstrap #3981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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