≫ Информация и управление узлом
Самый простой способ получить общую информацию о вашем узле Manticore — выполнить команду status в клиенте MySQL. Она отобразит информацию о различных аспектах, таких как:
- Текущая версия
- Используется ли SSL или нет
- Текущий TCP порт/Unix сокет
- Время работы
- Количество потоков
- Количество заданий в очереди
- Количество подключений (
clients) - Количество задач, обрабатываемых в данный момент
- Количество выполненных запросов с момента запуска
- Количество заданий в очереди и количество задач, нормализованное по количеству потоков
- SQL
mysql> status--------------
mysql Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper
Connection id: 378
Current database: Manticore
Current user: Usual
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 3.4.3 a48c61d6@200702 coroutines git branch coroutines_work_junk...origin/coroutines_work_junk
Protocol version: 10
Connection: 0 via TCP/IP
Server characterset:
Db characterset:
Client characterset: utf8
Conn. characterset: utf8
TCP port: 8306
Uptime: 23 hours 6 sec
Threads: 12 Queue: 3 Clients: 1 Vip clients: 0 Tasks: 5 Queries: 318967 Wall: 7h CPU: 0us
Queue/Th: 0.2 Tasks/Th: 0.4
--------------SHOW STATUS [ LIKE pattern ]
SHOW STATUS — это SQL-запрос, который показывает различные полезные счетчики производительности. Счетчики ввода-вывода и CPU будут доступны только если searchd был запущен с ключами --iostats и --cpustats соответственно (или если они были включены через SET GLOBAL iostats/cpustats=1).
- SQL
SHOW STATUS;+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| Counter | Value |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| uptime | 182 |
| connections | 368 |
| maxed_out | 0 |
| version | 6.3.7 b10359434@24100213 dev (columnar 2.3.1 bd59d08@24093015) (secondary 2.3.1 bd59d08@24093015) (knn 2.3.1 bd59d08@24093015) (buddy v2.3.13) |
| mysql_version | 6.3.7 b10359434@24100213 dev (columnar 2.3.1 bd59d08@24093015) (secondary 2.3.1 bd59d08@24093015) (knn 2.3.1 bd59d08@24093015) |
| command_search | 4 |
| command_excerpt | 0 |
| command_update | 2 |
| command_keywords | 0 |
| command_persist | 0 |
| command_status | 8 |
| command_flushattrs | 0 |
| command_sphinxql | 0 |
| command_ping | 0 |
| command_delete | 3 |
| command_set | 0 |
| command_insert | 3 |
| command_replace | 3 |
| command_commit | 0 |
| command_suggest | 0 |
| command_json | 0 |
| command_callpq | 0 |
| command_cluster | 0 |
| command_getfield | 0 |
| insert_replace_stats_ms_avg | 42.625 35.895 35.895 |
| insert_replace_stats_ms_min | 0.096 0.096 0.096 |
| insert_replace_stats_ms_max | 85.154 85.154 85.154 |
| insert_replace_stats_ms_pct95 | 42.625 42.625 42.625 |
| insert_replace_stats_ms_pct99 | 42.625 42.625 42.625 |
| search_stats_ms_avg | 0.209 0.188 0.188 |
| search_stats_ms_min | 0.205 0.058 0.058 |
| search_stats_ms_max | 0.214 0.278 0.278 |
| search_stats_ms_pct95 | 0.214 0.278 0.278 |
| search_stats_ms_pct99 | 0.214 0.278 0.278 |
| update_stats_ms_avg | 0.024 0.024 0.024 |
| update_stats_ms_min | 0.007 0.007 0.007 |
| update_stats_ms_max | 0.042 0.042 0.042 |
| update_stats_ms_pct95 | 0.042 0.042 0.042 |
| update_stats_ms_pct99 | 0.042 0.042 0.042 |
| agent_connect | 0 |
| agent_tfo | 0 |
| agent_retry | 0 |
| queries | 6 |
| dist_queries | 0 |
| workers_total | 32 |
| workers_active | 3 |
| workers_clients | 1 |
| workers_clients_vip | 0 |
| workers_clients_buddy | 1 |
| work_queue_length | 6 |
| load | 0.03 0.03 0.03 |
| load_primary | 0.00 0.00 0.00 |
| load_secondary | 0.00 0.00 0.00 |
| query_wall | 0.000 |
| query_cpu | OFF |
| dist_wall | 0.000 |
| dist_local | 0.000 |
| dist_wait | 0.000 |
| query_reads | OFF |
| query_readkb | OFF |
| query_readtime | OFF |
| avg_query_wall | 0.000 |
| avg_query_cpu | OFF |
| avg_dist_wall | 0.000 |
| avg_dist_local | 0.000 |
| avg_dist_wait | 0.000 |
| avg_query_reads | OFF |
| avg_query_readkb | OFF |
| avg_query_readtime | OFF |
| qcache_max_bytes | 16777216 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+Поддерживается необязательный оператор LIKE, позволяющий выбрать только переменные, соответствующие определенному шаблону. Синтаксис шаблона соответствует стандартным SQL-джокерам, где % означает любое количество любых символов, а _ — один символ.
- qcache
- perf_stats
SHOW STATUS LIKE 'qcache%';+-----------------------+-------+
| Counter | Value |
+-----------------------+-------+
| qcache_max_bytes | 0 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-----------------------+-------+Команда SHOW STATUS предоставляет подробный отчет о различных показателях производительности в Manticore, включая статистику времени запросов для insert/replace, search и update запросов. Эти статистики рассчитываются за скользящие окна в 1, 5 и 15 минут, показывая средние, минимальные, максимальные и 95-й/99-й перцентили времени запросов.
Эти метрики помогают отслеживать производительность за определенные интервалы времени, что облегчает выявление тенденций в времени отклика запросов и поиск возможных узких мест.
Следующие метрики входят в вывод SHOW STATUS:
*_avg: Среднее время запроса для каждого типа запросов за последние 1, 5 и 15 минут.*_min: Самое короткое время запроса, зафиксированное для каждого типа запросов.*_max: Самое длинное время запроса, зафиксированное для каждого типа запросов.*_pct95: Время, в течение которого выполняются 95% запросов.*_pct99: Время, в течение которого выполняются 99% запросов.
Эти статистики предоставляются отдельно для insert/replace (insert_replace_stats_*), search (search_stats_*) и update (update_stats_*) запросов, что дает детальное представление о производительности различных операций.
Если в течение контролируемого интервала запросы не выполнялись, система отобразит N/A.
- perf_stats
SHOW STATUS LIKE '%stats_ms%';+-------------------------------+-------------------+
| Counter | Value |
+-------------------------------+-------------------+
| insert_replace_stats_ms_avg | N/A 35.895 35.895 |
| insert_replace_stats_ms_min | N/A 0.096 0.096 |
| insert_replace_stats_ms_max | N/A 85.154 85.154 |
| insert_replace_stats_ms_pct95 | N/A 42.625 42.625 |
| insert_replace_stats_ms_pct99 | N/A 42.625 42.625 |
| search_stats_ms_avg | N/A 0.188 0.188 |
| search_stats_ms_min | N/A 0.058 0.058 |
| search_stats_ms_max | N/A 0.278 0.278 |
| search_stats_ms_pct95 | N/A 0.278 0.278 |
| search_stats_ms_pct99 | N/A 0.278 0.278 |
| update_stats_ms_avg | N/A 0.024 0.024 |
| update_stats_ms_min | N/A 0.007 0.007 |
| update_stats_ms_max | N/A 0.042 0.042 |
| update_stats_ms_pct95 | N/A 0.042 0.042 |
| update_stats_ms_pct99 | N/A 0.042 0.042 |
+-------------------------------+-------------------+SHOW SETTINGS — это SQL-запрос, который отображает текущие настройки из вашего конфигурационного файла. Имена настроек представлены в формате: 'config_section_name'.'setting_name'
Результат также включает два дополнительных значения:
configuration_file— путь к конфигурационному файлуworker_pid— идентификатор процесса запущенного экземпляраsearchd
- SQL
SHOW SETTINGS;+--------------------------+-------------------------------------+
| Setting_name | Value |
+--------------------------+-------------------------------------+
| configuration_file | /etc/manticoresearch/manticore.conf |
| worker_pid | 658 |
| searchd.listen | 0.0.0:9312 |
| searchd.listen | 0.0.0:9306:mysql |
| searchd.listen | 0.0.0:9308:http |
| searchd.log | /var/log/manticore/searchd.log |
| searchd.query_log | /var/log/manticore/query.log |
| searchd.pid_file | /run/manticore/searchd.pid |
| searchd.data_dir | /var/lib/manticore |
| searchd.query_log_format | sphinxql |
| searchd.binlog_path | /var/lib/manticore/binlog |
| common.plugin_dir | /usr/local/lib/manticore |
| common.lemmatizer_base | /usr/share/manticore/morph/ |
+--------------------------+-------------------------------------+
13 rows in set (0.00 sec)SHOW AGENT ['agent_or_index'] STATUS [ LIKE pattern ]
SHOW AGENT STATUS отображает статистику удаленных агентов или распределенной таблицы. Включает такие значения, как время с последнего запроса, последнего ответа, количество различных типов ошибок и успешных операций и т.д. Статистика отображается для каждого агента за последние интервалы 1, 5 и 15, каждый из которых состоит из ha_period_karma секунд.
- SQL
- PHP
- Python
- Python-asyncio
- javascript
- Java
- C#
- Rust
- TypeScript
- Go
SHOW AGENT STATUS;+------------------------------------+----------------------------+
| Variable_name | Value |
+------------------------------------+----------------------------+
| status_period_seconds | 60 |
| status_stored_periods | 15 |
| ag_0_hostname | 192.168.0.202:6713 |
| ag_0_references | 2 |
| ag_0_lastquery | 0.41 |
| ag_0_lastanswer | 0.19 |
| ag_0_lastperiodmsec | 222 |
| ag_0_pingtripmsec | 10.521 |
| ag_0_errorsarow | 0 |
| ag_0_1periods_query_timeouts | 0 |
| ag_0_1periods_connect_timeouts | 0 |
| ag_0_1periods_connect_failures | 0 |
| ag_0_1periods_network_errors | 0 |
| ag_0_1periods_wrong_replies | 0 |
| ag_0_1periods_unexpected_closings | 0 |
| ag_0_1periods_warnings | 0 |
| ag_0_1periods_succeeded_queries | 27 |
| ag_0_1periods_msecsperquery | 232.31 |
| ag_0_5periods_query_timeouts | 0 |
| ag_0_5periods_connect_timeouts | 0 |
| ag_0_5periods_connect_failures | 0 |
| ag_0_5periods_network_errors | 0 |
| ag_0_5periods_wrong_replies | 0 |
| ag_0_5periods_unexpected_closings | 0 |
| ag_0_5periods_warnings | 0 |
| ag_0_5periods_succeeded_queries | 146 |
| ag_0_5periods_msecsperquery | 231.83 |
| ag_1_hostname | 192.168.0.202:6714 |
| ag_1_references | 2 |
| ag_1_lastquery | 0.41 |
| ag_1_lastanswer | 0.19 |
| ag_1_lastperiodmsec | 220 |
| ag_1_pingtripmsec | 10.004 |
| ag_1_errorsarow | 0 |
| ag_1_1periods_query_timeouts | 0 |
| ag_1_1periods_connect_timeouts | 0 |
| ag_1_1periods_connect_failures | 0 |
| ag_1_1periods_network_errors | 0 |
| ag_1_1periods_wrong_replies | 0 |
| ag_1_1periods_unexpected_closings | 0 |
| ag_1_1periods_warnings | 0 |
| ag_1_1periods_succeeded_queries | 27 |
| ag_1_1periods_msecsperquery | 231.24 |
| ag_1_5periods_query_timeouts | 0 |
| ag_1_5periods_connect_timeouts | 0 |
| ag_1_5periods_connect_failures | 0 |
| ag_1_5periods_network_errors | 0 |
| ag_1_5periods_wrong_replies | 0 |
| ag_1_5periods_unexpected_closings | 0 |
| ag_1_5periods_warnings | 0 |
| ag_1_5periods_succeeded_queries | 146 |
| ag_1_5periods_msecsperquery | 230.85 |
+------------------------------------+----------------------------+
50 rows in set (0.01 sec)Поддерживается необязательный оператор LIKE, синтаксис которого такой же, как в SHOW STATUS.
- SQL
- PHP
- Python
- Python-asyncio
- javascript
- Java
- C#
- Rust
- TypeScript
- Go
SHOW AGENT STATUS LIKE '%5period%msec%';+-----------------------------+--------+
| Key | Value |
+-----------------------------+--------+
| ag_0_5periods_msecsperquery | 234.72 |
| ag_1_5periods_msecsperquery | 233.73 |
| ag_2_5periods_msecsperquery | 343.81 |
+-----------------------------+--------+
3 rows in set (0.00 sec)You can specify a particular agent by its address. In this case, only that agent's data will be displayed. Additionally, the agent_ prefix will be used instead of ag_N_:
- SQL
- PHP
- Python
- Python-asyncio
- javascript
- Java
- C#
- Rust
- TypeScript
- Go
SHOW AGENT '192.168.0.202:6714' STATUS LIKE '%15periods%';+-------------------------------------+--------+
| Variable_name | Value |
+-------------------------------------+--------+
| agent_15periods_query_timeouts | 0 |
| agent_15periods_connect_timeouts | 0 |
| agent_15periods_connect_failures | 0 |
| agent_15periods_network_errors | 0 |
| agent_15periods_wrong_replies | 0 |
| agent_15periods_unexpected_closings | 0 |
| agent_15periods_warnings | 0 |
| agent_15periods_succeeded_queries | 439 |
| agent_15periods_msecsperquery | 231.73 |
+-------------------------------------+--------+
9 rows in set (0.00 sec)Finally, you can check the status of the agents in a specific distributed table using the SHOW AGENT table_name STATUS statement. This statement displays the table's HA status (i.e., whether or not it uses agent mirrors at all) and provides information on the mirrors, including: address, blackhole and persistent flags, and the mirror selection probability used when one of the weighted probability strategies is in effect.
- SQL
- PHP
- Python
- Python-asyncio
- javascript
- Java
- C#
- Rust
- TypeScript
- Go
SHOW AGENT dist_index STATUS;+--------------------------------------+--------------------------------+
| Variable_name | Value |
+--------------------------------------+--------------------------------+
| dstindex_1_is_ha | 1 |
| dstindex_1mirror1_id | 192.168.0.202:6713:loc |
| dstindex_1mirror1_probability_weight | 0.372864 |
| dstindex_1mirror1_is_blackhole | 0 |
| dstindex_1mirror1_is_persistent | 0 |
| dstindex_1mirror2_id | 192.168.0.202:6714:loc |
| dstindex_1mirror2_probability_weight | 0.374635 |
| dstindex_1mirror2_is_blackhole | 0 |
| dstindex_1mirror2_is_persistent | 0 |
| dstindex_1mirror3_id | dev1.manticoresearch.com:6714:loc |
| dstindex_1mirror3_probability_weight | 0.252501 |
| dstindex_1mirror3_is_blackhole | 0 |
| dstindex_1mirror3_is_persistent | 0 |
+--------------------------------------+--------------------------------+
13 rows in set (0.00 sec)Manticore Search has a built-in Prometheus exporter. To request metrics, make sure the HTTP port is exposed and simply call the /metrics endpoint.
Note: The exporter requires Buddy to be enabled.
- http
curl -s 0:9308/metrics# HELP manticore_uptime_seconds Time in seconds since start
# TYPE manticore_uptime_seconds counter
manticore_uptime_seconds 25
# HELP manticore_connections_count Connections count since start
# TYPE manticore_connections_count gauge
manticore_connections_count 55
# HELP manticore_maxed_out_error_count Count of maxed_out errors since start
# TYPE manticore_maxed_out_error_count counter
manticore_maxed_out_error_count 0
# HELP manticore_version Manticore Search version
# TYPE manticore_version gauge
manticore_version {version="0.0.0 c88e811b2@25060409 (columnar 5.0.1 59c7092@25060304) (secondary 5.0.1 59c7092@25060304) (knn 5.0.1 59c7092@25060304) (embeddings 1.0.0) (buddy v3.28.6-7-g14ee10)"} 1
# HELP manticore_mysql_version Manticore Search version
# TYPE manticore_mysql_version gauge
manticore_mysql_version {version="0.0.0 c88e811b2@25060409 (columnar 5.0.1 59c7092@25060304) (secondary 5.0.1 59c7092@25060304) (knn 5.0.1 59c7092@25060304) (embeddings 1.0.0)"} 1
# HELP manticore_command_search_count Count of search queries since start
# TYPE manticore_command_search_count counter
manticore_command_search_count 1
......