2021-05-21 13:47:08 +00:00
|
|
|
# Examples of correct configuration file structures
|
|
|
|
|
|
|
|
Here are files in all supported formats and with all possible configuration values
|
2023-02-03 14:59:15 +00:00
|
|
|
of FrostFS applications. See [node.yaml](node.yaml) for configuration notes.
|
2021-05-21 13:47:08 +00:00
|
|
|
|
|
|
|
All parameters are correct, however, they are for informational purposes only.
|
2021-07-29 14:57:17 +00:00
|
|
|
It is not recommended transferring these configs for real application launches.
|
2021-05-21 13:47:08 +00:00
|
|
|
|
|
|
|
## Config files
|
|
|
|
|
|
|
|
- Storage node
|
|
|
|
- JSON: `node.json`
|
2021-06-01 16:46:08 +00:00
|
|
|
- YAML: `node.yaml`
|
2022-05-11 07:36:24 +00:00
|
|
|
- Inner ring
|
|
|
|
- YAML: `ir.yaml`
|
|
|
|
- CLI
|
|
|
|
- YAML: `cli.yaml`
|
2021-06-01 16:46:08 +00:00
|
|
|
|
2023-02-06 13:53:16 +00:00
|
|
|
### Multiple configs
|
|
|
|
|
|
|
|
You can split your configuration to several files.
|
|
|
|
For example, you can use separate yaml file for each shard or each service (pprof, prometheus).
|
|
|
|
You must use `--config-dir` flag to process several configs:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
$ ./bin/frotsfs-node --config ./config/example/node.yaml --config-dir ./dir/with/additional/configs
|
|
|
|
```
|
|
|
|
|
|
|
|
When the `--config-dir` flag set, the application:
|
|
|
|
* reads all `*.y[a]ml` files from provided directory,
|
|
|
|
* use Viper's [MergeConfig](https://pkg.go.dev/github.com/spf13/viper#MergeConfig) functionality to produce the final configuration,
|
2023-02-06 14:54:49 +00:00
|
|
|
* files are being processing in alphanumerical order so that `01.yaml` may be extended with contents of `02.yaml`, so
|
|
|
|
if a field is specified in multiple files, the latest occurrence takes effect.
|
2023-02-06 13:53:16 +00:00
|
|
|
|
|
|
|
So if we have the following files:
|
|
|
|
```yaml
|
|
|
|
# 00.yaml
|
|
|
|
logger:
|
|
|
|
level: debug
|
|
|
|
pprof:
|
|
|
|
enabled: true
|
|
|
|
address: localhost:6060
|
|
|
|
prometheus:
|
|
|
|
enabled: true
|
|
|
|
address: localhost:9090
|
|
|
|
```
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
# dir/01.yaml
|
|
|
|
logger:
|
|
|
|
level: info
|
|
|
|
pprof:
|
|
|
|
enabled: false
|
|
|
|
```
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
# dir/02.yaml
|
|
|
|
logger:
|
|
|
|
level: warn
|
|
|
|
prometheus:
|
|
|
|
address: localhost:9091
|
|
|
|
```
|
|
|
|
|
|
|
|
and provide the following flags:
|
|
|
|
```shell
|
|
|
|
$ ./bin/frotsfs-node --config 00.yaml --config-dir dir
|
|
|
|
```
|
|
|
|
|
|
|
|
result config will be:
|
|
|
|
```yaml
|
|
|
|
logger:
|
|
|
|
level: warn
|
|
|
|
pprof:
|
|
|
|
enabled: false
|
|
|
|
address: localhost:6060
|
|
|
|
prometheus:
|
|
|
|
enabled: true
|
|
|
|
address: localhost:9091
|
|
|
|
```
|
|
|
|
|
2021-06-01 16:46:08 +00:00
|
|
|
## Environment variables
|
|
|
|
|
2022-05-11 07:36:24 +00:00
|
|
|
- Storage node: `node.env`
|
2023-02-03 14:59:15 +00:00
|
|
|
- Inner ring: `ir.env`
|