Skip to content

Commit 7cd3c88

Browse files
committed
Add initial-settings description with examples
1 parent 0624b7d commit 7cd3c88

File tree

2 files changed

+102
-3
lines changed

2 files changed

+102
-3
lines changed

doc/tooling/tcm/tcm_configuration.rst

Lines changed: 95 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,94 @@ 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 files.
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` through the |tcm| web interface. This includes
277+
the cluster name, a text description, additional URLs, configuration storage connection,
278+
Tarantool instances connection, and other settings. For the full list of cluster
279+
configuration parameters, see the :ref:`initial-settings.clusters <tcm_configuration_reference_initial_clusters>`
280+
reference. For example, this is how you add a cluster that uses an etcd configuration
281+
storage:
282+
283+
284+
.. code-block:: yaml
285+
286+
initial-settings:
287+
clusters:
288+
- name: "My cluster"
289+
description: "Cluster description"
290+
urls:
291+
- label: Test
292+
url: http://example.com
293+
storage-connection:
294+
provider: etcd
295+
etcd-connection:
296+
endpoints:
297+
- http://127.0.0.1:2379
298+
username: ""
299+
password: ""
300+
prefix: /cluster1
301+
tarantool-connection:
302+
username: "guest"
303+
password: ""
304+
305+
By default, |tcm| contains a cluster named **Default cluster** with ID
306+
``00000000-0000-0000-0000-000000000000``. You can specify this ID to modify
307+
the default cluster settings upon the first |tcm| start. For example, rename it
308+
and add its connection settings:
309+
310+
.. code-block:: yaml
311+
312+
initial-settings:
313+
clusters:
314+
- id: 00000000-0000-0000-0000-000000000000
315+
name: "My cluster"
316+
storage-connection:
317+
provider: etcd
318+
etcd-connection:
319+
endpoints:
320+
- http://127.0.0.1:2379
321+
username: etcd-user
322+
password: secret
323+
prefix: /cluster1
324+
tarantool-connection:
325+
username: "guest"
326+
password: ""

doc/tooling/tcm/tcm_connect_clusters.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ A single |tcm| installation can have multiple connected clusters. A connection t
1616
|tcm| doesn't affect the cluster's functioning. You can connect clusters to |tcm|
1717
and disconnect them on the fly.
1818

19-
There are two ways to add a cluster to |tcm|:
19+
There are two scenarios of cluster connection to |tcm|:
2020

2121
- Connect an existing cluster.
22-
- Add a new cluster and :ref:`write its configuration <getting_started_tcm_cluster_config>` from scratch in the |tcm| web UI.
22+
- Add a new cluster and :ref:`write its configuration <getting_started_tcm_cluster_config>` from scratch in the |tcm|
23+
web interface.
2324

2425
In both cases, you need to deploy Tarantool and start the cluster instances using
2526
the :ref:`tt-cli` or another suitable way.
2627

28+
To add a cluster to |tcm|, you can use either the |tcm| web interface as described on this page,
29+
or the ``initial-settings.clusters`` section of the |tcm| configuration. To learn
30+
more, see :ref:`tcm_configuration_initial`.
31+
2732
.. _tcm_connect_clusters_parameters:
2833

2934
Connection parameters

0 commit comments

Comments
 (0)