Run third-party services#
This section describes the launching of databases in docker containers. They must be launched before environment preparation and LP services.
Monitoring services#
LUNA PLATFORM's monitoring services include InfluxDB (used by default), ClickHouse, and Prometheus. Instructions for starting InfluxDB and ClickHouse databases are provided below.
For information on selecting a database for monitoring and working with Prometheus, see the "Monitoring" section of the Administrator's Guide.
If necessary, you can configure the visualization of monitoring data using the LUNA Dashboards service, which includes a configured Grafana data visualization system. In addition, you can launch the Grafana Loki tool for advanced work with logs. See the instructions for launching LUNA Dashboards and Grafana Loki in the "Monitoring and logs visualization using Grafana" section.
InfluxDB#
Monitoring LUNA PLATFORM services requires running the Influx 2.0.8-alpine database. Below are the commands to launch the InfluxDB container.
For more information, see the "Monitoring" section in the administrator manual.
Note: If necessary, you can use an external InfluxDB 2.0.8-alpine. In this case, you can skip the command below, but you will have to set custom settings for each LUNA PLATFORM service.
Use the docker run
command with these parameters:
docker run \
-e DOCKER_INFLUXDB_INIT_MODE=setup \
-e DOCKER_INFLUXDB_INIT_BUCKET=default \
-e DOCKER_INFLUXDB_INIT_USERNAME=luna \
-e DOCKER_INFLUXDB_INIT_PASSWORD=password \
-e DOCKER_INFLUXDB_INIT_ORG=luna \
-e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=kofqt4Pfqjn6o0RBtMDQqVoJLgHoxxDUmmhiAZ7JS6VmEnrqZXQhxDhad8AX9tmiJH6CjM7Y1U8p5eSEocGzIA== \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/luna/influx:/var/lib/influxdb2 \
--restart=always \
--detach=true \
--network=host \
--name influxdb \
dockerhub.visionlabs.ru/luna/influxdb:2.0.8-alpine
The command above creates a default bucket. The bucket for storing monitoring data LUNA PLATFORM will be created during the environment preparation step using the Storages utility.
ClickHouse#
Below is the command to start the ClickHouse container.
For more information, see the "Monitoring" section of the administrator guide.
Note: You can use an external ClickHouse database if needed. In this case, you can skip the command below, but you will need to configure custom settings for each LUNA PLATFORM service.
Use the docker run
command with the following parameters:
docker run \
-e CLICKHOUSE_USER=luna \
-e CLICKHOUSE_PASSWORD=password \
-v /var/lib/luna/clickhouse/data:/var/lib/clickhouse \
-v /var/lib/luna/clickhouse/logs:/var/log/clickhouse-server \
-v /var/lib/luna/current/extras/conf/clickhouse_config.xml:/etc/clickhouse-server/config.xml \
--name=clickhouse \
--network=host \
--restart=always \
--detach=true \
--health-cmd="wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1" \
dockerhub.visionlabs.ru/luna/clickhouse-server:v.25.4.0
The command above is used to start ClickHouse. The database for storing monitoring data, LUNA PLATFORM, will be created during the environment preparation step using the Storages utility.
After running the startup command, follow the steps below to ensure the environment is properly prepared.
1․ Open the Storages configuration file:
vi /var/lib/luna/current/extras/conf/storages_config.conf
and set the necessary settings for ClickHouse in the LUNA_MONITORING
section. Example:
STORAGE_TYPE = clickhouse
SEND_DATA_FOR_MONITORING = 1
HOST = 127.0.0.1
PORT = 9000
HTTP_PORT = 8123
DB_USER = luna
DB_PASSWORD = password
DB_NAME = luna_monitoring
USE_SSL = 0
FLUSHING_PERIOD = 1
2․ Edit the "LUNA_MONITORING" section in the LUNA PLATFORM settings to tell the system which monitoring database to use for all services (except the Configurator service).
You can load the settings using a dump file before starting LUNA PLATFORM:
vi /var/lib/luna/current/extras/conf/platform_settings.json
Since the Configurator service's settings are stored in its
config.conf
configuration file, to configure monitoring for this service, you must edit this file before launching the container. See the "Configurator" section.
PostgreSQL#
Note: If necessary, you can use an external PostgreSQL database. In this case, you can skip the command below and perform the actions from the section "External PostgreSQL configuration".
Use the following command to launch PostgreSQL.
docker run \
--env=POSTGRES_USER=luna \
--env=POSTGRES_PASSWORD=luna \
--shm-size=1g \
-v /var/lib/luna/postgresql/data/:/var/lib/postgresql/data/ \
-v /etc/localtime:/etc/localtime:ro \
--name=postgres \
--restart=always \
--detach=true \
--network=host \
--health-cmd="pg_isready -U luna -d postgres" \
dockerhub.visionlabs.ru/luna/postgis-vlmatch:16.1
-v /var/lib/luna/current/example-docker/postgresql/data/:/var/lib/postgresql/data/
— The volume command enables you to mount the "data" folder to the PostgreSQL container. The folder on the server and the folder in the container will be synchronized. The PostgreSQL data from the container will be saved to this directory.
--network=host
— If you need to change the port for PotgreSQL, you should change this string to -p 5440:5432
. Where the first port 5440
is the local port and 5432
is the port used inside the container.
You should create all the databases for LP services manually if you are going to use an already installed PostgreSQL.
Redis#
Note: If you already have Redis installed, skip this step.
Note: It is recommended that you set a password when starting Redis for increased security. This can be done, for example, using the requirepass
parameter in the Redis configuration file, or passing the password via the Redis CLI. Next, you need to specify the password in the corresponding service settings, for example, in the "password" parameter of the "LUNA_ATTRIBUTES_DB" section of the Events service. See the official Redis documentation for more details.
Use the following command to launch Redis.
docker run \
-v /etc/localtime:/etc/localtime:ro \
--name=redis \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/redis:7.2 \
redis-server --requirepass lunapass