Skip to content

Commit 7916533

Browse files
authored
Add new tt commands: tt rs expel, tt rs vshard bootstrap, tt cluster publish with new instance (#4330)
Resolves #4142 #4261, #4241
1 parent 265ebaa commit 7916533

File tree

2 files changed

+129
-9
lines changed

2 files changed

+129
-9
lines changed

doc/reference/tooling/tt_cli/cluster.rst

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ Publishing configurations of specific instances
7474
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7575

7676
In addition to whole cluster configurations, ``tt cluster publish`` can manage
77-
configurations of specific instances within applications. In this case, it operates
78-
with YAML fragments that describe a single :ref:`instance configuration section <configuration_overview>`.
77+
configurations of specific instances within applications: rewrite configurations
78+
of existing instances and add new instance configurations.
79+
80+
In this case, it operates with YAML fragments that describe a single :ref:`instance configuration section <configuration_overview>`.
7981
For example, the following YAML file can be a source when publishing an instance configuration:
8082

8183
.. code-block:: yaml
@@ -99,6 +101,23 @@ the instance name in the ``name`` argument of the storage URI:
99101
100102
$ tt cluster publish "http://localhost:2379/myapp?name=instance-002" instance_source.yaml
101103
104+
If the instance already exists, this call overwrites its configuration with the one
105+
from the file.
106+
107+
To add a new instance configuration from a YAML fragment, specify the name to assign to
108+
the new instance and its location in the cluster topology -- replica set and group --
109+
in the ``--replicaset`` and ``--group`` options.
110+
111+
.. note::
112+
113+
The ``--group`` option can be omitted if the configuration contains only one group.
114+
115+
To add a new instance ``instance-003`` to the ``replicaset-001`` replica set:
116+
117+
.. code-block:: console
118+
119+
tt cluster publish "http://localhost:2379/myapp?name=instance-003" instance_source.yaml --replicaset replicaset-001
120+
102121
103122
.. _tt-cluster-publish-validation:
104123

@@ -450,6 +469,18 @@ Options
450469

451470
Skip validation when publishing. Default: `false` (validation is enabled).
452471

472+
.. option:: --group
473+
474+
**Applicable to:** ``publish``
475+
476+
A name of the configuration group to which the instance belongs.
477+
478+
.. option:: --replicaset
479+
480+
**Applicable to:** ``publish``
481+
482+
A name of the replica set to which the instance belongs.
483+
453484
.. option:: -t, --timeout UINT
454485

455486
**Applicable to:** ``failover``

doc/reference/tooling/tt_cli/replicaset.rst

Lines changed: 96 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Managing replica sets
1616
* :ref:`status <tt-replicaset-status>`
1717
* :ref:`promote <tt-replicaset-promote>`
1818
* :ref:`demote <tt-replicaset-demote>`
19+
* :ref:`expel <tt-replicaset-expel>`
20+
* :ref:`vshard <tt-replicaset-vshard>`
1921

2022

2123
.. _tt-replicaset-status:
@@ -219,6 +221,90 @@ The ``--timeout`` option can be used to specify the election completion timeout:
219221
220222
$ tt replicaset demote my-app:storage-001-a --timeout=10
221223
224+
.. _tt-replicaset-expel:
225+
226+
expel
227+
-----
228+
229+
.. code-block:: console
230+
231+
$ tt replicaset expel APPLICATION:APP_INSTANCE [OPTIONS ...]
232+
# or
233+
$ tt rs expel APPLICATION[:APP_INSTANCE] [OPTIONS ...]
234+
235+
``tt replicaset expel`` (``tt rs expel``) expels an instance from the cluster.
236+
237+
.. code-block:: console
238+
239+
$ tt replicaset expel myapp:storage-001-b
240+
241+
The command supports the ``--config``, ``--cartridge``, and ``--custom`` :ref:`options <tt-replicaset-options>`
242+
that force the use of a specific orchestrator.
243+
244+
To expel an instance from a Cartridge cluster:
245+
246+
.. code-block:: console
247+
248+
$ tt replicaset expel my-cartridge-app:storage-001-b --cartridge
249+
250+
251+
.. _tt-replicaset-vshard:
252+
253+
vshard
254+
-----
255+
256+
.. code-block:: console
257+
258+
$ tt replicaset vshard COMMAND {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...]
259+
# or
260+
$ tt rs vshard COMMAND {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...]
261+
# or
262+
$ tt rs vs COMMAND {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...]
263+
264+
``tt replicaset vshard`` (``tt rs vs``) manages :ref:`vshard <vshard>` in the cluster.
265+
266+
It has the following subcommands:
267+
268+
- :ref:`bootstrap <tt-replicaset-vshard-bootstrap>`
269+
270+
.. _tt-replicaset-vshard-bootstrap:
271+
272+
vshard bootstrap
273+
~~~~~~~~~~~~~~~~
274+
275+
.. code-block:: console
276+
277+
$ tt replicaset vshard bootstrap {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...]
278+
# or
279+
$ tt rs vshard bootstrap {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...]
280+
# or
281+
$ tt rs vs bootstrap {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...]
282+
283+
``tt replicaset vshard bootstrap`` (``tt rs vs bootstrap``) bootstraps ``vshard``
284+
in the cluster.
285+
286+
.. code-block:: console
287+
288+
$ tt replicaset vshard bootstrap myapp
289+
290+
With a URI and credentials:
291+
292+
.. code-block:: console
293+
294+
$ tt replicaset vshard bootstrap 192.168.10.10:3301 -u myuser -p p4$$w0rD
295+
296+
You can specify the application name or the name of any cluster instance. The command
297+
automatically finds a ``vshard`` router in the cluster and calls :ref:`vshard.router.bootstrap() <router_api-bootstrap>` on it.
298+
299+
The command supports the ``--config``, ``--cartridge``, and ``--custom`` :ref:`options <tt-replicaset-options>`
300+
that force the use of a specific orchestrator.
301+
302+
To bootstrap ``vshard`` in a Cartridge cluster:
303+
304+
.. code-block:: console
305+
306+
$ tt replicaset vshard bootstrap my-cartridge-app --cartridge
307+
222308
.. _tt-replicaset-orchestrator:
223309

224310
Selecting the application orchestrator manually
@@ -292,30 +378,33 @@ Options
292378

293379
.. option:: -u USERNAME, --username USERNAME
294380

295-
A Tarantool user for connecting to the instance.
381+
A Tarantool user for connecting to the instance using a URI.
296382

297383
.. option:: -p PASSWORD, --password PASSWORD
298384

299385
The user's password.
300386

301387
.. option:: --sslcertfile FILEPATH
302388

303-
The path to an SSL certificate file for encrypted connections.
389+
The path to an SSL certificate file for encrypted connections for the URI case.
304390

305391
.. option:: --sslkeyfile FILEPATH
306392

307-
The path to a private SSL key file for encrypted connections.
393+
The path to a private SSL key file for encrypted connections for the URI case.
308394

309395
.. option:: --sslcafile FILEPATH
310396

311-
The path to a trusted certificate authorities (CA) file for encrypted connections.
397+
The path to a trusted certificate authorities (CA) file for encrypted connections for the URI case.
312398

313399
.. option:: --sslciphers STRING
314400

315-
The list of SSL cipher suites used for encrypted connections, separated by colons (``:``).
401+
The list of SSL cipher suites used for encrypted connections for the URI case, separated by colons (``:``).
316402

317403
.. option:: --timeout
318404

319-
**Applicable to:** ``promote``, ``demote``
405+
**Applicable to:** ``promote``, ``demote``, ``expel``, ``vshard``
406+
407+
The timeout for completing the operation, in seconds. Default:
320408

321-
The timeout for completing the promotion or demotion, in seconds. Default: ``3``.
409+
- ``3`` for ``promote``, ``demote``, ``expel``
410+
- ``10`` for ``vshard``

0 commit comments

Comments
 (0)