Skip to content

Commit b4ac572

Browse files
authored
Add TCM initial settings doc (tarantool#4615)
Resolves tarantool#4612
1 parent 6167d93 commit b4ac572

File tree

3 files changed

+787
-12
lines changed

3 files changed

+787
-12
lines changed

doc/tooling/tcm/tcm_configuration.rst

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ multiple |tcm| installations:
162162
- Command-line options for parameters that must be unique for different |tcm| instances
163163
running on a single server. For example, ``http.port``.
164164

165+
.. _tcm_configuration_types:
166+
165167
Configuration parameter types
166168
-----------------------------
167169

@@ -219,6 +221,8 @@ packages documentation <https://pkg.go.dev/>`__.
219221
websession-cookie:
220222
same-site: SameSiteStrictMode
221223
224+
.. _tcm_configuration_template:
225+
222226
Creating a configuration template
223227
---------------------------------
224228

@@ -229,4 +233,101 @@ To write a default |tcm| configuration to the ``tcm.example.yml`` file, run:
229233

230234
.. code-block:: console
231235
232-
$ tcm generate-config > tcm.example.yml.
236+
$ tcm generate-config > tcm.example.yml.
237+
238+
.. _tcm_configuration_initial:
239+
240+
Initial settings
241+
----------------
242+
243+
You can use YAML configuration files to create entities in |tcm| automatically
244+
upon the first start. These entities are defined in the :ref:`tcm_configuration_reference_initial`
245+
section of the configuration file.
246+
247+
.. important::
248+
249+
The initial settings are applied **only once** upon the first |tcm| start.
250+
Further changes are **not applied** upon |tcm| restarts.
251+
252+
.. _tcm_configuration_initial_clusters:
253+
254+
Clusters
255+
~~~~~~~~
256+
257+
To add clusters to |tcm| upon the first start, specify their settings in the
258+
:ref:`initial-settings.clusters <tcm_configuration_reference_initial_clusters>`
259+
configuration section.
260+
261+
The ``initial-settings.clusters`` section is an array whose items describe separate clusters,
262+
for example:
263+
264+
.. code-block:: yaml
265+
266+
initial-settings:
267+
clusters:
268+
- name: Cluster 1
269+
description: First cluster
270+
# cluster settings
271+
- name: Cluster 2
272+
description: Second cluster
273+
# cluster settings
274+
275+
In this configuration, you can specify all cluster settings that you define
276+
when :ref:`connecting clusters <tcm_connect_clusters>` through the |tcm| web interface.
277+
This includes:
278+
279+
- the cluster name
280+
- description
281+
- additional URLs
282+
- configuration storage connection
283+
- Tarantool instances connection
284+
- and other settings.
285+
286+
For the full list of cluster configuration parameters, see the :ref:`initial-settings.clusters <tcm_configuration_reference_initial_clusters>`
287+
reference. For example, this is how you add a cluster that uses an etcd configuration
288+
storage:
289+
290+
291+
.. code-block:: yaml
292+
293+
initial-settings:
294+
clusters:
295+
- name: My cluster
296+
description: Cluster description
297+
urls:
298+
- label: Test
299+
url: http://example.com
300+
storage-connection:
301+
provider: etcd
302+
etcd-connection:
303+
endpoints:
304+
- http://127.0.0.1:2379
305+
username: ""
306+
password: ""
307+
prefix: /cluster1
308+
tarantool-connection:
309+
username: guest
310+
password: ""
311+
312+
By default, |tcm| contains a cluster named **Default cluster** with ID
313+
``00000000-0000-0000-0000-000000000000``. You can use this ID to modify
314+
the default cluster settings upon the first |tcm| start. For example, rename it
315+
and add its connection settings:
316+
317+
.. code-block:: yaml
318+
319+
initial-settings:
320+
clusters:
321+
- id: 00000000-0000-0000-0000-000000000000
322+
name: My cluster
323+
storage-connection:
324+
provider: etcd
325+
etcd-connection:
326+
endpoints:
327+
- http://127.0.0.1:2379
328+
username: etcd-user
329+
password: secret
330+
prefix: /cluster1
331+
tarantool-connection:
332+
username: guest
333+
password: ""

0 commit comments

Comments
 (0)