Skip to content

Commit 981f941

Browse files
committed
Sharded cluster: update per TW review
1 parent d4caf1d commit 981f941

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

doc/how-to/vshard_quick.rst

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ In this tutorial, the application layout is prepared manually:
4343

4444
1. Create a tt environment in the current directory by executing the :ref:`tt init <tt-init>` command.
4545

46-
2. Inside the ``instances.enabled`` directory of the created tt environment, create the ``sharded_cluster`` directory.
46+
2. Inside the empty ``instances.enabled`` directory of the created tt environment, create the ``sharded_cluster`` directory.
4747

4848
3. Inside ``instances.enabled/sharded_cluster``, create the following files:
4949

5050
- ``instances.yml`` specifies instances to run in the current environment.
51-
- The ``config.yaml`` file is intended to store the cluster's :ref:`configuration <configuration_overview>`.
52-
- ``storage.lua`` is intended to store code specific for :ref:`storages <vshard-architecture-storage>`.
53-
- ``router.lua`` is intended to store code specific for a :ref:`router <vshard-architecture-router>`.
54-
- ``sharded_cluster-scm-1.rockspec`` includes external dependencies required by the application.
51+
- ``config.yaml`` specifies the cluster's :ref:`configuration <configuration_overview>`.
52+
- ``storage.lua`` contains code specific for :ref:`storages <vshard-architecture-storage>`.
53+
- ``router.lua`` contains code specific for a :ref:`router <vshard-architecture-router>`.
54+
- ``sharded_cluster-scm-1.rockspec`` specifies external dependencies required by the application.
5555

56-
The next :ref:`vshard-quick-start-developing-app` section shows how to configure the cluster and write code specific for a router and storages.
56+
The next :ref:`vshard-quick-start-developing-app` section shows how to configure the cluster and write code for routing read and write requests to different storages.
5757

5858

5959
.. _vshard-quick-start-developing-app:
@@ -100,10 +100,12 @@ In this section, two users with the specified passwords are created:
100100
* The ``replicator`` user with the ``replication`` role.
101101
* The ``storage`` user with the ``sharding`` role.
102102

103+
These users are intended to maintain replication and sharding in the cluster.
104+
103105
.. WARNING::
104106

105-
It is recommended to load passwords from safe storage such as external files or environment variables.
106-
You can learn how to do this from :ref:`configuration_credentials_loading_secrets`.
107+
It is not recommended to store passwords as plain text in a YAML configuration.
108+
Learn how to load passwords from safe storage such as external files or environment variables from :ref:`configuration_credentials_loading_secrets`.
107109

108110

109111

@@ -132,7 +134,7 @@ In this section, the following options are configured:
132134
Step 3: Configuring bucket count
133135
********************************
134136

135-
Specify the total number of buckets in a sharded cluster using the ``sharding.bucket_count`` option:
137+
Specify the total number of :ref:`buckets <vshard-vbuckets>` in a sharded cluster using the ``sharding.bucket_count`` option:
136138

137139
.. literalinclude:: /code_snippets/snippets/sharding/instances.enabled/sharded_cluster/config.yaml
138140
:language: yaml
@@ -203,7 +205,7 @@ Here is a schematic view of the cluster's topology:
203205
Resulting configuration
204206
***********************
205207

206-
The resulting cluster configuration should look as follows:
208+
The resulting ``config.yaml`` file should look as follows:
207209

208210
.. literalinclude:: /code_snippets/snippets/sharding/instances.enabled/sharded_cluster/config.yaml
209211
:language: yaml
@@ -269,7 +271,7 @@ Adding router code
269271
:end-at: local vshard
270272
:dedent:
271273

272-
2. Define the ``put`` function used to write data to a storage:
274+
2. Define the ``put`` function that specifies how the router selects the storage to write data:
273275

274276
.. literalinclude:: /code_snippets/snippets/sharding/instances.enabled/sharded_cluster/router.lua
275277
:language: lua
@@ -327,7 +329,7 @@ To install dependencies, you need to :ref:`build the application <vshard-quick-s
327329
Building the application
328330
------------------------
329331

330-
In the terminal, open a directory where the :ref:`tt environment is created <vshard-quick-start-creating-app>`.
332+
In the terminal, open the :ref:`tt environment directory <vshard-quick-start-creating-app>`.
331333
Then, execute the ``tt build`` command:
332334

333335
.. code-block:: console
@@ -368,7 +370,7 @@ To start all instances in the cluster, execute the ``tt start`` command:
368370
Bootstrapping a cluster
369371
~~~~~~~~~~~~~~~~~~~~~~~
370372

371-
To bootstrap the cluster, follow the steps below:
373+
After starting instances, you need to bootstrap the cluster as follows:
372374

373375
1. Connect to the router instance using ``tt connect``:
374376

@@ -437,11 +439,19 @@ To check the cluster's status, execute :ref:`vshard.router.info() <router_api-in
437439
alerts: []
438440
...
439441
442+
The output includes the following sections:
443+
444+
* ``replicasets``: contains information about storages and their availability.
445+
* ``bucket``: displays the total number of read-write and read-only buckets that are currently available for this router.
446+
* ``status``: the number from 0 to 3 that indicates whether there are any issues with the cluster.
447+
0 means that there are no issues.
448+
* ``alerts``: might describe the exact issues related to bootstrapping a cluster, for example, connection issues, failover events, or unidentified buckets.
440449

441-
.. _vshard-quick-start-working-adding-selecting-data:
442450

443-
Adding and selecting data
444-
~~~~~~~~~~~~~~~~~~~~~~~~~
451+
.. _vshard-quick-start-working-writing-selecting-data:
452+
453+
Writing and selecting data
454+
~~~~~~~~~~~~~~~~~~~~~~~~~~
445455

446456
1. To insert sample data, call the :ref:`insert_data() <vshard-quick-start-router-code>` function on the router:
447457

0 commit comments

Comments
 (0)