Skip to content

Commit 3219f51

Browse files
committed
Centralized storage: reference
1 parent 3420d38 commit 3219f51

File tree

2 files changed

+257
-4
lines changed

2 files changed

+257
-4
lines changed

doc/reference/configuration/configuration_reference.rst

Lines changed: 135 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ The ``config`` section defines various parameters related to centralized configu
334334
* :ref:`config.reload <configuration_reference_config_reload>`
335335
* :ref:`config.context.* <configuration_reference_config_context_options>`
336336
* :ref:`config.etcd.* <configuration_reference_config_etcd>`
337+
* :ref:`config.storage.* <configuration_reference_config_storage>`
337338

338339
.. _configuration_reference_config_reload:
339340

@@ -465,7 +466,7 @@ config.etcd.*
465466
:start-after: ee_note_centralized_config_start
466467
:end-before: ee_note_centralized_config_end
467468

468-
This section describes options related to :ref:`storing configuration in etcd <configuration_etcd>`.
469+
This section describes options related to providing connection settings to a :ref:`centralized etcd-based storage <configuration_etcd>`.
469470

470471
* :ref:`config.etcd.endpoints <config_etcd_endpoints>`
471472
* :ref:`config.etcd.prefix <config_etcd_prefix>`
@@ -489,7 +490,7 @@ This section describes options related to :ref:`storing configuration in etcd <c
489490

490491
The list of endpoints used to access an etcd server.
491492

492-
See also: :ref:`Local etcd configuration <etcd_local_configuration>`.
493+
See also: :ref:`etcd_local_configuration`.
493494

494495
|
495496
| Type: array
@@ -507,7 +508,7 @@ This section describes options related to :ref:`storing configuration in etcd <c
507508
Tarantool searches keys by the following path: ``<prefix>/config/*``.
508509
Note that ``<prefix>`` should start with a slash (``/``).
509510

510-
See also: :ref:`Local etcd configuration <etcd_local_configuration>`.
511+
See also: :ref:`etcd_local_configuration`.
511512

512513
|
513514
| Type: string
@@ -522,6 +523,8 @@ This section describes options related to :ref:`storing configuration in etcd <c
522523

523524
A username used for authentication.
524525

526+
See also: :ref:`etcd_local_configuration`.
527+
525528
|
526529
| Type: string
527530
| Default: nil
@@ -535,6 +538,8 @@ This section describes options related to :ref:`storing configuration in etcd <c
535538

536539
A password used for authentication.
537540

541+
See also: :ref:`etcd_local_configuration`.
542+
538543
|
539544
| Type: string
540545
| Default: nil
@@ -619,6 +624,8 @@ This section describes options related to :ref:`storing configuration in etcd <c
619624

620625
A time period required to process an HTTP request to an etcd server: from sending a request to receiving a response.
621626

627+
See also: :ref:`etcd_local_configuration`.
628+
622629
|
623630
| Type: number
624631
| Default: nil
@@ -639,6 +646,92 @@ This section describes options related to :ref:`storing configuration in etcd <c
639646
640647

641648

649+
.. _configuration_reference_config_storage:
650+
651+
config.storage.*
652+
~~~~~~~~~~~~~~~~
653+
654+
.. include:: /concepts/configuration/configuration_etcd.rst
655+
:start-after: ee_note_centralized_config_start
656+
:end-before: ee_note_centralized_config_end
657+
658+
This section describes options related to providing connection settings to a :ref:`centralized Tarantool-based storage <configuration_etcd>`.
659+
660+
* :ref:`config.storage.endpoints <config_storage_endpoints>`
661+
* :ref:`config.storage.prefix <config_storage_prefix>`
662+
* :ref:`config.storage.reconnect_after <config_storage_reconnect_after>`
663+
* :ref:`config.storage.timeout <config_storage_timeout>`
664+
665+
666+
.. _config_storage_endpoints:
667+
668+
.. confval:: config.storage.endpoints
669+
670+
**Since:** :doc:`3.0.0 </release/3.0.0>`.
671+
672+
An array of endpoints used to access a configuration storage.
673+
Each endpoint can include the following fields:
674+
675+
* ``uri``
676+
* ``login``
677+
* ``password``
678+
* ``params``: SSL parameters (:ref:`<uri>.params.* <configuration_reference_iproto_uri_params>`).
679+
680+
See also: :ref:`centralized_configuration_storage_connect_tarantool`.
681+
682+
|
683+
| Type: array
684+
| Default: nil
685+
| Environment variable: TT_CONFIG_STORAGE_ENDPOINTS
686+
687+
688+
.. _config_storage_prefix:
689+
690+
.. confval:: config.storage.prefix
691+
692+
**Since:** :doc:`3.0.0 </release/3.0.0>`.
693+
694+
A key prefix used to search a configuration in a centralized configuration storage.
695+
Tarantool searches keys by the following path: ``<prefix>/config/*``.
696+
Note that ``<prefix>`` should start with a slash (``/``).
697+
698+
See also: :ref:`centralized_configuration_storage_connect_tarantool`.
699+
700+
|
701+
| Type: string
702+
| Default: nil
703+
| Environment variable: TT_CONFIG_STORAGE_PREFIX
704+
705+
706+
.. _config_storage_reconnect_after:
707+
708+
.. confval:: config.storage.reconnect_after
709+
710+
**Since:** :doc:`3.0.0 </release/3.0.0>`.
711+
712+
See also: :ref:`centralized_configuration_storage_connect_tarantool`.
713+
714+
|
715+
| Type: number
716+
| Default: 3
717+
| Environment variable: TT_CONFIG_STORAGE_RECONNECT_AFTER
718+
719+
720+
.. _config_storage_timeout:
721+
722+
.. confval:: config.storage.timeout
723+
724+
**Since:** :doc:`3.0.0 </release/3.0.0>`.
725+
726+
See also: :ref:`centralized_configuration_storage_connect_tarantool`.
727+
728+
|
729+
| Type: number
730+
| Default: 3
731+
| Environment variable: TT_CONFIG_STORAGE_TIMEOUT
732+
733+
734+
642735

643736
.. _configuration_reference_credentials:
644737

@@ -2167,6 +2260,45 @@ The ``replication`` section defines configuration parameters related to :ref:`re
21672260
| Environment variable: TT_REPLICATION_TIMEOUT
21682261
21692262

2263+
.. _configuration_reference_roles_options:
2264+
2265+
roles
2266+
-----
2267+
2268+
This section describes configuration parameters related to roles.
2269+
2270+
.. NOTE::
2271+
2272+
Configuration parameters related to roles can be defined in any :ref:`scope <configuration_scopes>`.
2273+
2274+
- :ref:`roles <configuration_reference_roles>`
2275+
- :ref:`roles_cfg <configuration_reference_roles_cfg>`
2276+
2277+
2278+
.. _configuration_reference_roles:
2279+
2280+
.. confval:: roles
2281+
2282+
**Since:** :doc:`3.0.0 </release/3.0.0>`.
2283+
2284+
|
2285+
| Type: array
2286+
| Default: nil
2287+
| Environment variable: TT_ROLES
2288+
2289+
2290+
.. _configuration_reference_roles_cfg:
2291+
2292+
.. confval:: roles_cfg
2293+
2294+
**Since:** :doc:`3.0.0 </release/3.0.0>`.
2295+
2296+
|
2297+
| Type: map
2298+
| Default: nil
2299+
| Environment variable: TT_ROLES_CFG
2300+
2301+
21702302

21712303
.. _configuration_reference_security:
21722304

doc/reference/reference_lua/config.rst

Lines changed: 122 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,125 @@ Module config
55

66
**Since:** :doc:`3.0.0 </release/3.0.0>`
77

8-
.. TODO: https://github.com/tarantool/doc/issues/3662
8+
The ``config`` module provides the ability to work with a cluster configuration.
9+
10+
To load the ``config`` module, use the ``require()`` directive as follows:
11+
12+
.. code-block:: lua
13+
14+
local config = require('config')
15+
16+
Then, you can access its :ref:`API <config_api_reference>`:
17+
18+
.. code-block:: lua
19+
20+
config:reload()
21+
22+
23+
.. _config_module_api_reference:
24+
25+
API Reference
26+
-------------
27+
28+
.. container:: table
29+
30+
.. rst-class:: left-align-column-1
31+
.. rst-class:: left-align-column-2
32+
33+
.. list-table::
34+
:widths: 35 65
35+
36+
* - :ref:`config API <config_api_reference>`
37+
-
38+
39+
* - :ref:`config.get() <config_api_reference_get>`
40+
- Get a configuration value
41+
42+
* - :ref:`config.info() <config_api_reference_info>`
43+
- Get configuration status
44+
45+
* - :ref:`config.reload() <config_api_reference_reload>`
46+
- Reload the configuration
47+
48+
* - :ref:`config.storage API <config_api_reference_storage>`
49+
-
50+
51+
* - :ref:`config.storage.put() <config_storage_api_reference_put>`
52+
- Put a value
53+
54+
* - :ref:`config.storage.get() <config_storage_api_reference_get>`
55+
- Get a value
56+
57+
* - :ref:`config.storage.delete() <config_storage_api_reference_delete>`
58+
- Delete a value
59+
60+
* - :ref:`config.storage.info() <config_storage_api_reference_info>`
61+
- Info
62+
63+
* - :ref:`config.storage.tnx() <config_storage_api_reference_tnx>`
64+
- tnx
65+
66+
67+
68+
.. _config_api_reference:
69+
70+
config API
71+
~~~~~~~~~~
72+
73+
.. module:: config
74+
75+
.. _config_api_reference_get:
76+
77+
.. function:: get([key])
78+
79+
Get a configuration value.
80+
81+
:param string key: a config key
82+
:return: a configuration
83+
84+
**Example:**
85+
86+
.. code-block:: console
87+
88+
app:instance001> config:get('memtx.memory')
89+
---
90+
- 268435456
91+
...
92+
93+
.. _config_api_reference_info:
94+
95+
.. function:: info()
96+
97+
Get configuration status.
98+
99+
:return: a configuration status
100+
101+
102+
.. _config_api_reference_reload:
103+
104+
.. function:: reload()
105+
106+
Reload the configuration.
107+
108+
109+
.. _config_storage_api_reference:
110+
111+
config.storage API
112+
~~~~~~~~~~~~~~~~~~
113+
114+
.. module:: config.storage
115+
116+
.. _config_storage_api_reference_put:
117+
118+
.. function:: put(path, value)
119+
120+
Put a value.
121+
122+
:param string path: a path
123+
:param string value: a value
124+
125+
126+
127+
128+
129+

0 commit comments

Comments
 (0)