Skip to content

Commit cbffe4b

Browse files
committed
Add tt rs bootstrap and rebootstrap (#4482)
Resolves: #4376, #4362
1 parent f647e58 commit cbffe4b

File tree

1 file changed

+121
-6
lines changed

1 file changed

+121
-6
lines changed

doc/tooling/tt_cli/replicaset.rst

Lines changed: 121 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Managing replica sets
1818
* :ref:`demote <tt-replicaset-demote>`
1919
* :ref:`expel <tt-replicaset-expel>`
2020
* :ref:`vshard <tt-replicaset-vshard>`
21-
21+
* :ref:`bootstrap <tt-replicaset-bootstrap>`
22+
* :ref:`rebootstrap <tt-replicaset-rebootstrap>`
2223

2324
.. _tt-replicaset-status:
2425

@@ -29,11 +30,10 @@ status
2930
3031
$ tt replicaset status {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...]
3132
# or
32-
$ tt rs status {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...]
33+
$ tt rs status {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...]
3334
3435
``tt replicaset status`` (``tt rs status``) shows the current status of a replica set.
3536

36-
3737
.. _tt-replicaset-status-application:
3838

3939
Displaying status of all replica sets
@@ -66,7 +66,6 @@ For a replica outside the current ``tt`` environment, specify its URI and access
6666
6767
Learn about other ways to provide user credentials in :ref:`tt-replicaset-authentication`.
6868

69-
7069
.. _tt-replicaset-promote:
7170

7271
promote
@@ -305,6 +304,93 @@ To bootstrap ``vshard`` in a Cartridge cluster:
305304
306305
$ tt replicaset vshard bootstrap my-cartridge-app --cartridge
307306
307+
.. _tt-replicaset-bootstrap:
308+
309+
bootstrap
310+
---------
311+
312+
.. include:: _includes/cartridge_deprecation_note.rst
313+
314+
.. code-block:: console
315+
316+
$ tt replicaset bootstrap APPLICATION[:APP_INSTANCE] [OPTIONS ...]
317+
# or
318+
$ tt rs bootstrap APPLICATION[:APP_INSTANCE] [OPTIONS ...]
319+
320+
``tt replicaset bootstrap`` (``tt rs bootstrap``) bootstraps a Cartridge cluster or
321+
an instance. The command works within the current ``tt`` environment and uses
322+
application and instance names.
323+
324+
.. note::
325+
326+
``tt replicasets bootstrap`` effectively duplicates two other commands:
327+
328+
- When called with an application name: :ref:`tt cartridge replicasets setup <tt_cartridge_replicasets_setup>`
329+
- When called with an instance name: :ref:`tt cartridge replicasets join <tt_cartridge_replicasets_join>`
330+
331+
.. _tt-replicaset-bootstrap-cluster:
332+
333+
Bootstrapping a Cartridge cluster
334+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
335+
336+
To bootstrap the ``cartridge_app`` application using its default replica sets file
337+
``replicasets.yml``:
338+
339+
.. code-block:: console
340+
341+
$ tt replicaset bootstrap cartridge_app
342+
343+
To use another file with replica set configuration, provide a path to it in the ``--file`` option:
344+
345+
.. code-block:: console
346+
347+
$ tt replicaset bootstrap cartridge_app --file replicasets1.yml
348+
349+
To additionally bootstrap vshard after the cluster bootstrap, add ``--bootstrap-vshard``:
350+
351+
.. code-block:: console
352+
353+
$ tt replicaset bootstrap --bootstrap-vshard cartridge_app
354+
355+
356+
.. _tt-replicaset-bootstrap-instance:
357+
358+
Bootstrapping an instance
359+
~~~~~~~~~~~~~~~~~~~~~~~~~
360+
361+
When called with the instance name, ``tt replicaset bootstrap`` joins the
362+
instance to the replica set specified in the ``--replicaset`` option:
363+
364+
.. code-block:: console
365+
366+
$ tt replicaset bootstrap --replicaset replicaset cartridge_app:instance1
367+
368+
.. _tt-replicaset-rebootstrap:
369+
370+
rebootstrap
371+
-----------
372+
373+
.. code-block:: console
374+
375+
$ tt replicaset rebootstrap APPLICATION:APP_INSTANCE [-y | --yes]
376+
# or
377+
$ tt rs rebootstrap APPLICATION:APP_INSTANCE [-y | --yes]
378+
379+
``tt replicaset rebootstrap`` (``tt rs rebootstrap``) rebootstraps an instance:
380+
stops it, removes instance artifacts, starts it again.
381+
382+
To rebootstrap the ``storage-001`` instance of the ``myapp`` application:
383+
384+
.. code-block:: console
385+
386+
$ tt replicaset rebootstrap myapp:storage-001
387+
388+
To automatically confirm reboostrap, add the ``-y``/``--yes`` option:
389+
390+
.. code-block:: console
391+
392+
$ tt replicaset rebootstrap myapp:storage-001 -y
393+
308394
.. _tt-replicaset-orchestrator:
309395

310396
Selecting the application orchestrator manually
@@ -358,6 +444,12 @@ connecting to the instance by its URI:
358444
Options
359445
-------
360446

447+
.. option:: --bootstrap-vshard
448+
449+
**Applicable to:** ``bootstrap``
450+
451+
Additionally bootstrap vshard when bootstrapping a Cartridge application.
452+
361453
.. option:: --cartridge
362454

363455
Force the Cartridge orchestrator for Tarantool 2.x clusters.
@@ -370,12 +462,29 @@ Options
370462

371463
Force a custom orchestrator for Tarantool 2.x clusters.
372464

465+
.. option:: --file FILE
466+
467+
**Applicable to:** ``bootstrap``
468+
469+
A file with Cartridge replica sets configuration. Default: ``instances.yml``
470+
in the application directory.
471+
472+
See also: :ref:`tt-replicaset-bootstrap-cluster`
473+
373474
.. option:: -f, --force
374475

375476
**Applicable to:** ``promote``, ``demote``
376477

377478
Skip promotion or demotion if the specified instance is not running in the same environment.
378479

480+
.. option:: --replicaset REPLICASET
481+
482+
**Applicable to:** ``bootstrap``
483+
484+
A replica set name for instance bootstrapping.
485+
486+
See also: :ref:`tt-replicaset-bootstrap-instance`
487+
379488
.. option:: -u USERNAME, --username USERNAME
380489

381490
A Tarantool user for connecting to the instance using a URI.
@@ -402,9 +511,15 @@ Options
402511

403512
.. option:: --timeout
404513

405-
**Applicable to:** ``promote``, ``demote``, ``expel``, ``vshard``
514+
**Applicable to:** ``promote``, ``demote``, ``expel``, ``vshard``, ``bootstrap``
406515

407516
The timeout for completing the operation, in seconds. Default:
408517

409518
- ``3`` for ``promote``, ``demote``, ``expel``
410-
- ``10`` for ``vshard``
519+
- ``10`` for ``vshard`` and ``bootstrap``
520+
521+
.. option:: -y, --yes
522+
523+
**Applicable to:** ``rebootstrap``
524+
525+
Automatically confirm rebootstrap.

0 commit comments

Comments
 (0)