@@ -20,6 +20,7 @@ Managing replica sets
2020* :ref: `vshard <tt-replicaset-vshard >`
2121* :ref: `bootstrap <tt-replicaset-bootstrap >`
2222* :ref: `rebootstrap <tt-replicaset-rebootstrap >`
23+ * :ref: `roles <tt-replicaset-roles >`
2324
2425.. _tt-replicaset-status :
2526
@@ -391,6 +392,98 @@ To automatically confirm reboostrap, add the ``-y``/``--yes`` option:
391392
392393 $ tt replicaset rebootstrap myapp:storage-001 -y
393394
395+ .. _tt-replicaset-roles :
396+
397+ roles
398+ -----
399+
400+ .. code-block :: console
401+
402+ $ tt replicaset roles [add|remove] APPLICATION[:APP_INSTANCE] ROLE_NAME [OPTIONS ...]
403+ # or
404+ $ tt rs roles [add|remove] APPLICATION[:APP_INSTANCE] ROLE_NAME [OPTIONS ...]
405+
406+ ``tt replicaset roles `` (``tt rs roles ``) manages :ref: `application roles <application_roles >`
407+ in the cluster.
408+ This command works on Tarantool clusters with a local YAML
409+ configuration and Cartridge clusters. It has two subcommands:
410+
411+ * ``add `` adds a role
412+ * ``remove `` removes a role
413+
414+ .. note ::
415+
416+ To manage roles in a Tarantool cluster with a :ref: `centralized configuration <configuration_etcd >`,
417+ use :ref: `tt cluster replicaset roles <tt-cluster-replicaset-roles >`.
418+
419+
420+ .. _tt-replicaset-roles-config :
421+
422+ Managing roles in clusters with local YAML configurations
423+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
424+
425+ When called on clusters with local YAML configurations, ``tt replicaset roles ``
426+ subcommands add or remove the corresponding lines from the configuration file
427+ and reload the configuration.
428+
429+ Use the ``--global ``, ``--group ``, ``--replicaset ``, ``--instance `` options to specify
430+ the configuration scope to add or remove roles. For example, to add a role to
431+ all instances in a replica set:
432+
433+ .. code-block :: console
434+
435+ $ tt replicaset roles add my-app roles.my-role --replicaset storage-a
436+
437+ You can also manage roles of a specific instance by specifying its name after the application name:
438+
439+ .. code-block :: console
440+
441+ $ tt replicaset roles add my-app:router-001 roles.my-role
442+
443+ To remove a role defined in the global configuration scope:
444+
445+ .. code-block :: console
446+
447+ $ tt replicaset roles remove my-app roles.my-role --global
448+
449+ If some instances of the affected scope are running outside the current ``tt ``
450+ environment, ``tt replicaset roles `` can't ensure the configuration reload on
451+ them and reports an error. You can skip this check by adding the ``-f ``/``--force `` option:
452+
453+ .. code-block :: console
454+
455+ $ tt replicaset roles add my-app roles.my-role --replicaset storage-a --force
456+
457+
458+ .. _tt-replicaset-roles-cartridge :
459+
460+ Managing roles in Cartridge clusters
461+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
462+
463+ .. include :: _includes/cartridge_deprecation_note.rst
464+
465+ When called on Cartridge clusters, ``tt replicaset roles `` subcommands add or remove
466+ Cartridge `cluster roles <https://www.tarantool.io/en/doc/2.11/book/cartridge/cartridge_dev/#cluster-roles >`__.
467+
468+ Cartridge cluster roles are defined per replica set. Thus, you can use the
469+ ``--replicaset `` and ``--group `` options to define a role's scope. In this case,
470+ a group is a `vshard group <https://www.tarantool.io/en/doc/2.11/book/cartridge/cartridge_dev/#using-multiple-vshard-storage-groups >`__.
471+
472+ To add a role to a Cartridge cluster replica set:
473+
474+ .. code-block :: console
475+
476+ $ tt replicaset roles add my-cartridge-app my-role --replicaset storage-001
477+
478+ To remove a role from a vshard group:
479+
480+ .. code-block :: console
481+
482+ $ tt replicaset roles remove my-cartridge-app my-role --group cold-data
483+
484+ Learn more about `Cartridge cluster roles <https://www.tarantool.io/en/doc/2.11/book/cartridge/cartridge_dev/#cluster-roles >`_.
485+
486+
394487.. _tt-replicaset-orchestrator :
395488
396489Selecting the application orchestrator manually
@@ -462,7 +555,7 @@ Options
462555
463556 Force a custom orchestrator for Tarantool 2.x clusters.
464557
465- .. option :: --file FILE
558+ .. option :: --file STRING
466559
467560 **Applicable to: ** ``bootstrap ``
468561
@@ -473,51 +566,82 @@ Options
473566
474567.. option :: -f , --force
475568
476- **Applicable to: ** ``promote ``, ``demote ``
569+ **Applicable to: ** ``promote ``, ``demote ``, `` roles ``
477570
478- Skip promotion or demotion if the specified instance is not running in the same environment.
571+ Skip operation on instances not running in the same environment.
479572
480- .. option :: --replicaset REPLICASET
573+ .. option :: -G , --global
481574
482- **Applicable to: ** ``bootstrap ``
575+ **Applicable to: ** ``roles `` on Tarantool 3.x and later
576+
577+ Apply the operation to the global configuration scope, that is, to all instances.
578+
579+ .. option :: -g , --group STRING
580+
581+ **Applicable to: ** ``roles ``
582+
583+ A name of the configuration group to which the operation applies.
584+
585+
586+ .. option :: -i , --instance STRING
587+
588+ **Applicable to: ** ``roles ``
483589
484- A replica set name for instance bootstrapping.
590+ A name of the instance to which the operation applies. Not applicable to Cartridge clusters.
591+ Learn more in :ref: `tt-replicaset-roles-cartridge `.
592+
593+ .. option :: -r , --replicaset STRING
594+
595+ **Applicable to: ** ``bootstrap ``, ``roles ``
596+
597+ A name of the replica set to which the operation applies.
485598
486599 See also: :ref: `tt-replicaset-bootstrap-instance `
487600
488- .. option :: -u USERNAME , --username USERNAME
601+ .. option :: -u , --username STRING
489602
490603 A Tarantool user for connecting to the instance using a URI.
491604
492- .. option :: -p PASSWORD , --password PASSWORD
605+ .. option :: -p , --password STRING
493606
494607 The user's password.
495608
496- .. option :: --sslcertfile FILEPATH
609+ .. option :: --sslcertfile STRING
497610
498611 The path to an SSL certificate file for encrypted connections for the URI case.
499612
500- .. option :: --sslkeyfile FILEPATH
613+ .. option :: --sslkeyfile STRING
501614
502615 The path to a private SSL key file for encrypted connections for the URI case.
503616
504- .. option :: --sslcafile FILEPATH
617+ .. option :: --sslcafile STRING
505618
506619 The path to a trusted certificate authorities (CA) file for encrypted connections for the URI case.
507620
508621.. option :: --sslciphers STRING
509622
510623 The list of SSL cipher suites used for encrypted connections for the URI case, separated by colons (``: ``).
511624
512- .. option :: --timeout
625+ .. option :: --timeout UINT
513626
514627 **Applicable to: ** ``promote ``, ``demote ``, ``expel ``, ``vshard ``, ``bootstrap ``
515628
516629 The timeout for completing the operation, in seconds. Default:
517630
518- - ``3 `` for ``promote ``, ``demote ``, ``expel ``
631+ - ``3 `` for ``promote ``, ``demote ``, ``expel ``, `` roles ``
519632 - ``10 `` for ``vshard `` and ``bootstrap ``
520633
634+ .. option :: --with-integrity-check STRING
635+
636+ .. admonition :: Enterprise Edition
637+ :class: fact
638+
639+ This option is supported by the `Enterprise Edition <https://www.tarantool.io/compare/ >`_ only.
640+
641+ **Applicable to: ** ``promote ``, ``demote ``, ``expel ``, ``roles ``
642+
643+ Generate hashes and signatures for integrity checks.
644+
521645.. option :: -y , --yes
522646
523647 **Applicable to: ** ``rebootstrap ``
0 commit comments