Configuration
The key artifact that defines the tt
environment and various aspects of its
execution is its configuration file.
By default, the configuration file is called tt.yaml
. The location
where tt
searches for it depends on the launch mode.
You can also pass the configuration file explicitly in the --cfg
argument.
The tt
configuration file is a YAML file with the following content:
tt:
modules:
directory: path/to/modules/dir
app:
instances_enabled: path/to/applications
run_dir: path/to/run_dir
log_dir: path/to/log_dir
bin_dir: path/to/bin_dir
inc_dir: path/to/inc_dir
wal_dir: path/to/wal_dir
vinyl_dir: path/to/vinyl_dir
memtx_dir: path/to/memtx_dir
log_maxsize: num (MB)
log_maxage: num (days)
log_maxbackups: num
restart_on_failure: bool
repo:
rocks: path/to/rocks
distfiles: path/to/install
ee:
credential_path: path/to/file
templates:
- path: path/to/app/templates1
- path: path/to/app/templates2
directory
– the directory where external modules are stored.
instances_enabled
– the directory where instances are stored.run_dir
– the directory for instance runtime artifacts, such as console sockets or PID files. Default:var/run
.log_dir
– the directory where log files are stored. Default:var/log
.bin_dir
– the directory where binary files are stored. Default:bin
.inc_dir
– the base directory for storing header files. They will be placed in theinclude
subdirectory inside the specified directory. Default:include
.wal_dir
– the directory where write-ahead log (.xlog
) files are stored. Default:var/lib
.memtx_dir
– the directory where memtx stores snapshot (.snap
) files. Default:var/lib
.vinyl_dir
– the directory where vinyl files or subdirectories are stored. Default:var/lib
.log_maxsize
– the maximum size of the log file before it gets rotated, in megabytes. Default: 100.log_maxage
– the maximum age of log files in days. The age of a log file is defined by the timestamp encoded in its name. Default: not defined (log files aren’t deleted based on their age).Примечание
A day is defined as exactly 24 hours. It may not exactly correspond to calendar days due to daylight savings, leap seconds, and other time adjustments.
log_maxbackups
– the maximum number of stored log files. Default: not defined (log files aren’t deleted based on their count).restart_on_failure
– restart the instance on failure:true
orfalse
. Default:false
.
rocks
– the directory where rocks files are stored.distfiles
– the directory where installation files are stored.
credential_path
– a path to the file file with credentials used for downloading Tarantool Enterprise.
path
– a path to application templates used for creating applications with tt create. May be specified more than once.
tt
launch mode defines its working directory and the way it searches for the
configuration file. There are three launch modes:
- default
- system
- local
Argument: none
Configuration file: searched from the current directory to the root.
Taken from /etc/tarantool
if the file is not found.
Working directory: The directory where the configuration file is found.
Argument: --system
or -S
Configuration file: Taken from /etc/tarantool
.
Working directory: Current directory.
Argument: --local=DIRECTORY
or -L=DIRECTORY
Configuration file: Searched from the specified directory to the root.
Taken from /etc/tarantool
if the file is not found.
Working directory: The specified directory. If tarantool
or tt
executable files are found in the working directory, they will be used.