Configuration¶
One can configure the Sender service using one of the following ways:
- the Configurator service.
Run the Configurator service and edit Sender configurations using the GUI or the limitation file.
- the configuration file “config.conf”
Edit the file “./luna-sender/luna_sender/configs/config.conf”
Restart the Sender service after changing configurations if the service was already running.
All the service settings have the same names in the Configurator service and the “config.conf” file.
See more information about the service launching in section “Service launch”
Auto reload configuration¶
The service supports an auto-reload of configurations. You can enable this feature by specifying a config-reload option in the command line. The service periodically checks new settings. If current settings and new pulled settings are the same the service will not perform any actions. You can specify the check period in the pulling-time command line argument (10 seconds by default).
If a configuration fetching has failed, the service will work without applying any changes to the existing configurations.
If check connections with the new configuration have failed, the service will retry pulling new configuration after pulling-time seconds. The service will shut down after 10 failed attempts.
Warning
Service can work incorrectly while the new settings are being applied. It is strongly recommended not to send requests to the service when you change important settings (redis settings, work plugins list and others).
During configuration reload any existing HTTP connections to the service will be closed.
Configuration file for administrator¶
# LUNA Sender configuration file
[LUNA_CONFIGURATOR]
#: [integer] load configs from LUNA Configurator
USE_CONFIGURATOR = 0
#: [string] LUNA Configurator protocol, IP address, and port
LUNA_CONFIGURATOR_ORIGIN = http://127.0.0.1:5070
#: [integer] API version of the LUNA Configurator
LUNA_CONFIGURATOR_API = 1
[REDIS_DB_ADDRESS]
#: [string] Redis host for the service subscription
HOST = 127.0.0.1
#: [string] Redis port for the service subscription
PORT = 6379
#: [string] Redis password for the service subscription
PASSWORD =
#: [string] Redis channel for the service subscription
CHANNEL = luna-sender
[REDIS_DB_ADDRESS.SENTINEL]
#: [string] sentinel master name
MASTER_NAME = luna_sender_master
#: [list(string)] list of Redis Sentinel listeners (example [127.0.0.1:26379, 10.0.4.1:26379]).
#: By setting this parameter, application will query Redis parameters (host and port) from sentinels
SENTINELS = []
[LUNA_SENDER_LOGGER]
#: [string] folder, where logs are saved (relative path begins in directory with application)
FOLDER_WITH_LOGS = ./
#: [string] level of debug print, by priority: "ERROR", "WARNING", "INFO", "DEBUG"
LOG_LEVEL = INFO
#: [string] time format used in log records: "LOCAL" or "UTC"
LOG_TIME = LOCAL
#: [string] maximum log file size in megabytes before performing rotation (0 - without rotation)
MAX_LOG_FILE_SIZE = 1024
#: send log to stdout
LOG_TO_STDOUT = 1
#: send log to file
LOG_TO_FILE = 1
#: allow multiline stack trace in logs
MULTILINE_STACK_TRACE = 1
[INFLUX_MONITORING]
#: [integer] send data for monitoring to InfluxDB
SEND_DATA_FOR_MONITORING = 1
#: [string] InfluxDB 2.x workspace
ORGANIZATION =
#: [string] InfluxDB 2.x authentication token
TOKEN =
#: [string] InfluxDB 2.x bucket name
BUCKET = luna_monitoring
#: [string] InfluxDB IP address
HOST = 127.0.0.1
#: [integer] InfluxDB port
PORT = 8086
#: [integer] use HTTPS to connect to InfluxDB
USE_SSL = 0
#: [integer] frequency of sending monitoring data to InfluxDB (in seconds)
FLUSHING_PERIOD = 1
[OTHER]
#: [list(string)] list of active plugins
LUNA_SENDER_ACTIVE_PLUGINS = []
Extended administrator configuration¶
Module parses a config file and sets values in the global variables.
- configs.config.REDIS_COMMAND_TIMEOUT = 1¶
Redis command timeout (in seconds)
- configs.config.REDIS_PING_INTERVAL = 5¶
Redis ping interval (in seconds)
- configs.config.REDIS_RECONNECTION_DELAY = 1¶
Redis reconnection delay (in seconds)
- configs.config.REDIS_SUBSCRIBE_ATTEMPTS = 3¶
Redis subscribe attempts count
- configs.config.WSCODE_GOING_AWAY = 1001¶
WebSocket close code for going away