From 69be85eb7ec66d99aed51ce6d68078deb47797e1 Mon Sep 17 00:00:00 2001 From: andreyaksenov Date: Thu, 28 Dec 2023 13:41:27 +0300 Subject: [PATCH] 3.0 use manual cluster bootstrap --- .../instances.enabled/sharded_cluster/README.md | 15 ++++++++++++--- .../instances.enabled/sharded_cluster/router.lua | 2 -- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/README.md b/doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/README.md index 6b2b73196b..cf65ab3619 100644 --- a/doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/README.md +++ b/doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/README.md @@ -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: @@ -23,8 +23,17 @@ 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() @@ -32,7 +41,7 @@ To run the cluster, go to the `sharding` directory in the terminal and perform t ... ``` -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`: diff --git a/doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/router.lua b/doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/router.lua index bc4e849af5..e2c3371909 100644 --- a/doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/router.lua +++ b/doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/router.lua @@ -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 })