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
A sample application demonstrating various features related to Tarantool [configuration](https://www.tarantool.io/en/doc/latest/concepts/configuration/).
4
+
5
+
## Running
6
+
7
+
To run applications placed in [instances.enabled](instances.enabled), go to the `config` directory in the terminal and execute the `tt start` command, for example:
Options in this section grant the specified privileges to the *replicator* user used for replication and
128
-
the *client* user that can perform any action.
128
+
Options in this section grant the specified roles to the *replicator* and *client* users.
129
129
These options are applied globally to all instances.
130
130
131
131
- ``iproto`` (*global*, *instance*)
132
132
133
133
The ``iproto`` section is specified on both global and instance levels.
134
-
The ``iproto.advertise.peer`` option specifies a user name and a host used by replicas to connect to each other.
135
-
In this example, a host is not specified and taken from ``iproto.listen`` set on the instance level.
134
+
The ``iproto.advertise.peer`` option specifies a URI used by an instance to connect to another instance as a replica.
135
+
In the example above, the URI includes a user name only.
136
+
A host value is taken from ``iproto.listen`` that is set on the instance level.
136
137
137
138
- ``replication``: (*global*)
138
139
139
140
The ``replication.failover`` global option sets a manual failover for all replica sets.
140
141
141
142
- ``leader``: (*replica set*)
142
143
143
-
The ``<replicaset-name>.leader`` option sets a :ref:`master <replication-roles>` instance for the specified replica set.
144
+
The ``<replicaset-name>.leader`` option sets a :ref:`master <replication-roles>` instance for *replicaset001*.
144
145
145
-
To learn more about configuring replication and sharding, see :ref:`Replication tutorials <how-to-replication>` and :ref:`Quick start with sharding <vshard-quick-start>` sections.
146
146
147
147
148
148
.. _configuration_application:
@@ -166,7 +166,7 @@ use the ``config:get()`` function provided by the :ref:`config <config-module>`
166
166
:language: lua
167
167
:dedent:
168
168
169
-
As a result of :ref:`running<configuration_run_instance>` the *instance001*, a log should contain the following line:
169
+
As a result of :ref:`starting<configuration_run_instance>` the *instance001*, a log should contain the following line:
170
170
171
171
.. code-block:: console
172
172
@@ -191,19 +191,25 @@ Learn more about using Tarantool as the application server from :ref:`Developing
191
191
192
192
193
193
194
-
.. _configuration_templating:
194
+
.. _configuration_predefined_variables:
195
195
196
-
Templating
197
-
**********
196
+
Predefined variables
197
+
********************
198
+
199
+
In a configuration file, you can use the following predefined variables that are replaced with actual values at runtime:
198
200
199
-
In a configuration file, you can use predefined variables that are replaced with actual values at runtime.
201
+
- ``instance_name``
202
+
- ``replicaset_name``
203
+
- ``group_name``
204
+
205
+
To reference such variables in a configuration file, use double curly braces.
200
206
In the example below, ``{{ instance_name }}`` is replaced with *instance001*.
* To assign map values to environment variables, use JSON objects.
246
-
In the example below, ``TT_APP_CFG`` is used to specify the value of a custom configuration property for a :ref:`loaded application <configuration_application>:
251
+
* (*Number*) In this example, ``TT_LOG_LEVEL`` is used to set a logging level to 3 (``CRITICAL``):
252
+
253
+
.. code-block:: console
254
+
255
+
$ export TT_LOG_LEVEL=3
256
+
257
+
* (*Array*) The examples below show how to set the ``TT_SHARDING_ROLES`` variable that accepts an array value.
In the next example, ``TT_APP_CFG`` is used to specify the value of a custom configuration property for a :ref:`loaded application <configuration_application>` using a *JSON* format:
247
280
248
281
.. code-block:: console
249
282
250
283
$ export TT_APP_CFG='{"greeting":"Hi"}'
251
284
285
+
The *simple* format is applicable only to maps containing scalar values.
252
286
253
-
.. NOTE::
254
287
255
-
The ``TT_INSTANCE_NAME`` and ``TT_CONFIG`` environment variables can be used to :ref:`run <configuration_run_instance>` the specified Tarantool instance with configuration from the given file.
288
+
.. NOTE::
256
289
290
+
There are also special ``TT_INSTANCE_NAME`` and ``TT_CONFIG`` environment variables that can be used to :ref:`start <configuration_run_instance_tarantool>` the specified Tarantool instance with configuration from the given file.
257
291
258
292
259
293
260
294
261
295
262
-
.. _configuration_centralized:
263
296
264
-
Centralized configuration
265
-
~~~~~~~~~~~~~~~~~~~~~~~~~
297
+
.. _configuration_etcd_overview:
266
298
267
-
.. admonition:: Enterprise Edition
268
-
:class: fact
299
+
Configuration in etcd
300
+
~~~~~~~~~~~~~~~~~~~~~
269
301
270
-
Centralized configuration is supported by the `Enterprise Edition <https://www.tarantool.io/compare/>`_ only.
0 commit comments