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
+46-22
Original file line number
Diff line number
Diff line change
@@ -3,31 +3,56 @@
3
3
Configuration
4
4
=============
5
5
6
+
Tarantool provides the ability to configure the full topology of a cluster and set parameters specific for concrete instances, like connection settings, memory used to store data, logging, and snapshot settings.
7
+
Each instance uses this configuration during :ref:`startup <configuration_run_instance>` to organize the cluster.
8
+
6
9
There are two approaches to configuring Tarantool:
7
10
8
-
* *Since version 3.0*: In a YAML file.
11
+
* *Since version 3.0*: In a YAML format.
9
12
10
-
In a YAML file, you can provide the full cluster topology and specify all configuration options.
11
-
You can also use :ref:`etcd <configuration_etcd_overview>` to store configuration data in one reliable place.
13
+
YAML configuration allows you to provide the full cluster topology and specify all configuration options.
14
+
You can use local configuration in a YAML file for each instance or store configuration data in one reliable place using :ref:`etcd <configuration_etcd_overview>`.
12
15
13
16
* *In version 2.11 and earlier*: :ref:`In code <configuration_code>` using the ``box.cfg`` API.
14
17
15
18
In this case, configuration is provided in a Lua initialization script.
16
-
Starting with the 3.0 version, configuring Tarantool in code is considered a legacy approach.
19
+
20
+
.. NOTE::
21
+
22
+
Starting with the 3.0 version, configuring Tarantool in code is considered a legacy approach.
17
23
18
24
19
25
.. _configuration_overview:
20
26
21
27
Configuration overview
22
28
----------------------
23
29
24
-
A YAML configuration file describes the full topology of a Tarantool cluster.
30
+
YAML configuration describes the full topology of a Tarantool cluster.
25
31
A cluster's topology includes the following elements, starting from the lower level:
26
32
27
-
- An *instance* is a member of the cluster that stores data or might act as a router for handling CRUD requests in a :ref:`sharded <sharding>` cluster.
28
-
- A *replica set* is a pack of instances that operate on copies of the same databases.
33
+
.. code-block:: yaml
34
+
:emphasize-lines: 1,3,5
35
+
36
+
groups:
37
+
group001:
38
+
replicasets:
39
+
replicaset001:
40
+
instances:
41
+
instance001:
42
+
# ...
43
+
instance002:
44
+
# ...
45
+
46
+
- ``instances``
47
+
48
+
An *instance* is a member of the cluster that stores data or might act as a router for handling CRUD requests in a :ref:`sharded <sharding>` cluster.
49
+
- ``replicasets``
50
+
51
+
A *replica set* is a pack of instances that operate on copies of the same databases.
29
52
:ref:`Replication <replication>` provides redundancy and increases data availability.
30
-
- A *group* provides the ability to organize replica sets.
53
+
- ``groups``
54
+
55
+
A *group* provides the ability to organize replica sets.
31
56
For example, in a sharded cluster, one group can contain :ref:`storage <vshard-architecture-storage>` instances and another group can contain :ref:`routers <vshard-architecture-router>` used to handle CRUD requests.
32
57
33
58
You can flexibly configure a cluster's settings on different levels: from global settings applied to all groups to parameters specific for concrete instances.
@@ -96,7 +121,7 @@ Most of the configuration options can be applied to a specific instance, replica
96
121
97
122
- *Global*
98
123
99
-
In this example, ``iproto.listen`` is applied to all instances of all groups.
124
+
In this example, ``iproto.listen`` is applied to all instances of the cluster.
For each configuration parameter, Tarantool provides two sets of predefined environment variables:
222
246
223
-
* Variables whose names start with ``TT_`` are used to substitute parameters specified in a configuration file.
247
+
* ``TT_<CONFIG_PARAMETER>``. These variables are used to substitute parameters specified in a configuration file.
224
248
This means that these variables have a higher :ref:`priority <configuration_precedence>` than the options specified in a configuration file.
225
249
226
-
* Variables whose names start with ``TT_`` and end with ``_DEFAULT`` are used to specify default values for parameters missing in a configuration file.
250
+
* ``TT_<CONFIG_PARAMETER>_DEFAULT``. These variables are used to specify default values for parameters missing in a configuration file.
227
251
These variables have a lower :ref:`priority <configuration_precedence>` than the options specified in a configuration file.
228
252
229
253
For example, ``TT_IPROTO_LISTEN`` and ``TT_IPROTO_LISTEN_DEFAULT`` correspond to the ``iproto.listen`` option.
@@ -236,7 +260,7 @@ To see all the supported environment variables, execute the ``tarantool`` comman
236
260
237
261
Below are a few examples that show how to set environment variables of different types, like *string*, *number*, *array*, or *map*:
238
262
239
-
* (*String*) In the example below, ``TT_IPROTO_LISTEN`` is used to specify a :ref:`listening host and port <configuration_options_connection>` values:
263
+
* String. In the example below, ``TT_IPROTO_LISTEN`` is used to specify a :ref:`listening host and port <configuration_options_connection>` values:
240
264
241
265
.. code-block:: console
242
266
@@ -248,28 +272,28 @@ Below are a few examples that show how to set environment variables of different
0 commit comments