Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space RED and version 7.1
Sv translation
languageru

Файл конфигурации x2db.conf

Scroll Table Layout
widths60%,40%

СодержимоеОписание
{
 
    "Logging": {...}
см. Общая секция Logging
    "FileQueues": {
Файловые очереди
         "ErrorsQueue": "queue/x2db-errors",
Путь до очереди ошибок
         "InQueue": "queue/x2x",
Путь до очереди, из которой iw_x2db берёт данные для вставки в БД. Если указать путь "/dev/null", то:
    • если очередь входная, то будет возвращаться пустой элемент;
    • если очередь выходная, то обработанный элемент будет удаляться после обработки
         "QueueWaitTimeMilliseconds": 100
Время ожидания данных из файловой очереди "InQueue". Если время прошло, а данных нет, то программа заходит на новый цикл ожидания, предварительно проверив, не была ли запрошена остановка.
    },
 
    "NookDir": "/opt/iw/tm5", 

В секции указывается рабочий каталог модуля. По умолчанию – /opt/iw/tm5.

    "UnsafeSignalHandlers":false
Поддержка работы с необрабатываемыми сигналами. По умолчанию выключена (false). При установке значения true позволяется устанавливать в коде обработчики "небезопасных" сигналов (например, SIGSEVG). Добавлять, включать/выключать данную настройку не рекомендуется без предварительной консультации с разработчиками.
    "OracleUtf8Processing": {
Секция специальной обработки UTF8 для БД Oracle
        "Enabled": true, 
Включать обработку ( менять значение нежелательно)
        "Substituter": 95
ASCII-код замещающего символа для 4+ байтного UTF8 (не рекомендуется менять это значение, всегда больше 32).
    }, 
 
    "DebugBreak": false, 
Посылать ли SIGTRAP (SIGBREAK на Windows) при обработке любого исключения. Служит для отладки
    "Performance": {
Секция настроек производительности
        "Oracle": {
Специфичные для Oracle backend настройки
            "ChunkClobBlobSizeInMb": 2047,
Установка размера чанка (в МБ) для записи контента пофрагментарно
            "MemoryPerLobThreshold": 10485760
Порог до записи LOBов в Oracle (в байтах). По достижению происходит запись в БД. При уменьшении значения уменьшает memory footprint. Ограничение: не более 2 Гб.
        }, 
 
        "Postgress": {
Специфичные для PostgreSQL backend настройки
            "ChunkClobBlobSizeInMb": 100,
Установка размера чанка (в МБ) для записи контента пофрагментарно (ограничение: не более 1 ГБ)
        }
 
        "General": {
Секция общих настроек производительности
"ConnectionLifeTimeSeconds": 86400,Время, в течение которого соединение открыто (в секундах). После истечения установленного времени автоматически создается новое соединение.
            "ObjectsMax": {

Лимиты по обработке объектов

                "MaxFreeCollectors": 10, 

Количество коллекторов, которые могут "жить", даже если нет никакой работы (создавать новый коллектор и выделять ему память по новой намного затратнее, чем взять готовый из пула).

                "CollectorsForFillLimit": 10, 

Количество объектов, которые могут подготавливаться к вставке, пока все подключения к БД заняты уже готовыми объектами

                "ConnectionsMax": 10

Количество одновременных подключений к БД

            }
 
        }
 
    }, 
 
    "DBWorkersCount": 5,
Количество потоков, которые занимаются вставкой в БД. Нет смысла устанавливать значение больше, чем число возможных ConnectionsMax. Нормальное значение = (2 - 3) * WorkersCount
Talk
idtalk-39559
    "WorkersCount": 5
Количество потоков, которые берут данные из очереди "InQueue", заполняют коллекторы и передают заполненные коллекторы в потоки DBWorkersCount
}
 

Unit-файл iw_x2db.service 

Scroll Table Layout
widths60%,40%

Код
Описание

[Unit]

Раздел для определения метаданных демона и настройки его взаимодействия с другими демонами
Description=InfoWatch Traffic Monitor Database XML Loader

Название демона

After=network-online.service iwtm-consul.service  postgresql-9.6.service oracle.serviceДемоны, которые будут запущены до запуска текущего демона
  
[Service]Раздел настройки запуска демона

Type=simple

Тип запуска демона. simple - демон запускается и переходит в режим ожидания на консоли

PermissionsStartOnly=true

Запуск команд из ExecStartPre под пользователем root

ExecStartPre=/bin/bash /opt/iw/tm5/bin/check_coredumps.sh -d iw_x2db

Полный путь и аргументы команды, которые должны быть выполнены до запуска основного процесса

ExecStart=/opt/iw/tm5/bin/iw_x2db -p /opt/iw/tm5/etc --backend $DB_BACKEND

Полный путь и аргументы команды, которая должна быть выполнена для запуска демона. Запускается от пользователя, указанного в User

ExecStop=/bin/kill -s SIGQUIT $MAINPID

Команда для остановки демона. Если не указано, процесс будет немедленно уничтожен, когда демон будет остановлен. Запускается от пользователя, указанного в User

ExecReload=/bin/kill -s SIGHUP $MAINPID

Команда для перезагрузки конфигурации демона, если она доступна. Запускается от пользователя, указанного в User

Restart=on-failure

Команда для рестарта демона, если он остановится или упадет. Значение on-failure означает, что демон будет перезапускаться, если он остановился с ненулевым кодом возврата или был завершен по сигналу (kill <pid_демона>)

RestartSec=5

Время ожидания перед попыткой перезапуска демона

RestartPreventExitStatus=SIGKILL

Команда, по которой можно принудительно завершить работу демона

TimeoutStopSec=0

Время, в течение которого система будет ждать остановки демона, прежде чем пометить его недоступный или завершенный принудительно

User=iwtm

Имя пользователя, от которого осуществляется запуск демона

Group=iwtm

Имя группы пользователя

LimitNOFILE=32768

Максимальное количество открытых файлов

LimitFSIZE=infinity

Максимальный размер файла (КБ). infinity - без ограничений

LimitNPROC=65536

Максимальное количество процессов

LimitCORE=infinity

Ограничение на размер coredump-файла (КБ)

LimitMEMLOCK=infinity

Максимальное заблокированное в памяти адресное пространство (КБ)

EnvironmentFile=-/etc/default/iwtm

Путь к файлу окружения
  

[Install]

Определение поведения демона, если он включен или отключен

WantedBy=multi-user.target

Запускать этот демон, когда система грузится в multi-user режиме
Sv translation
languageen

The x2db.conf configuration file

Scroll Table Layout
widths60%,40%

ContentDescription
{
 
    "Logging": {...}
see General section Logging
    "FileQueues": {
Files queues
         "ErrorsQueue": "queue/x2db-errors",
Path to errors queue
         "InQueue": "queue/x2x",

Path to the queue, where iw_x2db gets the data to paste to DB.

If "/dev/null" path is specified, then:

    • for the input queue, an element will be returned empty;
    • for the output queue, an element will be removed after processing
         "QueueWaitTimeMilliseconds": 100
Time of waiting data from "InQueue" file queue. If the time's passed and the data is absent, the program starts a new waiting cycle, preliminary ensured that the stop wasn't requested.
    },
 
    "NookDir": "/opt/iw/tm5", 

In this section, the module working directory is specified. By default – /opt/iw/tm5.

 "UnsafeSignalHandlers":false
Unhandled signals support. Disabled by default (false). Once true is set, it is allowed to use unsafe handlers in code (e.g. SIGSEVG). Adding, enabling/disabling this parameter is not recommended without consultation with developers.
    "OracleUtf8Processing": {
Section of special UTF8 processing for Oracle DB.
        "Enabled": true, 
Enable processing (changing the value is unwelcome).
        "Substituter": 95
ASCII-code of replacing symbol for 4+ bytes UTF8 (changing the value is unwelcome, always more than 32).
    }, 
 
    "DebugBreak": false, 
If SIGTRAP should be sent (SIGBREAK to Windows) while any exception handling. Used for debugging purposes.
    "Performance": {
Performance configuration section.
        "Oracle": {
Settings specific for Oracle backend.
            "ChunkClobBlobSizeInMb": 2047,
Chunk size (Mb) setup for fragmented content recording.
            "MemoryPerLobThreshold": 10485760
LOBs limits before recording to Oracle (in bytes). Once achieved, the record is done in DB. When the value is getting low, the memory footprint is getting low as well. Limitation: not more than 2Gb.
        }, 
 
  "Postgress": {
PostgreSQL backend specific settings.
             "ChunkClobBlobSizeInMb": 100,
Chunk size (Mb) setup for fragmented content recording (limitation: 1 Gb maximum)
  
        "General": {
Section of performance general settings.
"ConnectionLifeTimeSeconds": 86400,Time during which the connection is open (in seconds). After the set time, a new connection is automatically created.
            "ObjectsMax": {

Objects processing limits.

                "MaxFreeCollectors": 10, 

Number of collectors, able for "living" without any activity (creating a new collector and issuing memory to it is more expensive than taking one from the pool.

                "CollectorsForFillLimit": 10, 

Number of objects able for pasting when all DB connections are busy with ready objects.

                "ConnectionsMax": 10

Number of simultaneous connections to DB.

            }
 
        }
 
    }, 
 
    "DBWorkersCount": 5,
Number of streams, pasting into DB. There is no use in setting the value more than possible ConnectionsMax. Normal value = (2 - 3) * WorkersCount.
    "WorkersCount": 5
Number of streams, taking data from "InQueue" queue, fulfilling the collectors and transferring the fulfilled collectors into DBWorkersCount streams.
}
 

The iw_x2db.service unit file

Scroll Table Layout
widths60%,40%

Code
Description

[Unit]

A section where the daemon metadata is determined and interaction settings with other daemons are specified
Description=InfoWatch Traffic Monitor Database XML Loader

The daemon name

After=network-online.service iwtm-consul.service  postgresql-9.6.service oracle.serviceDaemons that will be started before the current one
  
[Service]A section where the daemon start settings are specified

Type=simple

Daemon start type. simple - the daemon is started and goes into standby on the console

PermissionsStartOnly=true

Running commands from ExecStartPre under root

ExecStartPre=/bin/bash /opt/iw/tm5/bin/check_coredumps.sh -d iw_x2db

The full path and command arguments that should be executed before the main process is started. 

ExecStart=/opt/iw/tm5/bin/iw_x2db -p /opt/iw/tm5/etc --backend $DB_BACKEND

The full path and command arguments that should be executed before starting the daemon. The command is run under user specified in the User field.

ExecStop=/bin/kill -s SIGQUIT $MAINPID

A command to stop the daemon. If the command is not specified, the process will be killed once the daemon is stopped. The command is run under user specified in the User field.

ExecReload=/bin/kill -s SIGHUP $MAINPID

A command that reloads the daemon configuration if it is available. The command is run under user specified in the User field.

Restart=on-failure

A command that restarts the daemon when it stops or crashes. The on-failure value indicates that the daemon will be restarted if it has stopped with a non-zero return code or was ended by signal (kill <daemon_pid>)

RestartSec=5

A timeout before attempting to restart the daemon

RestartPreventExitStatus=SIGKILL

A command that forcibly ends the daemon operation

TimeoutStopSec=0

The time during which the system waits for the signal to stop before marking the process as unavailable or terminated

User=iwtm

The name of the user under whose account the daemon is started

Group=iwtm

Name of the user group

LimitNOFILE=32768

The maximum number of open files

LimitFSIZE=infinity

The maximum size of a file (KB). The infinity value means that the size is unlimited.

LimitNPROC=65536

The maximum number of processes

LimitCORE=infinity

Limit for core dump size (KB)

LimitMEMLOCK=infinity

The maximum size of memory locked address space (KB)

EnvironmentFile=-/etc/default/iwtm

Path to the environment file
  

[Install]

Defines the behavior of a daemon when it is enabled/disabled

WantedBy=multi-user.target

Start the daemon when the system is loaded in multi-user mode