Дерево страниц
Перейти к концу метаданных
Переход к началу метаданных

С версии SoftWLC 1.27 БД сервиса eltex-bruce перенесена в СУБД MariaDB. Если выполняется обновление с предыдущих версий SoftWLC необходимо выполнить миграцию данных БД.


Описание


Сервис eltex-bruce выполняет роль менеджера задач для сервиса eltex-jobs - формирует задачи и отслеживает статус их выполнения. Параметры задач хранятся в базе данных MariaDB


Установка


Сервис устанавливается с помощью пакетного менеджера командой

apt install eltex-bruce

Настройка


Конфигурационный файл для настройки доступен по пути /etc/eltex-bruce/application.properties

# порт используемый сервисом
server.port=8008

# ip-адрес сервиса eltex-jobs
server.address.jobs=http://localhost:9696

# название базы данных и данные подключения, в которой ELTEX-BRUCE будет хранить данные
spring.datasource.url=jdbc:mysql://localhost:3306/eltex_bruce
spring.datasource.username=javauser
spring.datasource.password=javapassword
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.flyway.url=${spring.datasource.url}
spring.flyway.user=${spring.datasource.username}
spring.flyway.password=${spring.datasource.password}

#Quartz
spring.quartz.job-store-type=jdbc
spring.quartz.properties.quartz.jdbc.initialize-schema=never

spring.quartz.properties.org.quartz.scheduler.instanceName=jobs-quartz
spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO

spring.quartz.properties.org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
spring.quartz.properties.org.quartz.jobStore.useProperties=false
spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_
spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval=20000
spring.quartz.properties.org.quartz.jobStore.misfireThreshold=12000000000
spring.quartz.properties.org.quartz.jobStore.isClustered=false
spring.quartz.properties.org.quartz.jobStore.dataSource=quartzDataSource

spring.quartz.properties.org.quartz.dataSource.quartzDataSource.provider=hikaricp
spring.quartz.properties.org.quartz.dataSource.quartzDataSource.driver=${spring.datasource.driver-class-name}
spring.quartz.properties.org.quartz.dataSource.quartzDataSource.URL=${spring.datasource.url}
spring.quartz.properties.org.quartz.dataSource.quartzDataSource.user=${spring.datasource.username}
spring.quartz.properties.org.quartz.dataSource.quartzDataSource.password=${spring.datasource.password}

spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
spring.quartz.properties.org.quartz.threadPool.threadCount=10
spring.quartz.properties.org.quartz.threadPool.threadPriority=5

management.health.defaults.enabled=true
management.endpoints.web.exposure.include=health, beans, prometheus, env, threaddump, heapdump, metrics, httptrace
management.endpoint.health.enabled=true


Файл настройки инициализации сервиса /etc/default/eltex-bruce

# Scheduling service

# HTTP Port for use by Eltex Bruce  -- порт, использующийся сервисом
PORT=8008

# Initial size of Java heap -- выделение оперативной памяти для инициализации
JAVA_INIT_HEAP=32m
# Maximum size of Java heap -- ограничение потребления оперативной памяти для java-приложения
JAVA_MAX_HEAP=256m

# Additional arguments to pass to java -- Дополнительные аргументы для запуска java-приложения
JAVA_OPTS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/eltex-bruce

Управление сервисом


ДействиеКомандаОтвет
Проверка состоянияservice eltex-bruce status

Сервис запущен:

Active: active (running)

Cервис не запущен:

Active: failed

Запуск сервисаservice eltex-bruce start

Сервис успешно запущен:

Active: active (running)

Остановка сервисаservice eltex-bruce stop

Сервис успешно остановлен:

Active: failed

Перезапуск сервисаservice eltex-bruce restart

Сервис успешно перезапущен:

Active: active (running)

Мониторинг

Метрики сервиса доступны по ссылке:

http://<IP-адрес сервиса>:8008/actuator/prometheus
Пример вывода метрик
# HELP jvm_buffer_memory_used_bytes An estimate of the memory that the Java virtual machine is using for this buffer pool
# TYPE jvm_buffer_memory_used_bytes gauge
jvm_buffer_memory_used_bytes{application="bruce",id="direct",} 2039809.0
jvm_buffer_memory_used_bytes{application="bruce",id="mapped",} 0.0
# HELP hikaricp_connections_usage_seconds Connection usage time
# TYPE hikaricp_connections_usage_seconds summary
hikaricp_connections_usage_seconds_count{application="bruce",pool="HikariPool-1",} 12.0
hikaricp_connections_usage_seconds_sum{application="bruce",pool="HikariPool-1",} 0.588
# HELP hikaricp_connections_usage_seconds_max Connection usage time
# TYPE hikaricp_connections_usage_seconds_max gauge
hikaricp_connections_usage_seconds_max{application="bruce",pool="HikariPool-1",} 0.0
# HELP jvm_buffer_count_buffers An estimate of the number of buffers in the pool
# TYPE jvm_buffer_count_buffers gauge
jvm_buffer_count_buffers{application="bruce",id="direct",} 13.0
jvm_buffer_count_buffers{application="bruce",id="mapped",} 0.0
# HELP jvm_gc_pause_seconds Time spent in GC pause
# TYPE jvm_gc_pause_seconds summary
jvm_gc_pause_seconds_count{action="end of major GC",application="bruce",cause="Metadata GC Threshold",} 1.0
jvm_gc_pause_seconds_sum{action="end of major GC",application="bruce",cause="Metadata GC Threshold",} 0.099
jvm_gc_pause_seconds_count{action="end of minor GC",application="bruce",cause="Metadata GC Threshold",} 1.0
jvm_gc_pause_seconds_sum{action="end of minor GC",application="bruce",cause="Metadata GC Threshold",} 0.021
jvm_gc_pause_seconds_count{action="end of minor GC",application="bruce",cause="Allocation Failure",} 3.0
jvm_gc_pause_seconds_sum{action="end of minor GC",application="bruce",cause="Allocation Failure",} 0.09
# HELP jvm_gc_pause_seconds_max Time spent in GC pause
# TYPE jvm_gc_pause_seconds_max gauge
jvm_gc_pause_seconds_max{action="end of major GC",application="bruce",cause="Metadata GC Threshold",} 0.0
jvm_gc_pause_seconds_max{action="end of minor GC",application="bruce",cause="Metadata GC Threshold",} 0.0
jvm_gc_pause_seconds_max{action="end of minor GC",application="bruce",cause="Allocation Failure",} 0.0
# HELP hikaricp_connections_creation_seconds_max Connection creation time
# TYPE hikaricp_connections_creation_seconds_max gauge
hikaricp_connections_creation_seconds_max{application="bruce",pool="HikariPool-1",} 0.0
# HELP hikaricp_connections_creation_seconds Connection creation time
# TYPE hikaricp_connections_creation_seconds summary
hikaricp_connections_creation_seconds_count{application="bruce",pool="HikariPool-1",} 30.0
hikaricp_connections_creation_seconds_sum{application="bruce",pool="HikariPool-1",} 1.139
# HELP jdbc_connections_min Minimum number of idle connections in the pool.
# TYPE jdbc_connections_min gauge
jdbc_connections_min{application="bruce",name="dataSource",} 10.0
# HELP jetty_threads_idle The number of idle threads in the pool
# TYPE jetty_threads_idle gauge
jetty_threads_idle{application="bruce",} 4.0
# HELP hikaricp_connections_idle Idle connections
# TYPE hikaricp_connections_idle gauge
hikaricp_connections_idle{application="bruce",pool="HikariPool-1",} 10.0
# HELP jetty_threads_current The total number of threads in the pool
# TYPE jetty_threads_current gauge
jetty_threads_current{application="bruce",} 8.0
# HELP process_files_open_files The open file descriptor count
# TYPE process_files_open_files gauge
process_files_open_files{application="bruce",} 169.0
# HELP system_cpu_count The number of processors available to the Java virtual machine
# TYPE system_cpu_count gauge
system_cpu_count{application="bruce",} 2.0
# HELP hikaricp_connections_min Min connections
# TYPE hikaricp_connections_min gauge
hikaricp_connections_min{application="bruce",pool="HikariPool-1",} 10.0
# HELP jvm_memory_committed_bytes The amount of memory in bytes that is committed for the Java virtual machine to use
# TYPE jvm_memory_committed_bytes gauge
jvm_memory_committed_bytes{application="bruce",area="heap",id="PS Old Gen",} 8.4410368E7
jvm_memory_committed_bytes{application="bruce",area="nonheap",id="Metaspace",} 8.8162304E7
jvm_memory_committed_bytes{application="bruce",area="heap",id="PS Eden Space",} 2.60571136E8
jvm_memory_committed_bytes{application="bruce",area="heap",id="PS Survivor Space",} 1.1534336E7
jvm_memory_committed_bytes{application="bruce",area="nonheap",id="Code Cache",} 2.0119552E7
jvm_memory_committed_bytes{application="bruce",area="nonheap",id="Compressed Class Space",} 1.214464E7
# HELP jetty_threads_jobs Number of jobs queued waiting for a thread
# TYPE jetty_threads_jobs gauge
jetty_threads_jobs{application="bruce",} 0.0
# HELP jvm_gc_max_data_size_bytes Max size of long-lived heap memory pool
# TYPE jvm_gc_max_data_size_bytes gauge
jvm_gc_max_data_size_bytes{application="bruce",} 1.04333312E9
# HELP jvm_classes_unloaded_classes_total The total number of classes unloaded since the Java virtual machine has started execution
# TYPE jvm_classes_unloaded_classes_total counter
jvm_classes_unloaded_classes_total{application="bruce",} 0.0
# HELP system_load_average_1m The sum of the number of runnable entities queued to available processors and the number of runnable entities running on the available processors averaged over a period of time
# TYPE system_load_average_1m gauge
system_load_average_1m{application="bruce",} 0.23583984375
# HELP jvm_gc_memory_allocated_bytes_total Incremented for an increase in the size of the (young) heap memory pool after one GC to before the next
# TYPE jvm_gc_memory_allocated_bytes_total counter
jvm_gc_memory_allocated_bytes_total{application="bruce",} 6.48704776E8
# HELP hikaricp_connections_pending Pending threads
# TYPE hikaricp_connections_pending gauge
hikaricp_connections_pending{application="bruce",pool="HikariPool-1",} 0.0
# HELP jetty_threads_busy The number of busy threads in the pool
# TYPE jetty_threads_busy gauge
jetty_threads_busy{application="bruce",} 3.0
# HELP jvm_threads_peak_threads The peak live thread count since the Java virtual machine started or peak was reset
# TYPE jvm_threads_peak_threads gauge
jvm_threads_peak_threads{application="bruce",} 33.0
# HELP bruce_sent_jobs_count_total Number of jobs sent to eltex-jobs by status
# TYPE bruce_sent_jobs_count_total counter
bruce_sent_jobs_count_total{application="bruce",status="ok",} 1.0
# HELP jvm_classes_loaded_classes The number of classes that are currently loaded in the Java virtual machine
# TYPE jvm_classes_loaded_classes gauge
jvm_classes_loaded_classes{application="bruce",} 16149.0
# HELP jdbc_connections_idle Number of established but idle connections.
# TYPE jdbc_connections_idle gauge
jdbc_connections_idle{application="bruce",name="dataSource",} 10.0
# HELP jvm_gc_live_data_size_bytes Size of long-lived heap memory pool after reclamation
# TYPE jvm_gc_live_data_size_bytes gauge
jvm_gc_live_data_size_bytes{application="bruce",} 2.495736E7
# HELP jvm_gc_memory_promoted_bytes_total Count of positive increases in the size of the old generation memory pool before GC to after GC
# TYPE jvm_gc_memory_promoted_bytes_total counter
jvm_gc_memory_promoted_bytes_total{application="bruce",} 1.8533312E7
# HELP hikaricp_connections Total connections
# TYPE hikaricp_connections gauge
hikaricp_connections{application="bruce",pool="HikariPool-1",} 10.0
# HELP jvm_memory_used_bytes The amount of used memory
# TYPE jvm_memory_used_bytes gauge
jvm_memory_used_bytes{application="bruce",area="heap",id="PS Old Gen",} 3.3943744E7
jvm_memory_used_bytes{application="bruce",area="nonheap",id="Metaspace",} 8.3242464E7
jvm_memory_used_bytes{application="bruce",area="heap",id="PS Eden Space",} 1.5821104E7
jvm_memory_used_bytes{application="bruce",area="heap",id="PS Survivor Space",} 1.1035184E7
jvm_memory_used_bytes{application="bruce",area="nonheap",id="Code Cache",} 1.9878592E7
jvm_memory_used_bytes{application="bruce",area="nonheap",id="Compressed Class Space",} 1.12836E7
# HELP hikaricp_connections_acquire_seconds Connection acquire time
# TYPE hikaricp_connections_acquire_seconds summary
hikaricp_connections_acquire_seconds_count{application="bruce",pool="HikariPool-1",} 12.0
hikaricp_connections_acquire_seconds_sum{application="bruce",pool="HikariPool-1",} 0.005794486
# HELP hikaricp_connections_acquire_seconds_max Connection acquire time
# TYPE hikaricp_connections_acquire_seconds_max gauge
hikaricp_connections_acquire_seconds_max{application="bruce",pool="HikariPool-1",} 0.0
# HELP jetty_threads_config_max The maximum number of threads in the pool
# TYPE jetty_threads_config_max gauge
jetty_threads_config_max{application="bruce",} 200.0
# HELP bruce_schedule_attempts_count_total Number of attempts to schedule a job by status
# TYPE bruce_schedule_attempts_count_total counter
bruce_schedule_attempts_count_total{application="bruce",status="ok",} 1.0
# HELP jvm_threads_daemon_threads The current number of live daemon threads
# TYPE jvm_threads_daemon_threads gauge
jvm_threads_daemon_threads{application="bruce",} 6.0
# HELP log4j2_events_total Number of fatal level log events
# TYPE log4j2_events_total counter
log4j2_events_total{application="bruce",level="info",} 49.0
log4j2_events_total{application="bruce",level="debug",} 0.0
log4j2_events_total{application="bruce",level="fatal",} 0.0
log4j2_events_total{application="bruce",level="error",} 0.0
log4j2_events_total{application="bruce",level="warn",} 1.0
log4j2_events_total{application="bruce",level="trace",} 0.0
# HELP jvm_buffer_total_capacity_bytes An estimate of the total capacity of the buffers in this pool
# TYPE jvm_buffer_total_capacity_bytes gauge
jvm_buffer_total_capacity_bytes{application="bruce",id="direct",} 2039809.0
jvm_buffer_total_capacity_bytes{application="bruce",id="mapped",} 0.0
# HELP hikaricp_connections_timeout_total Connection timeout total count
# TYPE hikaricp_connections_timeout_total counter
hikaricp_connections_timeout_total{application="bruce",pool="HikariPool-1",} 0.0
# HELP jetty_threads_config_min The minimum number of threads in the pool
# TYPE jetty_threads_config_min gauge
jetty_threads_config_min{application="bruce",} 8.0
# HELP process_uptime_seconds The uptime of the Java virtual machine
# TYPE process_uptime_seconds gauge
process_uptime_seconds{application="bruce",} 5572.588
# HELP jdbc_connections_max Maximum number of active connections that can be allocated at the same time.
# TYPE jdbc_connections_max gauge
jdbc_connections_max{application="bruce",name="dataSource",} 10.0
# HELP jvm_threads_states_threads The current number of threads having NEW state
# TYPE jvm_threads_states_threads gauge
jvm_threads_states_threads{application="bruce",state="runnable",} 5.0
jvm_threads_states_threads{application="bruce",state="new",} 0.0
jvm_threads_states_threads{application="bruce",state="blocked",} 0.0
jvm_threads_states_threads{application="bruce",state="waiting",} 2.0
jvm_threads_states_threads{application="bruce",state="timed-waiting",} 22.0
jvm_threads_states_threads{application="bruce",state="terminated",} 0.0
# HELP process_start_time_seconds Start time of the process since unix epoch.
# TYPE process_start_time_seconds gauge
process_start_time_seconds{application="bruce",} 1.687946838071E9
# HELP system_cpu_usage The "recent cpu usage" for the whole system
# TYPE system_cpu_usage gauge
system_cpu_usage{application="bruce",} 0.0
# HELP hikaricp_connections_max Max connections
# TYPE hikaricp_connections_max gauge
hikaricp_connections_max{application="bruce",pool="HikariPool-1",} 10.0
# HELP bruce_fired_jobs_count_total Number of attempts to fire a scheduled job by status
# TYPE bruce_fired_jobs_count_total counter
bruce_fired_jobs_count_total{application="bruce",status="ok",} 1.0
# HELP jvm_memory_max_bytes The maximum amount of memory in bytes that can be used for memory management
# TYPE jvm_memory_max_bytes gauge
jvm_memory_max_bytes{application="bruce",area="heap",id="PS Old Gen",} 1.04333312E9
jvm_memory_max_bytes{application="bruce",area="nonheap",id="Metaspace",} -1.0
jvm_memory_max_bytes{application="bruce",area="heap",id="PS Eden Space",} 4.89160704E8
jvm_memory_max_bytes{application="bruce",area="heap",id="PS Survivor Space",} 1.1534336E7
jvm_memory_max_bytes{application="bruce",area="nonheap",id="Code Cache",} 2.5165824E8
jvm_memory_max_bytes{application="bruce",area="nonheap",id="Compressed Class Space",} 1.073741824E9
# HELP http_server_requests_seconds  
# TYPE http_server_requests_seconds summary
http_server_requests_seconds_count{application="bruce",exception="None",method="POST",outcome="SUCCESS",status="204",uri="/scheduler/create",} 1.0
http_server_requests_seconds_sum{application="bruce",exception="None",method="POST",outcome="SUCCESS",status="204",uri="/scheduler/create",} 0.253836689
http_server_requests_seconds_count{application="bruce",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/scheduler/jobs/all",} 2.0
http_server_requests_seconds_sum{application="bruce",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/scheduler/jobs/all",} 0.04322108
http_server_requests_seconds_count{application="bruce",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/scheduler/status/failed",} 3.0
http_server_requests_seconds_sum{application="bruce",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/scheduler/status/failed",} 0.05677979
http_server_requests_seconds_count{application="bruce",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/scheduler/all",} 5.0
http_server_requests_seconds_sum{application="bruce",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/scheduler/all",} 0.450983973
# HELP http_server_requests_seconds_max  
# TYPE http_server_requests_seconds_max gauge
http_server_requests_seconds_max{application="bruce",exception="None",method="POST",outcome="SUCCESS",status="204",uri="/scheduler/create",} 0.0
http_server_requests_seconds_max{application="bruce",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/scheduler/jobs/all",} 0.0
http_server_requests_seconds_max{application="bruce",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/scheduler/status/failed",} 0.0
http_server_requests_seconds_max{application="bruce",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/scheduler/all",} 0.0
# HELP jvm_threads_live_threads The current number of live threads including both daemon and non-daemon threads
# TYPE jvm_threads_live_threads gauge
jvm_threads_live_threads{application="bruce",} 29.0
# HELP process_cpu_usage The "recent cpu usage" for the Java Virtual Machine process
# TYPE process_cpu_usage gauge
process_cpu_usage{application="bruce",} 0.0
# HELP jdbc_connections_active Current number of active connections that have been allocated from the data source.
# TYPE jdbc_connections_active gauge
jdbc_connections_active{application="bruce",name="dataSource",} 0.0
# HELP process_files_max_files The maximum file descriptor count
# TYPE process_files_max_files gauge
process_files_max_files{application="bruce",} 1048576.0
# HELP hikaricp_connections_active Active connections
# TYPE hikaricp_connections_active gauge
hikaricp_connections_active{application="bruce",pool="HikariPool-1",} 0.0

Пример настройки подключения Prometheus:

scrape_configs:
  - job_name: 'bruce'
    metrics_path: '/actuator/prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: ['<IP-адрес сервиса>:8008']

Докеризация сервиса


Сервис может быть запущен в docker-контейнере. Для этого необходимо подготовить файл с переменными окружения .env и docker-compose.yml.

docker-compose.yaml
version: "3"
services:
  eltex-bruce:
    ports:
      - "8008:${SERVER_PORT}"
    container_name: eltex-bruce
    image: ${ELTEX_HUB}/eltex-bruce:${SWLC_VERSION}
    environment:         
      - TZ=${TZ}
      # Настроить порт внутри контейнера. По-умолчанию 8008
      - SERVER_PORT=${SERVER_PORT}
      # Настроить адрес сервиса Jobs. Можно также объединить в один compose и создать одну сеть для сервисов.
      - SERVER_ADDRESS_JOBS=${SERVER_ADDRESS_JOBS}
      - SPRING_QUARTZ_JOBSTORETYPE=${SPRING_QUARTZ_JOBSTORETYPE}
      # Настроить адрес Mysql.
      - SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL}
      - SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME}
      - SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD}
      - SPRING_DATASOURCE_DRIVERCLASSNAME=${SPRING_DATASOURCE_DRIVERCLASSNAME}
      # Настроить flyway.
      - SPRING_FLYWAY_URL=${SPRING_FLYWAY_URL}
      - SPRING_FLYWAY_USER=${SPRING_FLYWAY_USER}
      - SPRING_FLYWAY_PASSWORD=${SPRING_FLYWAY_PASSWORD}
      # Настроить Quartz
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_SCHEDULER_INSTANCENAME=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_SCHEDULER_INSTANCENAME}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_SCHEDULER_INSTANCEID=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_SCHEDULER_INSTANCEID}

      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_CLASS=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_CLASS}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_DRIVERDELEGATECLASS=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_DRIVERDELEGATECLASS}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_USEPROPERTIES=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_USEPROPERTIES}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_TABLEPREFIX=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_TABLEPREFIX}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_CLUSTERCHECKININTERVAL=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_CLUSTERCHECKININTERVAL}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_MISFIRETHRESHOLD=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_MISFIRETHRESHOLD}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_ISCLUSTERED=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_ISCLUSTERED}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_DATASOURCE=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_DATASOURCE}

      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_PROVIDER=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_PROVIDER}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_DRIVER=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_DRIVER}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_URL=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_URL}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_USER=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_USER}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_PASSWORD=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_PASSWORD}

      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_CLASS=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_CLASS}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_THREADCOUNT=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_THREADCOUNT}
      - SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_THREADPRIORITY=${SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_THREADPRIORITY}
      # Настройка логгирования
      - BRUCE_LOG_LEVEL=${BRUCE_LOG_LEVEL}
      - BRUCE_CONSOLE_LEVEL=${BRUCE_CONSOLE_LEVEL}
      # Настройка перенаправления логов в Graylog
      - GELF_HOST=${GELF_HOST}
      - GELF_PORT=${GELF_PORT}
      - GELF_LEVEL=${GELF_PORT}
.env
ELTEX_HUB=hub.eltex-co.ru/softwlc
SWLC_VERSION=<Версия SoftWLC>

SERVER_PORT=8008
SERVER_ADDRESS_JOBS=http://<ip-адрес сервиса eltex-jobs>:9696

SPRING_DATASOURCE_URL=jdbc:mysql://<ip-адрес БД MariaDB:3306>/eltex_bruce
SPRING_DATASOURCE_USERNAME=javauser
SPRING_DATASOURCE_PASSWORD=javapassword
SPRING_DATASOURCE_DRIVERCLASSNAME=com.mysql.cj.jdbc.Driver

SPRING_FLYWAY_URL=jdbc:mysql://<ip-адрес БД MariaDB:3306>/eltex_bruce
SPRING_FLYWAY_USER=javauser
SPRING_FLYWAY_PASSWORD=javapassword

SPRING_QUARTZ_JOBSTORETYPE=jdbc
SPRING_QUARTZ_PROPERTIES_QUARTZ_JDBC_INITIALIZESCHEMA=never

SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_SCHEDULER_INSTANCENAME=jobs-quartz
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_SCHEDULER_INSTANCEID=AUTO

SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_CLASS=org.quartz.impl.jdbcjobstore.JobStoreTX
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_DRIVERDELEGATECLASS=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_USEPROPERTIES=false
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_TABLEPREFIX=QRTZ_
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_CLUSTERCHECKININTERVAL=20000
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_MISFIRETHRESHOLD=12000000000
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_ISCLUSTERED=false
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_DATASOURCE=quartzDataSource

SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_PROVIDER=hikaricp
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_DRIVER=com.mysql.cj.jdbc.Driver
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_URL=jdbc:mysql://<ip-адрес БД MariaDB:3306>/eltex_bruce
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_USER=javauser
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_PASSWORD=javapassword

SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_CLASS=org.quartz.simpl.SimpleThreadPool
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_THREADCOUNT=10
SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_THREADPRIORITY=5

# Настройка логгирования
BRUCE_LOG_LEVEL=INFO
BRUCE_CONSOLE_LEVEL=INFO

# Настройка перенаправления логов в Graylog
GELF_HOST=udp:<ip-адрес graylog сервера>
GELF_PORT=12201
GELF_LEVEL=INFO
#Настройка часового пояса
TZ=Asia/Novosibirsk

Вместо<Версия SoftWLC> необходимо указать актуальную версию (например 1.27), которую можно посмотреть по ссылке.

Вместо <ip-адрес сервиса eltex-jobs> необходимо указать ip-адрес сервиса eltex-jobs.

Вместо <ip-адрес БД MariaDB:3306> необходимо указать ip-адрес сервера MariaDB.

Вместо <ip-адрес graylog сервера> необходимо указать ip-адрес сервера Graylog. Если использовать отправку логов на сторой сервер не планируется - можно указать "localhost" и отключить отправку логов настройкой параметра "GELF_LEVEL=OFF".

Описание переменных (environment)

Подключение к репозиторию Элтекс

  • ELTEX_HUB - URL репозитория Элтекс;
  • SWLC_VERSION - версия образа;

Запуск сервиса

  • SERVER_PORT - порт, на котором сервис будет работать внутри контейнера;

Подключение к сервису Jobs

  • SERVER_ADDRESS_JOBS - URL для подключения к сервису Jobs;

Подключение к БД (MariaDB)

  • SPRING_DATASOURCE_URL - URI для подключения к БД MariaDB;

  • SPRING_DATASOURCE_USERNAME - имя пользователя для подключения к БД MariaDB;
  • SPRING_DATASOURCE_PASSWORD - пароль пользователя для подключения к БД MariaDB;
  • SPRING_DATASOURCE_DRIVERCLASSNAME - тип для подключения к БД MariaDB;

Подключение к БД (MariaDB) для flyway

  • SPRING_FLYWAY_URL - URI для подключения к БД MariaDB;
  • SPRING_FLYWAY_USER - имя пользователя для подключения к БД MariaDB;
  • SPRING_FLYWAY_PASSWORD - пароль пользователя для подключения к БД MariaDB;

Параметры quartz

  • SPRING_QUARTZ_JOBSTORETYPE - тип хранения данных;
  • SPRING_QUARTZ_PROPERTIES_QUARTZ_JDBC_INITIALIZESCHEMA - схема инициализации;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_SCHEDULER_INSTANCENAME - имя инстанса;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_SCHEDULER_INSTANCEID - id инстанса;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_CLASS - класс;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_DRIVERDELEGATECLASS - класс драйвера;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_USEPROPERTIES - свойства;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_TABLEPREFIX - префикс;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_CLUSTERCHECKININTERVAL - интервал проверки соседей кластера (мс);
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_MISFIRETHRESHOLD - интервал планировщика в течении которого он может пропустить задачу (мс);
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_ISCLUSTERED - использовать режим кластера;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_JOBSTORE_DATASOURCE - источник данных;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_PROVIDER - провайдер подключения к БД;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_DRIVER - драйвер подключения к БД;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_URL - URI для подключения к БД MariaDB;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_USER - имя пользователя для подключения к БД MariaDB;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_DATASOURCE_QUARTZDATASOURCE_PASSWORD - пароль пользователя для подключения к БД MariaDB;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_CLASS - имя пула потоков;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_THREADCOUNT - количество потоков;
  • SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_THREADPOOL_THREADPRIORITY - приоритет потоков;

Параметры логирования

  • BRUCE_LOG_LEVEL - уровень логирования сервиса;
  • BRUCE_CONSOLE_LOG_LEVEL - уровень логирования сервиса в консоль;

Настройка перенаправления логов на сервер Graylog

  • GELF_HOST - адрес хоста Graylog;

  • GELF_PORT - порт хоста Graylog;

  • GELF_LEVEL - уровень логов, перенаправляемых в Graylog.

Настройка часового пояса

  • TZ - часовой пояс в формате Asia/Novosibirsk (список существующих можно посмотреть командой timedatectl list-timezones)


Файлы .env и docker-compose.yml должны находиться в одной папке. Контейнер запускается командой:

command
 docker-compose up -d
  • Нет меток