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

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

Ключ

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

Файл конфигурации is.conf
iw_is -  
Универсальная система индексации, не привязанная к поисковой системе и предназначенная также для индексирования метаинформации.

Scroll Table Layout
widths65%,35%

КодОписание
{ 
"Fetchers": [Секция фетчеров - модулей для выборки данных для индексации
{ 

"CommandLineArgs": [

Атрибуты командной строки
                "--backend",
 

                "oracle"

 

            ],

 
"Settings": {},Настройки фетчеров
"Path": "/opt/iw/tm5/bin/iw_metainfo_fetcher",Путь до фетчера

"Name": "MetainfoFetcher"

Имя фетчера

        }

 

    ],

 

    "Indices": [

Секция индексов

        {

 

            "Description": {

Описание индексов

                "Base": {

Описание Базы индексов. Опции из Сфинкса:

                    "min_word_len": "3",

Минимально индексируемая длина слова. Будут проиндексированы только те слова, которые не короче этого минимума. Значение "1" - индексировать все.

                    "index_exact_words": "0",

Настройка предписывает проиндексировать первоначальный токен (до применения морфологии) вдобавок к морфологии.

                    "charset_table": "0..9, _ , a..z, U+430..U+44F, U+451,
A..Z->a..z, U+401->U+451, U+410..U+42F->U+430..U+44F",

Опция  задаёт таблицу допустимых символов. Если несколько допустимых символов в тексте идут один за другим, то Sphinx воспринимает их как одно слово. Если символ не указан в таблице символов и, соответственно, не считается допустимым, то Sphinx воспринимает его как разделитель.

                    "morphology": "libstemmer_eng, libstemmer_rus",

Опция использования морфологических алгоритмов

                    "type": "plain"

 

                },

 

                "Source": {

Описание источника данных для индекса

                    "Fields": [

Поля источника данных

                        "url",

Гиперссылка на страницу контакта в социальной сети

                        "login",

Имя учетной записи контакта в социальной сети

                        "disp_name"

Имя пользователя, использованное в перехваченном объекте. Может быть никнеймом, указанным в качестве имени и фамилии в аккаунте пользователя в социальной сети
                     ], 
                     "Attributes": {Атрибуты источника данных

                        "contact": "string"

Атрибут "Контакт"

                    },

 

                    "Name": "mi2cntct"

Имя источника данных

                }

 

            },

 

            "AutoupdatePeriodSec": 140,

Период автообновления индекса

            "Hive": "Primary",

Имя места хранения индекса

            "IndexingPool": "TODO_indexing_pool",

Не используется, на будущее

            "RotationPeriodSec": 120,

Период обновления индексов в поисковом сервере

            "Indexer": "Default",

Имя индексера для постройки этого индекса

            "Active": true,

Состояние: активен или нет

            "FetcherPool": "TODO_fetcher_pool",

Не используется, на будущее 

            "FetchSize": 0,

Максимальное количество объектов, которое должен обработать один фетчер

            "FetchingConcurrency": 1,

Количество одновременно запускаемых фетчеров

            "ApplyTimeoutSec": 60,

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

            "MaxShards": 1,

Количество сегментов в индексе

            "Fetcher": "MetainfoFetcher",

Имя фетчера для выборки данных

            "Scope": "System",

Имя скоупа индекса для iw_is

            "Mill": "Default",

Имя места хранения данных для индексации

            "ServedBy": "Default",

Имя сервера для поиска

            "State": "Active",

Не используется

            "UpdateStrategy": "Rebuild",

Стратегия обновления индекса. Значения: rebuild (перестроить), delta (достроить)

            "Name": "minfo_contact"

Имя индекса

        },

 

        {

 

            "Description": {

Описание индексов

                "Base": {

База индексов (Настройки из Сфинкса)

                    "min_word_len": "3",

Минимально индексируемая длина слова. Будут проиндексированы только те слова, которые не короче этого минимума. Значение "1" - индексировать все.

                    "index_exact_words": "0",

Настройка предписывает проиндексировать первоначальный токен (до применения морфологии) вдобавок к морфологии.

                    "charset_table": "0..9, _ , a..z, U+430..U+44F, U+451,
A..Z->a..z, U+401->U+451, U+410..U+42F->U+430..U+44F",

Опция  задаёт таблицу допустимых символов. Если несколько допустимых символов в тексте идут один за другим, то Sphinx воспринимает их как одно слово. Если символ не указан в таблице символов и, соответственно, не считается допустимым, то Sphinx воспринимает его как разделитель.

                    "morphology": "libstemmer_eng, libstemmer_rus",

Опция использования морфологических алгоритмов
                     "type": "plain" 

                },

 

                "Source": {

Описание источника данных для индекса

                    "Fields": [

Поля источника данных

                        "url",

Поле"url"

                        "login",

Поле "login"

                        "disp_name"

Поле "disp_name"

                    ],

 

                    "Attributes": {

Атрибуты источника данных

                        "event": "bigint",

Атрибут "Событие"

                        "tbs": "bigint"

Атрибут "Табличное пространство"
}, 

                    "Name": "mi2evnt"

Имя источника данных

                }

 

            },

 

            "AutoupdatePeriodSec": 70,

Период автообновления индекса

            "Hive": "Primary",

Имя места хранения индекса

            "IndexingPool": "TODO_indexing_pool",

Не используется, на будущее

            "RotationPeriodSec": 60,

Период обновления индексов в поисковом сервере

            "Indexer": "Default",

Имя индексера для постройки этого индекса

            "Active": true,

Состояние: активен или нет

            "FetcherPool": "TODO_fetcher_pool",

Не используется, на будущее 

            "FetchSize": 1000,

Максимальное количество объектов, которое должен обработать один фетчер

            "FetchingConcurrency": 3,

Количество одновременно запускаемых фетчеров

            "ApplyTimeoutSec": 60,

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

            "MaxShards": 10,

Количество сегментов в индексе

            "Fetcher": "MetainfoFetcher",

Имя фетчера для выборки данных

            "Scope": "tbs",

Имя скоупа индекса для iw_is

            "Mill": "Default",

Имя места хранения данных для индексации

            "ServedBy": "Default",

Имя сервера для поиска

            "State": "Active",

Не используется

            "UpdateStrategy": "Delta",

Стратегия обновления индекса. Значения: rebuild (перестроить), delta (достроить)

            "Name": "minfo_event"

Имя индекса

        }

 

    ],

 
    "UnsafeSignalHandlers": false,Поддержка работы с необрабатываемыми сигналами. По умолчанию выключена (false). При установке значения true позволяется устанавливать в коде обработчики "небезопасных" сигналов (например, SIGSEVG). Добавлять, включать/выключать данную настройку не рекомендуется без предварительной консультации с разработчиками.
    "DebugBreak": false,Посылать ли SIGTRAP (SIGBREAK на Windows) при обработке любого исключения. Служит для отладки
    "NookDir": "/opt/iw/tm5",В секции указывается рабочий каталог модуля. По умолчанию – /opt/iw/tm5.
    "Indexing": {Конфигурация iw_is
        "CommandQueue": "queue/is/cmd",Путь к файловой очереди команд iw_is. Если указать путь "/dev/null", то:
    • если очередь входящая, то будет возвращаться пустой элемент;
    • если очередь выходящая, то обработанный элемент будет удаляться после обработки
        "FetchingQueue": "queue/is/fetching",Путь команд на фетчинг
        "ErrorQueue": "queue/is/errors",Путь к очереди ошибок
        "TempDir": "tmp",Не используется
        "IndexingQueue": "queue/is/indexing",Путь команд на индексацию
        "KeepData": falseСохранять проиндексированные данные (да/нет)
    }, 
    "Vaults": [Места хранения архивов индексов
        { 
            "Name": "Default",Имя архива
            "Path": "/opt/iw/tm5/sphinx_archive"Путь до архива
        } 
    ], 
    "Hives": [Места хранения индексов
        { 
            "Path": "/var/lib/sphinx/indices",Путь до места хранения
            "Name": "Primary"Имя места хранения
        } 
    ], 
    "Pools": [Пулы процессов, исполняемых внутри iw_is
        { 
            "Name": "Searching"Имя пула процессов
            "MaxProcsRunning": 1,Максимальное количество одновременно исполняемых процессов
        }, 
        { 
            "Name": "Indexing"Имя пула процессов
            "MaxProcsRunning": 3,Максимальное количество одновременно исполняемых процессов
        }, 
        { 
            "Name": "Fetching"Имя пула процессов
            "MaxProcsRunning": 3,Максимальное количество одновременно исполняемых процессов
        } 
    ], 
    "Logging": {...},см. "Общая секция Logging" 
    "Mills": [Места хранения данных для индексации
        { 
            "Path": "/opt/iw/tm5/tmp/indexing",Путь до места хранения
            "Name": "Default"Имя места хранения
        } 
    ], 
    "Indexers": [Индексаторы, используемые в iw_is (массив)
        { 
            "Name": "Default",Имя индексатора
            "Path": "/opt/iw/tm5/bin/indexer",Путь до индексатора
            "Settings": {Опции в Сфинксе
                "mem_limit": "2047M",Ограничение использования ОЗУ при индексировании (M - в Мб, К - в Кб)
                "max_xmlpipe2_field": "1024M",Максимально допустимый размер поля для типа источника XMLpipe2
                "on_file_field_error": "ignore_field"

Опция обработки ошибок ввода-вывода в полях файла:

  • ignore_field - индексировать текущий документ без поля;

  • skip_document - пропустить текущий документ, но продолжить индексацию;

  • fail_index - не удается индексировать с сообщением об ошибке.

            } 
        } 
    ] 
} 

Unit-файл iw_is.service 

Scroll Table Layout
widths50%, 50%

Код
Описание

[Unit]

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

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

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

Type=simple

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

PermissionsStartOnly=true

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

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

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

ExecStart=/opt/iw/tm5/bin/iw_is -p /opt/iw/tm5/etc

Полный путь и аргументы команды, которая должна быть выполнена для запуска демона. Запускается от пользователя, указанного в 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

is.conf configuration file 
iw_is - 
Universal indexation system not linked to the search system and is meant to indexing metainformation. 

Scroll Table Layout
widths60%,40%

CodeDescription
{ 
"Fetchers": [Fetchers section - these are modules performing data sampling for indexing
{ 

"CommandLineArgs": [

Command line attributes
                "--backend",
 

                "oracle"

 

            ],

 
"Settings": {},Fetchers settings
"Path": "/opt/iw/tm5/bin/iw_metainfo_fetcher",Path to fetcher

"Name": "MetainfoFetcher"

Fetcher name

        }

 

    ],

 

    "Indices": [

Indexes section

        {

 

            "Description": {

Indexes description

                "Base": {

Indexes base description. Sphinx options:

                    "min_word_len": "3",

Minimal word length, needed for indexing. Those words will be indexed only, that have the length not shorter than the minimum.

Value "1" - index all.

                    "index_exact_words": "0",

The setting prescribes to index the initial token (before applying morphology) additionally to morphology.

                    "charset_table": "0..9, _ , a..z, U+430..U+44F, U+451,
A..Z->a..z, U+401->U+451, U+410..U+42F->U+430..U+44F",

The option sets the table of allowed symbols. If several allowed symbols are placed one after another in the text, Sphinx perceives them as one word. If a symbol is missing in the table of symbols, hence, is not considered as allowed, Sphinx perceives it as a divider.

                    "morphology": "libstemmer_eng, libstemmer_rus",

Morphological algorithms using option

                    "type": "plain"

 

                },

 

                "Source": {

Description of data source for index

                    "Fields": [

Data source fields

                        "url",

Hyperlink to contact's social network page

                        "login",

Contact's social network username

                        "disp_name"

Username used in intercepted object. Can be nickname, specified as name and surname in social network account.

                     ], 
                     "Attributes": {Data source attributes

                        "contact": "string"

"Contact" attribute

                    },

 

                    "Name": "mi2cntct"

Data source name

                }

 

            },

 

            "AutoupdatePeriodSec": 140,

Index autoupdate period

            "Hive": "Primary",

Index storage name

            "IndexingPool": "TODO_indexing_pool",

Not used, keeping it for the future

            "RotationPeriodSec": 120,

Indexes update period on the search server

            "Indexer": "Default",

Name of indexer building the index

            "Active": true,

Status: active or not active

            "FetcherPool": "TODO_fetcher_pool",

Not used, keeping it for the future

            "FetchSize": 0,

Maximum number of objects to be processed by one fetcher

            "FetchingConcurrency": 1,

Number of fetchers being started at a time

            "ApplyTimeoutSec": 60,

Index update timeout (seconds). This ending, the warnings that index has not been loaded will appear.

            "MaxShards": 1,

Number of segments in index

            "Fetcher": "MetainfoFetcher",

Data sampling fetcher name

            "Scope": "System",

Index scope name for iw_is

            "Mill": "Default",

Data for indexing storage name

            "ServedBy": "Default",

Search server name

            "State": "Active",

Not used

            "UpdateStrategy": "Rebuild",

Index update strategy. Values: rebuild, delta (finish building)

            "Name": "minfo_contact"

Index name

        },

 

        {

 

            "Description": {

Indexes description

                "Base": {

Indexes base (Settings from Sphinx)

                    "min_word_len": "3",

Minimal word length, needed for indexing. Those words will be indexed only, that have the length not shorter than the minimum.

Value "1" - index all.

                    "index_exact_words": "0",

The setting prescribes to index the initial token (before applying morphology) additionally to morphology.

                    "charset_table": "0..9, _ , a..z, U+430..U+44F, U+451,
A..Z->a..z, U+401->U+451, U+410..U+42F->U+430..U+44F",

The option sets the table of allowed symbols. If several allowed symbols are placed one after another in the text, Sphinx perceives them as one word. If a symbol is missing in the table of symbols, hence, is not considered as allowed, Sphinx perceives it as a divider.

                    "morphology": "libstemmer_eng, libstemmer_rus",

Morphological algorithms using option
                     "type": "plain" 

                },

 

                "Source": {

Description of data source for index

                    "Fields": [

Data source fields

                        "url",

"url" field

                        "login",

"login" field

                        "disp_name"

"disp_name" field

                    ],

 

                    "Attributes": {

Data source attributes

                        "event": "bigint",

"Event" attribute

                        "tbs": "bigint"

"Table space" attribute
}, 

                    "Name": "mi2evnt"

Data source name

                }

 

            },

 

            "AutoupdatePeriodSec": 70,

Index autoupdate period

            "Hive": "Primary",

Index storage name

            "IndexingPool": "TODO_indexing_pool",

Not used, keeping it for the future

            "RotationPeriodSec": 60,

Indexes update period on the search server

            "Indexer": "Default",

Name of indexer building the index

            "Active": true,

Status: active or not active

            "FetcherPool": "TODO_fetcher_pool",

Not used, keeping it for the future

            "FetchSize": 1000,

Maximum number of objects to be processed by one fetcher

            "FetchingConcurrency": 3,

Number of fetchers being started at a time

            "ApplyTimeoutSec": 60,

Index update timeout (seconds). This ending, the warnings that index has not been loaded will appear.

            "MaxShards": 10,

Number of segments in index

            "Fetcher": "MetainfoFetcher",

Data sampling fetcher name

            "Scope": "tbs",

Index scope name for iw_is

            "Mill": "Default",

Data for indexing storage name

            "ServedBy": "Default",

Search server name

            "State": "Active",

Not used

            "UpdateStrategy": "Delta",

Index update strategy. Values: rebuild, delta (finish building)

            "Name": "minfo_event"

Index name

        }

 

    ],

 
    "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.
    "DebugBreak": false,If SIGTRAP should be sent (SIGBREAK to Windows) while any exception handling. Used for debugging purposes.
    "NookDir": "/opt/iw/tm5",Module working directory is specified in the section. By default /opt/iw/tm5.
    "Indexing": {iw_is configuration
        "CommandQueue": "queue/is/cmd",

Path to the file queue of iw_is commands. 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
        "FetchingQueue": "queue/is/fetching",Path to fetching commands
        "ErrorQueue": "queue/is/errors",Path to errors queue
        "TempDir": "tmp",Not used
        "IndexingQueue": "queue/is/indexing",

Indexation commands path

        "KeepData": falseKeep indexed data (yes/no)
    }, 
    "Vaults": [Indexes archives storages
        { 
            "Name": "Default",Archive name
            "Path": "/opt/iw/tm5/sphinx_archive"Path to archive
        } 
    ], 
    "Hives": [Indexes storages
        { 
            "Path": "/var/lib/sphinx/indices",Path to storage
            "Name": "Primary"Storage name
        } 
    ], 
    "Pools": [Pool of processes, executed inside iw_is
        { 
            "Name": "Searching"Pool of processes name
            "MaxProcsRunning": 1,

Maximum number of processes being executed at a time

        }, 
        { 
            "Name": "Indexing"Pool of processes name
            "MaxProcsRunning": 3,Maximum number of processes being executed at a time
        }, 
        { 
            "Name": "Fetching"Pool of processes name
            "MaxProcsRunning": 3,Maximum number of processes being executed at a time
        } 
    ], 
    "Logging": {...},см. "General section Logging" 
    "Mills": [

Data for indexing storage

        { 
            "Path": "/opt/iw/tm5/tmp/indexing",Path to storage
            "Name": "Default"Storage name
        } 
    ], 
    "Indexers": [Indexers used in iw_is (array)
        { 
            "Name": "Default",Indexer name
            "Path": "/opt/iw/tm5/bin/indexer",Path to indexer
            "Settings": {Options in Sphinx
                "mem_limit": "2047M",

RAM use restriction while indexing (M - MB, K - KB)

                "max_xmlpipe2_field": "1024M",Maximum field size for source type XMLpipe2
                "on_file_field_error": "ignore_field"

Input-output errors processing option in file fields:

  • ignore_field - index current document without a field;

  • skip_document - skip current document, but continue indexation;

  • fail_index - indexing failed, error message displayed

            } 
        } 
    ] 
} 

The iw_is.service unit file:

Scroll Table Layout
widths50%, 50%

Code
Description

[Unit]

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

Daemon name

After=network-online.service iwtm-consul.service  postgresql-9.6.service oracle.service iw_indexer.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_is

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

ExecStart=/opt/iw/tm5/bin/iw_is -p /opt/iw/tm5/etc

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 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