Skip to content

Commit

Permalink
Centralized storage: reference
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyaksenov committed Feb 26, 2024
1 parent 3420d38 commit f8e49d2
Show file tree
Hide file tree
Showing 2 changed files with 255 additions and 4 deletions.
138 changes: 135 additions & 3 deletions doc/reference/configuration/configuration_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ The ``config`` section defines various parameters related to centralized configu
* :ref:`config.reload <configuration_reference_config_reload>`
* :ref:`config.context.* <configuration_reference_config_context_options>`
* :ref:`config.etcd.* <configuration_reference_config_etcd>`
* :ref:`config.storage.* <configuration_reference_config_storage>`

.. _configuration_reference_config_reload:

Expand Down Expand Up @@ -465,7 +466,7 @@ config.etcd.*
:start-after: ee_note_centralized_config_start
:end-before: ee_note_centralized_config_end

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

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

The list of endpoints used to access an etcd server.

See also: :ref:`Local etcd configuration <etcd_local_configuration>`.
See also: :ref:`etcd_local_configuration`.

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

See also: :ref:`Local etcd configuration <etcd_local_configuration>`.
See also: :ref:`etcd_local_configuration`.

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

A username used for authentication.

See also: :ref:`etcd_local_configuration`.

|
| Type: string
| Default: nil
Expand All @@ -535,6 +538,8 @@ This section describes options related to :ref:`storing configuration in etcd <c

A password used for authentication.

See also: :ref:`etcd_local_configuration`.

|
| Type: string
| Default: nil
Expand Down Expand Up @@ -619,6 +624,8 @@ This section describes options related to :ref:`storing configuration in etcd <c

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

See also: :ref:`etcd_local_configuration`.

|
| Type: number
| Default: nil
Expand All @@ -639,6 +646,92 @@ This section describes options related to :ref:`storing configuration in etcd <c


.. _configuration_reference_config_storage:

config.storage.*
~~~~~~~~~~~~~~~~

.. include:: /concepts/configuration/configuration_etcd.rst
:start-after: ee_note_centralized_config_start
:end-before: ee_note_centralized_config_end

This section describes options related to providing connection settings to a :ref:`centralized Tarantool-based storage <configuration_etcd>`.

* :ref:`config.storage.endpoints <config_storage_endpoints>`
* :ref:`config.storage.prefix <config_storage_prefix>`
* :ref:`config.storage.reconnect_after <config_storage_reconnect_after>`
* :ref:`config.storage.timeout <config_storage_timeout>`


.. _config_storage_endpoints:

.. confval:: config.storage.endpoints

**Since:** :doc:`3.0.0 </release/3.0.0>`.

An array of endpoints used to access a configuration storage.
Each endpoint can include the following fields:

* ``uri``
* ``login``
* ``password``
* ``params``: SSL parameters (:ref:`<uri>.params.* <configuration_reference_iproto_uri_params>`).

See also: :ref:`centralized_configuration_storage_connect_tarantool`.

|
| Type: array
| Default: nil
| Environment variable: TT_CONFIG_STORAGE_ENDPOINTS

.. _config_storage_prefix:

.. confval:: config.storage.prefix

**Since:** :doc:`3.0.0 </release/3.0.0>`.

A key prefix used to search a configuration in a centralized configuration storage.
Tarantool searches keys by the following path: ``<prefix>/config/*``.
Note that ``<prefix>`` should start with a slash (``/``).

See also: :ref:`centralized_configuration_storage_connect_tarantool`.

|
| Type: string
| Default: nil
| Environment variable: TT_CONFIG_STORAGE_PREFIX

.. _config_storage_reconnect_after:

.. confval:: config.storage.reconnect_after

**Since:** :doc:`3.0.0 </release/3.0.0>`.

See also: :ref:`centralized_configuration_storage_connect_tarantool`.

|
| Type: number
| Default: 3
| Environment variable: TT_CONFIG_STORAGE_RECONNECT_AFTER

.. _config_storage_timeout:

.. confval:: config.storage.timeout

**Since:** :doc:`3.0.0 </release/3.0.0>`.

See also: :ref:`centralized_configuration_storage_connect_tarantool`.

|
| Type: number
| Default: 3
| Environment variable: TT_CONFIG_STORAGE_TIMEOUT



.. _configuration_reference_credentials:

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

.. _configuration_reference_roles_options:

roles
-----

This section describes configuration parameters related to roles.

.. NOTE::

Configuration parameters related to roles can be defined in any :ref:`scope <configuration_scopes>`.

- :ref:`roles <configuration_reference_roles>`
- :ref:`roles_cfg <configuration_reference_roles_cfg>`


.. _configuration_reference_roles:

.. confval:: roles

**Since:** :doc:`3.0.0 </release/3.0.0>`.

|
| Type: array
| Default: nil
| Environment variable: TT_ROLES

.. _configuration_reference_roles_cfg:

.. confval:: roles_cfg

**Since:** :doc:`3.0.0 </release/3.0.0>`.

|
| Type: map
| Default: nil
| Environment variable: TT_ROLES_CFG


.. _configuration_reference_security:

Expand Down
121 changes: 120 additions & 1 deletion doc/reference/reference_lua/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,123 @@ Module config

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

.. TODO: https://github.com/tarantool/doc/issues/3662
The ``config`` module provides the ability to work with a cluster configuration.

To load the ``config`` module, use the ``require()`` directive as follows:

.. code-block:: lua
local config = require('config')
Then, you can access its :ref:`API <config_api_reference>`:

.. code-block:: lua
config:reload()
.. _config_module_api_reference:

API Reference
-------------

.. container:: table

.. rst-class:: left-align-column-1
.. rst-class:: left-align-column-2

.. list-table::
:widths: 35 65

* - :ref:`config API <config_api_reference>`
-

* - :ref:`config.get() <config_api_reference_get>`
- Get a configuration value

* - :ref:`config.info() <config_api_reference_info>`
- Get configuration status

* - :ref:`config.reload() <config_api_reference_reload>`
- Reload the configuration

* - :ref:`config.storage API <config_api_reference_storage>`
-

* - :ref:`config.storage.put() <config_storage_api_reference_put>`
- Put a value

* - :ref:`config.storage.get() <config_storage_api_reference_get>`
- Get a value

* - :ref:`config.storage.delete() <config_storage_api_reference_delete>`
- Delete a value

* - :ref:`config.storage.info() <config_storage_api_reference_info>`
- Info

* - :ref:`config.storage.tnx() <config_storage_api_reference_tnx>`
- tnx



.. _config_api_reference:

config API
~~~~~~~~~~

.. module:: config

.. _config_api_reference_get:

.. function:: get([key])

Get a configuration value.

:param string key: a config key
:return: a configuration

**Example:**

.. code-block:: console
app:instance001> config:get('memtx.memory')
---
- 268435456
...
.. _config_api_reference_info:

.. function:: info()

Get configuration status.

:return: a configuration status


.. _config_api_reference_reload:

.. function:: reload()

Reload the configuration.


.. _config_storage_api_reference:

config.storage API
~~~~~~~~~~~~~~~~~~

.. _config_storage_api_reference_put:

.. function:: storage.put(path, value)

Put a value.

:param string path: a path
:param string value: a value






0 comments on commit f8e49d2

Please sign in to comment.