Configuration
Enterprise Edition
Tarantool Cluster Manager is a part of the Enterprise Edition.
This topic describes how to configure Tarantool Cluster Manager. For the complete list of TCM configuration parameters, see the TCM configuration reference.
Tarantool Cluster Manager configuration is a set of parameters that define various aspects of TCM functioning. Parameters are grouped by the particular aspect that they affect. There are the following groups:
- HTTP
- logging
- configuration storage
- security
- add-ons
- limits
- TCM running mode
Parameter groups can be nested. For example, in the http
group there are
tls
and websession-cookie
groups, which define TLS encryption and
cookie settings.
Parameter names are the full paths from the top-level group to the specific parameter. For example:
http.host
is thehost
parameter that is defined directly in thehttp
group.http.tls.enabled
is theenabled
parameter that is defined in thetls
nested group withinhttp
.
There are three ways to pass TCM configuration parameters:
- a YAML file
- environment variables
- command-line options of the TCM executable
TCM configuration can be stored in a YAML file. Its structure must reflect the configuration parameters hierarchy.
The example below shows a fragment of a TCM configuration file:
# a fragment of a YAML configuration file
cluster: # top-level group
on-air-limit: 4096
connection-rate-limit: 512
tarantool-timeout: 10s
tarantool-ping-timeout: 5s
http: # top-level group
basic-auth: # nested group
enabled: false
network: tcp
host: 127.0.0.1
port: 8080
request-size: 1572864
websocket: # nested group
read-buffer-size: 16384
write-buffer-size: 16384
keepalive-ping-interval: 20s
handshake-timeout: 10s
init-timeout: 15s
To start TCM with a YAML configuration, pass the location of the configuration
file in the -c
command-line option:
tcm -c=config.yml
TCM can take values of its configuration parameters from environment variables.
The variable names start with TCM_
. Then goes the full path to the parameter,
converted to upper case. All delimiters are replaced with underscores (_
).
Examples:
TCM_HTTP_HOST
is a variable for thehttp.host
parameter.TCM_HTTP_WEBSESSION_COOKIE_NAME
is a variable for thehttp.websession-cookie.name
parameter.
The example below shows how to start TCM with configuration parameters passed in environment variables:
export TCM_HTTP_HOST=0.0.0.0
export TCM_HTTP_PORT=8888
tcm
The TCM executable has --
command-line options for each configuration parameter.
Their names reflect the full path to the parameter, with all delimiters replaced by
hyphens (-
). Examples:
--http-host
is an option forhttp.host
.--http-websession-cookie-name
is an option forhttp.websession-cookie.name
.
The example below shows how to start TCM with configuration parameters passed in command-line options:
./tcm --storage.etcd.embed.enabled --addon.enabled --http.host=0.0.0.0 --http.port=8888
TCM configuration options are applied from multiple sources with the following precedence, from highest to lowest:
tcm
executable arguments.TCM_*
environment variables.- Configuration from a YAML file.
If the same option is defined in two or more locations, the option with the highest precedence is applied. For options that aren’t defined in any location, the default values are used.
You can combine different ways of TCM configuration for efficient management of multiple TCM installations:
- A single YAML file for all installations can contain the common configuration parts. For example, a single configuration storage that is used for all installations, or TLS settings.
- Environment variables that set specific parameters for each server, such as local directories and paths.
- Command-line options for parameters that must be unique for different TCM instances
running on a single server. For example,
http.port
.
TCM configuration parameters have the Go language types. Note that this is different from the Tarantool configuration parameters, which have Lua types.
Most options have the Go’s basic types: int
and other numeric types, bool
, string
.
http:
basic-auth:
enabled: false # bool
network: tcp # string
host: 127.0.0.1 # string
port: 8080 # int
request-size: 1572864 # int64
Parameters that can take multiple values are arrays. In YAML, they are passed as YAML arrays: each item on a new line, starting with a dash.
storage:
provider: etcd
etcd:
endpoints: # array
- https://192.168.0.1:2379 # item 1
- https://192.168.0.2:2379 # item 2
Note
In environment variables and command line options, such arrays are passed as semicolon-separated strings of items.
Parameters that set timeouts, TTLs, and other duration values, have the Go’s time.Duration
type. Their values can be passed in time-formatted strings such as 4h30m25s
.
cluster:
tarantool-timeout: 10s # duration
tarantool-ping-timeout: 5s # duration
Finally, there are parameters whose values are constants defined in Go packages. For example, http.websession-cookie.same-site values are constants from the Go’s http.SameSite type. To find out the exact values available for such parameters, refer to the Go packages documentation.
http:
websession-cookie:
same-site: SameSiteStrictMode