Skip to content

Commit db4b1c8

Browse files
committed
Add tt cluster rs roles subcommand
1 parent 6167d93 commit db4b1c8

File tree

1 file changed

+68
-9
lines changed

1 file changed

+68
-9
lines changed

doc/tooling/tt_cli/cluster.rst

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ To add a new instance ``instance-003`` to the ``replicaset-001`` replica set:
116116

117117
.. code-block:: console
118118
119-
tt cluster publish "http://localhost:2379/myapp?name=instance-003" instance_source.yaml --replicaset replicaset-001
119+
$ tt cluster publish "http://localhost:2379/myapp?name=instance-003" instance_source.yaml --replicaset replicaset-001
120120
121121
122122
.. _tt-cluster-publish-validation:
@@ -265,12 +265,14 @@ subcommands:
265265

266266
- :ref:`promote <tt-cluster-replicaset-promote>`
267267
- :ref:`demote <tt-cluster-replicaset-demote>`
268+
- :ref:`expel <tt-cluster-replicaset-expel>`
269+
- :ref:`roles <tt-cluster-replicaset-roles>`
268270

269271
.. important::
270272

271273
``tt cluster replicaset`` works only with centralized cluster configurations.
272-
To manage replica set leaders in clusters with local YAML configurations,
273-
use :ref:`tt replicaset promote <tt-replicaset-demote>` and :ref:`tt replicaset demote <tt-replicaset-demote>`.
274+
To manage replica sets in clusters with local YAML configurations,
275+
use :ref:`tt replicaset <tt-replicaset>`.
274276

275277
.. _tt-cluster-replicaset-promote:
276278

@@ -332,6 +334,50 @@ to ``ro`` and reloads the configuration.
332334
If failover is ``off``, the command doesn't consider the modes of other
333335
replica set members, so there can be any number of read-write instances in one replica set.
334336

337+
.. _tt-cluster-replicaset-expel:
338+
339+
expel
340+
~~~~~
341+
342+
.. code-block:: console
343+
344+
$ tt cluster replicaset expel CONFIG_URI INSTANCE_NAME [OPTION ...]
345+
346+
``tt cluster replicaset expel`` expels an instance from the cluster. Example:
347+
348+
$ tt cluster replicaset expel "http://localhost:2379" storage-b-002
349+
350+
.. _tt-cluster-replicaset-roles:
351+
352+
roles
353+
~~~~~
354+
355+
.. code-block:: console
356+
357+
$ tt cluster replicaset roles [add|remove] CONFIG_URI ROLE_NAME [OPTION ...]
358+
359+
``tt cluster replicaset roles`` manages :ref:`application roles <application_roles>`
360+
in the configuration scope specified in the command options. It has two subcommands:
361+
362+
* ``add`` adds a role
363+
* ``remove`` removes a role
364+
365+
Use the ``--global``, ``--group``, ``--replicaset``, ``--instance`` options to select
366+
the configuration scope to add or remove the role. For example, to add a role to
367+
all instances in a replicaset:
368+
369+
.. code-block:: console
370+
371+
$ tt cluster replicaset roles add "http://localhost:2379" roles.my-role \
372+
--replicaset storage-a
373+
374+
To remove a role defined in the global configuration scope:
375+
376+
.. code-block:: console
377+
378+
$ tt cluster replicaset roles remove "http://localhost:2379" roles.my-role \
379+
--global
380+
335381
336382
.. _tt-cluster-failover:
337383

@@ -507,21 +553,34 @@ Options
507553

508554
.. option:: --force
509555

510-
**Applicable to:** ``publish``
556+
**Applicable to:** ``publish``, ``replicaset``
511557

512558
Skip validation when publishing. Default: `false` (validation is enabled).
559+
TODO: update for replicaset
560+
561+
.. option:: -G, --global
562+
563+
**Applicable to:** ``replicaset roles``
564+
565+
Apply the operation to the global configuration scope, that is, to all instances.
513566

514567
.. option:: --group
515568

516-
**Applicable to:** ``publish``
569+
**Applicable to:** ``publish``, ``replicaset roles``
570+
571+
A name of the configuration group to which the operation applies.
572+
573+
.. option:: --instance
574+
575+
**Applicable to:** ``replicaset roles``
517576

518-
A name of the configuration group to which the instance belongs.
577+
A name of the instance to which the operation applies.
519578

520579
.. option:: --replicaset
521580

522-
**Applicable to:** ``publish``
581+
**Applicable to:** ``publish``, ``replicaset roles``
523582

524-
A name of the replica set to which the instance belongs.
583+
A name of the replica set to which the operation applies.
525584

526585
.. option:: -t, --timeout UINT
527586

@@ -548,7 +607,7 @@ Options
548607

549608
This option is supported by the `Enterprise Edition <https://www.tarantool.io/compare/>`_ only.
550609

551-
**Applicable to:** ``publish``
610+
**Applicable to:** ``publish``, ``replicaset``
552611

553612
Generate hashes and signatures for integrity checks.
554613

0 commit comments

Comments
 (0)