|
1 | 1 | # Sharded cluster
|
2 | 2 |
|
3 |
| -A sample application demonstrating how to configure a [sharded](https://www.tarantool.io/en/doc/latest/concepts/sharding/) cluster. |
| 3 | +A sample application created in the [Getting started with sharding](https://www.tarantool.io/en/doc/latest/how-to/vshard_quick/) tutorial. |
4 | 4 |
|
5 | 5 | ## Running
|
6 | 6 |
|
7 |
| -To run the cluster, go to the `sharding` directory in the terminal and perform the following steps: |
8 |
| - |
9 |
| -1. Install dependencies defined in the `*.rockspec` file: |
10 |
| - |
11 |
| - ```console |
12 |
| - $ tt build sharded_cluster |
13 |
| - ``` |
14 |
| - |
15 |
| -2. Run the cluster: |
16 |
| - |
17 |
| - ```console |
18 |
| - $ tt start sharded_cluster |
19 |
| - ``` |
20 |
| - |
21 |
| -3. Connect to the router: |
22 |
| - |
23 |
| - ```console |
24 |
| - $ tt connect sharded_cluster:router-a-001 |
25 |
| - ``` |
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 |
| - ``` |
35 |
| - |
36 |
| -5. Insert test data: |
37 |
| - |
38 |
| - ```console |
39 |
| - sharded_cluster:router-a-001> insert_data() |
40 |
| - --- |
41 |
| - ... |
42 |
| - ``` |
43 |
| - |
44 |
| -6. Connect to storages in different replica sets to see how data is distributed across nodes: |
45 |
| - |
46 |
| - a. `storage-a-001`: |
47 |
| - |
48 |
| - ```console |
49 |
| - sharded_cluster:storage-a-001> box.space.bands:select() |
50 |
| - --- |
51 |
| - - - [1, 614, 'Roxette', 1986] |
52 |
| - - [2, 986, 'Scorpions', 1965] |
53 |
| - - [5, 755, 'Pink Floyd', 1965] |
54 |
| - - [7, 998, 'The Doors', 1965] |
55 |
| - - [8, 762, 'Nirvana', 1987] |
56 |
| - ... |
57 |
| - ``` |
58 |
| - |
59 |
| - b. `storage-b-001`: |
60 |
| - |
61 |
| - ```console |
62 |
| - sharded_cluster:storage-b-001> box.space.bands:select() |
63 |
| - --- |
64 |
| - - - [3, 11, 'Ace of Base', 1987] |
65 |
| - - [4, 42, 'The Beatles', 1960] |
66 |
| - - [6, 55, 'The Rolling Stones', 1962] |
67 |
| - - [9, 299, 'Led Zeppelin', 1968] |
68 |
| - - [10, 167, 'Queen', 1970] |
69 |
| - ... |
70 |
| - ``` |
| 7 | +To learn how to run the cluster, see the [Working with a cluster](https://www.tarantool.io/en/doc/latest/how-to/vshard_quick/#working-with-the-cluster) section. |
71 | 8 |
|
72 | 9 |
|
73 | 10 | ## Packaging
|
|
0 commit comments