You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/concepts/configuration.rst
+5-2
Original file line number
Diff line number
Diff line change
@@ -184,17 +184,20 @@ Enabling and configuring roles
184
184
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
185
185
186
186
An application role is a Lua module that implements specific functions or logic.
187
-
You can enable or turn off a particular role for certain instances in a configuration without restarting these instances.
187
+
You can turn on or off a particular role for certain instances in a configuration without restarting these instances.
188
188
189
+
There can be built-in Tarantool roles, roles provided by third-party Lua modules, or custom roles that are developed as a part of a cluster application.
189
190
This section describes how to enable and configure roles.
190
191
To learn how to develop custom roles, see :ref:`application_roles`.
191
192
193
+
194
+
192
195
.. _configuration_application_roles_enable:
193
196
194
197
Enabling a role
195
198
***************
196
199
197
-
To enable or turn off a role for a specific instance or a set of instances, use the :ref:`roles <configuration_reference_roles>` configuration option.
200
+
To turn on or off a role for a specific instance or a set of instances, use the :ref:`roles <configuration_reference_roles>` configuration option.
198
201
The example below shows how to enable the ``roles.crud-router`` role provided by the `CRUD <https://github.com/tarantool/crud>`__ module using the :ref:`roles <configuration_reference_roles>` option:
Copy file name to clipboardExpand all lines: doc/how-to/app/app_roles.rst
+9-4
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ Application roles
4
4
=================
5
5
6
6
An application role is a Lua module that implements specific functions or logic.
7
-
You can enable or turn off a particular role for certain instances in a :ref:`configuration <configuration>` without restarting these instances.
7
+
You can turn on or off a particular role for certain instances in a :ref:`configuration <configuration>` without restarting these instances.
8
8
A role is run when a configuration is loaded or reloaded.
9
9
10
10
Roles can be divided into the following groups:
11
11
12
-
- Roles provided by Tarantool.
12
+
- Tarantool's built-in roles.
13
13
For example, the ``config.storage`` role can be used to make a Tarantool replica set act as a :ref:`configuration storage <centralized_configuration_storage_set_up_tarantool>`.
14
14
- Roles provided by third-party Lua modules.
15
15
For example, the `CRUD <https://github.com/tarantool/crud>`__ module provides the ``roles.crud-storage`` and ``roles.crud-router`` roles that enable CRUD operations in a sharded cluster.
@@ -94,7 +94,7 @@ Validating a role configuration
94
94
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95
95
96
96
To validate a role's configuration, you need to define the :ref:`validate([cfg]) <roles_api_reference_validate>` function.
97
-
The ``cfg`` argument allows you to get access to the provided:ref:`role's configuration <roles_create_custom_role_config>` and check its validity.
97
+
The ``cfg`` argument provides access to the :ref:`role's configuration <roles_create_custom_role_config>` and check its validity.
98
98
99
99
In the example below, the ``validate()`` function is used to validate the ``greeting`` configuration value:
100
100
@@ -277,14 +277,19 @@ Executing functions for dependent roles
277
277
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
278
278
279
279
For roles that :ref:`depend <roles_create_custom_role_dependencies>` on each other, their ``validate()``, ``apply()``, and ``stop()`` functions are executed taking into account the dependencies.
280
-
Suppose, there are two independent roles (``role1``, ``role2``) and three roles that depend on each other as follows:
280
+
Suppose, there are three independent and two dependent roles:
281
281
282
282
.. code-block:: none
283
283
284
+
role1
285
+
role2
284
286
role3
285
287
└─── role4
286
288
└─── role5
287
289
290
+
- ``role1``, ``role2``, and ``role5`` are independent roles.
291
+
- ``role3`` depends on ``role4``, ``role4`` depends on ``role5``.
292
+
288
293
The roles are enabled in a configuration as follows:
0 commit comments