Rotating query and server logs

Manticore Search accepts signal USR1 for reopening server and query log files.

The official DEB and RPM packages install a Logrotate conf file for all files in default log folder.

A simple logrotate conf for log files looks like:

  1. /var/log/manticore/*.log {
  2. weekly
  3. rotate 10
  4. copytruncate
  5. delaycompress
  6. compress
  7. notifempty
  8. missingok
  9. }

FLUSH LOGS

  1. mysql> FLUSH LOGS;
  2. Query OK, 0 rows affected (0.01 sec)

In addition, the FLUSH LOGS SQL command is available, which works same as system USR1 signal. Initiate reopen of searchd log and query log files, letting you implement log file rotation. Command is non-blocking (i.e., returns immediately).

▪️ Node info and management

Node status

STATUS

The easiest way to see high-level information about your Manticore node is by running status in mysql client. It will show you information about different things:

  • current version
  • whether SSL is in effect or not
  • current TCP port/unix socket
  • uptime
  • number of threads
  • number of jobs in queue
  • number of connections (clients)
  • number of tasks being processed now
  • number of queries made since start
  • number or jobs in queue and number of tasks normalized by number of threads
  • SQL

SQL

  1. mysql> status

Response

  1. --------------
  2. mysql Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper
  3. Connection id: 378
  4. Current database: Manticore
  5. Current user: Usual
  6. SSL: Not in use
  7. Current pager: stdout
  8. Using outfile: ''
  9. Using delimiter: ;
  10. Server version: 3.4.3 a48c61d6@200702 coroutines git branch coroutines_work_junk...origin/coroutines_work_junk
  11. Protocol version: 10
  12. Connection: 0 via TCP/IP
  13. Server characterset:
  14. Db characterset:
  15. Client characterset: utf8
  16. Conn. characterset: utf8
  17. TCP port: 8306
  18. Uptime: 23 hours 6 sec
  19. Threads: 12 Queue: 3 Clients: 1 Vip clients: 0 Tasks: 5 Queries: 318967 Wall: 7h CPU: 0us
  20. Queue/Th: 0.2 Tasks/Th: 0.4
  21. --------------

SHOW STATUS

  1. SHOW STATUS [ LIKE pattern ]

SHOW STATUS is an SQL statement that displays a number of useful performance counters. IO and CPU counters will only be available if searchd was started with --iostats and --cpustats switches respectively (or they were enabled via SET GLOBAL iostats/cpustats=1).

  • SQL

SQL

  1. SHOW STATUS;

Response

  1. +-----------------------+---------------------------+
  2. | Counter | Value |
  3. +-----------------------+---------------------------+
  4. | uptime | 1385 |
  5. | connections | 11 |
  6. | maxed_out | 0 |
  7. | version | 3.4.3 ab7cbe5d@200511 dev |
  8. | mysql_version | 3.4.3 ab7cbe5d@200511 dev |
  9. | command_search | 2 |
  10. | command_excerpt | 0 |
  11. | command_update | 0 |
  12. | command_delete | 0 |
  13. | command_keywords | 0 |
  14. | command_persist | 0 |
  15. | command_status | 1 |
  16. | command_flushattrs | 0 |
  17. | command_set | 1 |
  18. | command_insert | 0 |
  19. | command_replace | 0 |
  20. | command_commit | 0 |
  21. | command_suggest | 0 |
  22. | command_json | 0 |
  23. | command_callpq | 0 |
  24. | agent_connect | 0 |
  25. | agent_retry | 0 |
  26. | queries | 12 |
  27. | dist_queries | 0 |
  28. | workers_total | 30 |
  29. | workers_active | 1 |
  30. | workers_clients | 0 |
  31. | workers_clients_vip | 1 |
  32. | work_queue_length | 1 |
  33. | query_wall | 10.805 |
  34. | query_cpu | OFF |
  35. | dist_wall | 0.000 |
  36. | dist_local | 0.000 |
  37. | dist_wait | 0.000 |
  38. | query_reads | OFF |
  39. | query_readkb | OFF |
  40. | query_readtime | OFF |
  41. | avg_query_wall | 0.900 |
  42. | avg_query_cpu | OFF |
  43. | avg_dist_wall | 0.000 |
  44. | avg_dist_local | 0.000 |
  45. | avg_dist_wait | 0.000 |
  46. | avg_query_reads | OFF |
  47. | avg_query_readkb | OFF |
  48. | avg_query_readtime | OFF |
  49. | qcache_max_bytes | 0 |
  50. | qcache_thresh_msec | 3000 |
  51. | qcache_ttl_sec | 60 |
  52. | qcache_cached_queries | 0 |
  53. | qcache_used_bytes | 0 |
  54. | qcache_hits | 0 |
  55. +-----------------------+---------------------------+
  56. 49 rows in set (0.00 sec)

An optional LIKE clause is supported. It lets you pick just the variables that match a pattern. The pattern syntax is that of regular SQL wildcards, that is, % means any number of any characters, and _ means a single character.

  • SQL

SQL

  1. SHOW STATUS LIKE 'qcache%';

Response

  1. +-----------------------+-------+
  2. | Counter | Value |
  3. +-----------------------+-------+
  4. | qcache_max_bytes | 0 |
  5. | qcache_thresh_msec | 3000 |
  6. | qcache_ttl_sec | 60 |
  7. | qcache_cached_queries | 0 |
  8. | qcache_used_bytes | 0 |
  9. | qcache_hits | 0 |
  10. +-----------------------+-------+
  11. 6 rows in set (0.00 sec)

SHOW SETTINGS

SHOW SETTINGS is an SQL statement that displays the current settings from your configuration file. The setting names are represented in the following format: 'config_section_name'.'setting_name'

The result also contains two additionary values:

  • configuration_file - the path to the configuration file
  • worker_pid - the process id of the running searchd instance
  • SQL

SQL

  1. SHOW SETTINGS;

Response

  1. +--------------------------+-------------------------------------+
  2. | Setting_name | Value |
  3. +--------------------------+-------------------------------------+
  4. | configuration_file | /etc/manticoresearch/manticore.conf |
  5. | worker_pid | 658 |
  6. | searchd.listen | 0.0.0:9312 |
  7. | searchd.listen | 0.0.0:9306:mysql |
  8. | searchd.listen | 0.0.0:9308:http |
  9. | searchd.log | /var/log/manticore/searchd.log |
  10. | searchd.query_log | /var/log/manticore/query.log |
  11. | searchd.pid_file | /var/run/manticore/searchd.pid |
  12. | searchd.data_dir | /var/lib/manticore |
  13. | searchd.query_log_format | sphinxql |
  14. | searchd.binlog_path | /var/lib/manticore/binlog |
  15. | common.plugin_dir | /usr/local/lib/manticore |
  16. | common.lemmatizer_base | /usr/share/manticore/morph/ |
  17. +--------------------------+-------------------------------------+
  18. 13 rows in set (0.00 sec)

SHOW AGENT STATUS

  1. SHOW AGENT ['agent_or_index'] STATUS [ LIKE pattern ]

SHOW AGENT STATUS displays the statistic of remote agents or of a distributed table. It includes the values like the age of the last request, last answer, the number of different kind of errors and successes, etc. Statistic is shown for every agent for last 1, 5 and 15 intervals, each of them of ha_period_karma seconds.

  • SQL
  • PHP
  • Python
  • javascript
  • Java

SQL PHP Python javascript Java

  1. SHOW AGENT STATUS;
  1. $client->nodes()->agentstatus();
  1. utilsApi.sql('SHOW AGENT STATUS')
  1. res = await utilsApi.sql("SHOW AGENT STATUS");
  1. utilsApi.sql("SHOW AGENT STATUS");

Response

  1. +------------------------------------+----------------------------+
  2. | Variable_name | Value |
  3. +------------------------------------+----------------------------+
  4. | status_period_seconds | 60 |
  5. | status_stored_periods | 15 |
  6. | ag_0_hostname | 192.168.0.202:6713 |
  7. | ag_0_references | 2 |
  8. | ag_0_lastquery | 0.41 |
  9. | ag_0_lastanswer | 0.19 |
  10. | ag_0_lastperiodmsec | 222 |
  11. | ag_0_pingtripmsec | 10.521 |
  12. | ag_0_errorsarow | 0 |
  13. | ag_0_1periods_query_timeouts | 0 |
  14. | ag_0_1periods_connect_timeouts | 0 |
  15. | ag_0_1periods_connect_failures | 0 |
  16. | ag_0_1periods_network_errors | 0 |
  17. | ag_0_1periods_wrong_replies | 0 |
  18. | ag_0_1periods_unexpected_closings | 0 |
  19. | ag_0_1periods_warnings | 0 |
  20. | ag_0_1periods_succeeded_queries | 27 |
  21. | ag_0_1periods_msecsperquery | 232.31 |
  22. | ag_0_5periods_query_timeouts | 0 |
  23. | ag_0_5periods_connect_timeouts | 0 |
  24. | ag_0_5periods_connect_failures | 0 |
  25. | ag_0_5periods_network_errors | 0 |
  26. | ag_0_5periods_wrong_replies | 0 |
  27. | ag_0_5periods_unexpected_closings | 0 |
  28. | ag_0_5periods_warnings | 0 |
  29. | ag_0_5periods_succeeded_queries | 146 |
  30. | ag_0_5periods_msecsperquery | 231.83 |
  31. | ag_1_hostname | 192.168.0.202:6714 |
  32. | ag_1_references | 2 |
  33. | ag_1_lastquery | 0.41 |
  34. | ag_1_lastanswer | 0.19 |
  35. | ag_1_lastperiodmsec | 220 |
  36. | ag_1_pingtripmsec | 10.004 |
  37. | ag_1_errorsarow | 0 |
  38. | ag_1_1periods_query_timeouts | 0 |
  39. | ag_1_1periods_connect_timeouts | 0 |
  40. | ag_1_1periods_connect_failures | 0 |
  41. | ag_1_1periods_network_errors | 0 |
  42. | ag_1_1periods_wrong_replies | 0 |
  43. | ag_1_1periods_unexpected_closings | 0 |
  44. | ag_1_1periods_warnings | 0 |
  45. | ag_1_1periods_succeeded_queries | 27 |
  46. | ag_1_1periods_msecsperquery | 231.24 |
  47. | ag_1_5periods_query_timeouts | 0 |
  48. | ag_1_5periods_connect_timeouts | 0 |
  49. | ag_1_5periods_connect_failures | 0 |
  50. | ag_1_5periods_network_errors | 0 |
  51. | ag_1_5periods_wrong_replies | 0 |
  52. | ag_1_5periods_unexpected_closings | 0 |
  53. | ag_1_5periods_warnings | 0 |
  54. | ag_1_5periods_succeeded_queries | 146 |
  55. | ag_1_5periods_msecsperquery | 230.85 |
  56. +------------------------------------+----------------------------+
  57. 50 rows in set (0.01 sec)
  1. Array(
  2. [status_period_seconds] => 60
  3. [status_stored_periods] => 15
  4. [ag_0_hostname] => 192.168.0.202:6713
  5. [ag_0_references] => 2
  6. [ag_0_lastquery] => 0.41
  7. [ag_0_lastanswer] => 0.19
  8. [ag_0_lastperiodmsec] => 222
  9. [ag_0_errorsarow] => 0
  10. [ag_0_1periods_query_timeouts] => 0
  11. [ag_0_1periods_connect_timeouts] => 0
  12. [ag_0_1periods_connect_failures] => 0
  13. [ag_0_1periods_network_errors] => 0
  14. [ag_0_1periods_wrong_replies] => 0
  15. [ag_0_1periods_unexpected_closings] => 0
  16. [ag_0_1periods_warnings] => 0
  17. [ag_0_1periods_succeeded_queries] => 27
  18. [ag_0_1periods_msecsperquery] => 232.31
  19. [ag_0_5periods_query_timeouts] => 0
  20. [ag_0_5periods_connect_timeouts] => 0
  21. [ag_0_5periods_connect_failures] => 0
  22. [ag_0_5periods_network_errors] => 0
  23. [ag_0_5periods_wrong_replies] => 0
  24. [ag_0_5periods_unexpected_closings] => 0
  25. [ag_0_5periods_warnings] => 0
  26. [ag_0_5periods_succeeded_queries] => 146
  27. [ag_0_5periods_msecsperquery] => 231.83
  28. [ag_1_hostname 192.168.0.202:6714
  29. [ag_1_references] => 2
  30. [ag_1_lastquery] => 0.41
  31. [ag_1_lastanswer] => 0.19
  32. [ag_1_lastperiodmsec] => 220
  33. [ag_1_errorsarow] => 0
  34. [ag_1_1periods_query_timeouts] => 0
  35. [ag_1_1periods_connect_timeouts] => 0
  36. [ag_1_1periods_connect_failures] => 0
  37. [ag_1_1periods_network_errors] => 0
  38. [ag_1_1periods_wrong_replies] => 0
  39. [ag_1_1periods_unexpected_closings] => 0
  40. [ag_1_1periods_warnings] => 0
  41. [ag_1_1periods_succeeded_queries] => 27
  42. [ag_1_1periods_msecsperquery] => 231.24
  43. [ag_1_5periods_query_timeouts] => 0
  44. [ag_1_5periods_connect_timeouts] => 0
  45. [ag_1_5periods_connect_failures] => 0
  46. [ag_1_5periods_network_errors] => 0
  47. [ag_1_5periods_wrong_replies] => 0
  48. [ag_1_5periods_unexpected_closings
  49. [ag_1_5periods_warnings] => 0
  50. [ag_1_5periods_succeeded_queries] => 146
  51. [ag_1_5periods_msecsperquery] => 230.85
  52. )
  1. {u'columns': [{u'Key': {u'type': u'string'}},
  2. {u'Value': {u'type': u'string'}}],
  3. u'data': [
  4. {u'Key': u'status_period_seconds', u'Value': u'60'},
  5. {u'Key': u'status_stored_periods', u'Value': u'15'},
  6. {u'Key': u'ag_0_hostname', u'Value': u'192.168.0.202:6713'},
  7. {u'Key': u'ag_0_references', u'Value': u'2'},
  8. {u'Key': u'ag_0_lastquery', u'Value': u'0.41'},
  9. {u'Key': u'ag_0_lastanswer', u'Value': u'0.19'},
  10. {u'Key': u'ag_0_lastperiodmsec', u'Value': u'222'},
  11. {u'Key': u'ag_0_errorsarow', u'Value': u'0'},
  12. {u'Key': u'ag_0_1periods_query_timeouts', u'Value': u'0'},
  13. {u'Key': u'ag_0_1periods_connect_timeouts', u'Value': u'0'},
  14. {u'Key': u'ag_0_1periods_connect_failures', u'Value': u'0'},
  15. {u'Key': u'ag_0_1periods_network_errors', u'Value': u'0'},
  16. {u'Key': u'ag_0_1periods_wrong_replies', u'Value': u'0'},
  17. {u'Key': u'ag_0_1periods_unexpected_closings', u'Value': u'0'},
  18. {u'Key': u'ag_0_1periods_warnings', u'Value': u'0'},
  19. {u'Key': u'ag_0_1periods_succeeded_queries', u'Value': u'27'},
  20. {u'Key': u'ag_0_1periods_msecsperquery', u'Value': u'232.31'},
  21. {u'Key': u'ag_0_5periods_query_timeouts', u'Value': u'0'},
  22. {u'Key': u'ag_0_5periods_connect_timeouts', u'Value': u'0'},
  23. {u'Key': u'ag_0_5periods_connect_failures', u'Value': u'0'},
  24. {u'Key': u'ag_0_5periods_network_errors', u'Value': u'0'},
  25. {u'Key': u'ag_0_5periods_wrong_replies', u'Value': u'0'},
  26. {u'Key': u'ag_0_5periods_unexpected_closings', u'Value': u'0'},
  27. {u'Key': u'ag_0_5periods_warnings', u'Value': u'0'},
  28. {u'Key': u'ag_0_5periods_succeeded_queries', u'Value': u'146'},
  29. {u'Key': u'ag_0_5periods_msecsperquery', u'Value': u'231.83'},
  30. {u'Key': u'ag_1_hostname 192.168.0.202:6714'},
  31. {u'Key': u'ag_1_references', u'Value': u'2'},
  32. {u'Key': u'ag_1_lastquery', u'Value': u'0.41'},
  33. {u'Key': u'ag_1_lastanswer', u'Value': u'0.19'},
  34. {u'Key': u'ag_1_lastperiodmsec', u'Value': u'220'},
  35. {u'Key': u'ag_1_errorsarow', u'Value': u'0'},
  36. {u'Key': u'ag_1_1periods_query_timeouts', u'Value': u'0'},
  37. {u'Key': u'ag_1_1periods_connect_timeouts', u'Value': u'0'},
  38. {u'Key': u'ag_1_1periods_connect_failures', u'Value': u'0'},
  39. {u'Key': u'ag_1_1periods_network_errors', u'Value': u'0'},
  40. {u'Key': u'ag_1_1periods_wrong_replies', u'Value': u'0'},
  41. {u'Key': u'ag_1_1periods_unexpected_closings', u'Value': u'0'},
  42. {u'Key': u'ag_1_1periods_warnings', u'Value': u'0'},
  43. {u'Key': u'ag_1_1periods_succeeded_queries', u'Value': u'27'},
  44. {u'Key': u'ag_1_1periods_msecsperquery', u'Value': u'231.24'},
  45. {u'Key': u'ag_1_5periods_query_timeouts', u'Value': u'0'},
  46. {u'Key': u'ag_1_5periods_connect_timeouts', u'Value': u'0'},
  47. {u'Key': u'ag_1_5periods_connect_failures', u'Value': u'0'},
  48. {u'Key': u'ag_1_5periods_network_errors', u'Value': u'0'},
  49. {u'Key': u'ag_1_5periods_wrong_replies', u'Value': u'0'},
  50. {u'Key': u'ag_1_5periods_warnings', u'Value': u'0'},
  51. {u'Key': u'ag_1_5periods_succeeded_queries', u'Value': u'146'},
  52. {u'Key': u'ag_1_5periods_msecsperquery', u'Value': u'230.85'}],
  53. u'error': u'',
  54. u'total': 0,
  55. u'warning': u''}
  1. {"columns": [{"Key": {"type": "string"}},
  2. {"Value": {"type": "string"}}],
  3. "data": [
  4. {"Key": "status_period_seconds", "Value": "60"},
  5. {"Key": "status_stored_periods", "Value": "15"},
  6. {"Key": "ag_0_hostname", "Value": "192.168.0.202:6713"},
  7. {"Key": "ag_0_references", "Value": "2"},
  8. {"Key": "ag_0_lastquery", "Value": "0.41"},
  9. {"Key": "ag_0_lastanswer", "Value": "0.19"},
  10. {"Key": "ag_0_lastperiodmsec", "Value": "222"},
  11. {"Key": "ag_0_errorsarow", "Value": "0"},
  12. {"Key": "ag_0_1periods_query_timeouts", "Value": "0"},
  13. {"Key": "ag_0_1periods_connect_timeouts", "Value": "0"},
  14. {"Key": "ag_0_1periods_connect_failures", "Value": "0"},
  15. {"Key": "ag_0_1periods_network_errors", "Value": "0"},
  16. {"Key": "ag_0_1periods_wrong_replies", "Value": "0"},
  17. {"Key": "ag_0_1periods_unexpected_closings", "Value": "0"},
  18. {"Key": "ag_0_1periods_warnings", "Value": "0"},
  19. {"Key": "ag_0_1periods_succeeded_queries", "Value": "27"},
  20. {"Key": "ag_0_1periods_msecsperquery", "Value": "232.31"},
  21. {"Key": "ag_0_5periods_query_timeouts", "Value": "0"},
  22. {"Key": "ag_0_5periods_connect_timeouts", "Value": "0"},
  23. {"Key": "ag_0_5periods_connect_failures", "Value": "0"},
  24. {"Key": "ag_0_5periods_network_errors", "Value": "0"},
  25. {"Key": "ag_0_5periods_wrong_replies", "Value": "0"},
  26. {"Key": "ag_0_5periods_unexpected_closings", "Value": "0"},
  27. {"Key": "ag_0_5periods_warnings", "Value": "0"},
  28. {"Key": "ag_0_5periods_succeeded_queries", "Value": "146"},
  29. {"Key": "ag_0_5periods_msecsperquery", "Value": "231.83"},
  30. {"Key": "ag_1_hostname 192.168.0.202:6714"},
  31. {"Key": "ag_1_references", "Value": "2"},
  32. {"Key": "ag_1_lastquery", "Value": "0.41"},
  33. {"Key": "ag_1_lastanswer", "Value": "0.19"},
  34. {"Key": "ag_1_lastperiodmsec", "Value": "220"},
  35. {"Key": "ag_1_errorsarow", "Value": "0"},
  36. {"Key": "ag_1_1periods_query_timeouts", "Value": "0"},
  37. {"Key": "ag_1_1periods_connect_timeouts", "Value": "0"},
  38. {"Key": "ag_1_1periods_connect_failures", "Value": "0"},
  39. {"Key": "ag_1_1periods_network_errors", "Value": "0"},
  40. {"Key": "ag_1_1periods_wrong_replies", "Value": "0"},
  41. {"Key": "ag_1_1periods_unexpected_closings", "Value": "0"},
  42. {"Key": "ag_1_1periods_warnings", "Value": "0"},
  43. {"Key": "ag_1_1periods_succeeded_queries", "Value": "27"},
  44. {"Key": "ag_1_1periods_msecsperquery", "Value": "231.24"},
  45. {"Key": "ag_1_5periods_query_timeouts", "Value": "0"},
  46. {"Key": "ag_1_5periods_connect_timeouts", "Value": "0"},
  47. {"Key": "ag_1_5periods_connect_failures", "Value": "0"},
  48. {"Key": "ag_1_5periods_network_errors", "Value": "0"},
  49. {"Key": "ag_1_5periods_wrong_replies", "Value": "0"},
  50. {"Key": "ag_1_5periods_warnings", "Value": "0"},
  51. {"Key": "ag_1_5periods_succeeded_queries", "Value": "146"},
  52. {"Key": "ag_1_5periods_msecsperquery", "Value": "230.85"}],
  53. "error": "",
  54. "total": 0,
  55. "warning": ""}
  1. {columns=[{ Key : { type=string }},
  2. { Value : { type=string }}],
  3. data : [
  4. { Key=status_period_seconds , Value=60 },
  5. { Key=status_stored_periods , Value=15 },
  6. { Key=ag_0_hostname , Value=192.168.0.202:6713 },
  7. { Key=ag_0_references , Value=2 },
  8. { Key=ag_0_lastquery , Value=0.41 },
  9. { Key=ag_0_lastanswer , Value=0.19 },
  10. { Key=ag_0_lastperiodmsec , Value=222 },
  11. { Key=ag_0_errorsarow , Value=0 },
  12. { Key=ag_0_1periods_query_timeouts , Value=0 },
  13. { Key=ag_0_1periods_connect_timeouts , Value=0 },
  14. { Key=ag_0_1periods_connect_failures , Value=0 },
  15. { Key=ag_0_1periods_network_errors , Value=0 },
  16. { Key=ag_0_1periods_wrong_replies , Value=0 },
  17. { Key=ag_0_1periods_unexpected_closings , Value=0 },
  18. { Key=ag_0_1periods_warnings , Value=0 },
  19. { Key=ag_0_1periods_succeeded_queries , Value=27 },
  20. { Key=ag_0_1periods_msecsperquery , Value=232.31 },
  21. { Key=ag_0_5periods_query_timeouts , Value=0 },
  22. { Key=ag_0_5periods_connect_timeouts , Value=0 },
  23. { Key=ag_0_5periods_connect_failures , Value=0 },
  24. { Key=ag_0_5periods_network_errors , Value=0 },
  25. { Key=ag_0_5periods_wrong_replies , Value=0 },
  26. { Key=ag_0_5periods_unexpected_closings , Value=0 },
  27. { Key=ag_0_5periods_warnings , Value=0 },
  28. { Key=ag_0_5periods_succeeded_queries , Value=146 },
  29. { Key=ag_0_5periods_msecsperquery , Value=231.83 },
  30. { Key=ag_1_hostname 192.168.0.202:6714 },
  31. { Key=ag_1_references , Value=2 },
  32. { Key=ag_1_lastquery , Value=0.41 },
  33. { Key=ag_1_lastanswer , Value=0.19 },
  34. { Key=ag_1_lastperiodmsec , Value=220 },
  35. { Key=ag_1_errorsarow , Value=0 },
  36. { Key=ag_1_1periods_query_timeouts , Value=0 },
  37. { Key=ag_1_1periods_connect_timeouts , Value=0 },
  38. { Key=ag_1_1periods_connect_failures , Value=0 },
  39. { Key=ag_1_1periods_network_errors , Value=0 },
  40. { Key=ag_1_1periods_wrong_replies , Value=0 },
  41. { Key=ag_1_1periods_unexpected_closings , Value=0 },
  42. { Key=ag_1_1periods_warnings , Value=0 },
  43. { Key=ag_1_1periods_succeeded_queries , Value=27 },
  44. { Key=ag_1_1periods_msecsperquery , Value=231.24 },
  45. { Key=ag_1_5periods_query_timeouts , Value=0 },
  46. { Key=ag_1_5periods_connect_timeouts , Value=0 },
  47. { Key=ag_1_5periods_connect_failures , Value=0 },
  48. { Key=ag_1_5periods_network_errors , Value=0 },
  49. { Key=ag_1_5periods_wrong_replies , Value=0 },
  50. { Key=ag_1_5periods_warnings , Value=0 },
  51. { Key=ag_1_5periods_succeeded_queries , Value=146 },
  52. { Key=ag_1_5periods_msecsperquery , Value=230.85 }],
  53. error= ,
  54. total=0,
  55. warning= }

An optional LIKE clause is supported, syntax is the same as in SHOW STATUS.

  • SQL
  • PHP
  • Python
  • javascript
  • Java

SQL PHP Python javascript Java

  1. SHOW AGENT STATUS LIKE '%5period%msec%';
  1. $client->nodes()->agentstatus(
  2. ['body'=>
  3. ['pattern'=>'%5period%msec%']
  4. ]
  5. );
  1. utilsApi.sql('SHOW AGENT STATUS LIKE \'%5period%msec%\'')
  1. res = await utilsApi.sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"");
  1. utilsApi.sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"");

Response

  1. +-----------------------------+--------+
  2. | Key | Value |
  3. +-----------------------------+--------+
  4. | ag_0_5periods_msecsperquery | 234.72 |
  5. | ag_1_5periods_msecsperquery | 233.73 |
  6. | ag_2_5periods_msecsperquery | 343.81 |
  7. +-----------------------------+--------+
  8. 3 rows in set (0.00 sec)
  1. Array(
  2. [ag_0_5periods_msecsperquery] => 234.72
  3. [ag_1_5periods_msecsperquery] => 233.73
  4. [ag_2_5periods_msecsperquery] => 343.81
  5. )
  1. {u'columns': [{u'Key': {u'type': u'string'}},
  2. {u'Value': {u'type': u'string'}}],
  3. u'data': [
  4. {u'Key': u'ag_0_5periods_msecsperquery', u'Value': u'234.72'},
  5. {u'Key': u'ag_1_5periods_msecsperquery', u'Value': u'233.73'},
  6. {u'Key': u'ag_2_5periods_msecsperquery', u'Value': u'343.81'}],
  7. u'error': u'',
  8. u'total': 0,
  9. u'warning': u''}
  1. {"columns": [{"Key": {"type": "string"}},
  2. {"Value": {"type": "string"}}],
  3. "data": [
  4. {"Key": "ag_0_5periods_msecsperquery", "Value": "234.72"},
  5. {"Key": "ag_1_5periods_msecsperquery", "Value": "233.73"},
  6. {"Key": "ag_2_5periods_msecsperquery", "Value": "343.81"}],
  7. "error": "",
  8. "total": 0,
  9. "warning": ""}
  1. {columns: [{Key={type=string}},
  2. {Value={type=string}}],
  3. data: [
  4. {Key=ag_0_5periods_msecsperquery, Value=234.72},
  5. {Key=ag_1_5periods_msecsperquery, Value=233.73},
  6. {Key=ag_2_5periods_msecsperquery, Value=343.81}],
  7. error: ,
  8. total: 0,
  9. warning: }

You can specify a particular agent by its address. In this case only that agent’s data will be displayed. Also, agent_ prefix will be used instead of ag_N_:

  • SQL
  • PHP
  • Python
  • javascript
  • Java

SQL PHP Python javascript Java

  1. SHOW AGENT '192.168.0.202:6714' STATUS LIKE '%15periods%';
  1. $client->nodes()->agentstatus(
  2. ['body'=>
  3. ['agent'=>'192.168.0.202:6714'],
  4. ['pattern'=>'%5period%msec%']
  5. ]
  6. );
  1. utilsApi.sql('SHOW AGENT \'192.168.0.202:6714\' STATUS LIKE \'%15periods%\'')
  1. res = await utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");
  1. utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");

Response

  1. +-------------------------------------+--------+
  2. | Variable_name | Value |
  3. +-------------------------------------+--------+
  4. | agent_15periods_query_timeouts | 0 |
  5. | agent_15periods_connect_timeouts | 0 |
  6. | agent_15periods_connect_failures | 0 |
  7. | agent_15periods_network_errors | 0 |
  8. | agent_15periods_wrong_replies | 0 |
  9. | agent_15periods_unexpected_closings | 0 |
  10. | agent_15periods_warnings | 0 |
  11. | agent_15periods_succeeded_queries | 439 |
  12. | agent_15periods_msecsperquery | 231.73 |
  13. +-------------------------------------+--------+
  14. 9 rows in set (0.00 sec)
  1. Array(
  2. [agent_15periods_query_timeouts] => 0
  3. [agent_15periods_connect_timeouts] => 0
  4. [agent_15periods_connect_failures] => 0
  5. [agent_15periods_network_errors] => 0
  6. [agent_15periods_wrong_replies] => 0
  7. [agent_15periods_unexpected_closings] => 0
  8. [agent_15periods_warnings] => 0
  9. [agent_15periods_succeeded_queries] => 439
  10. [agent_15periods_msecsperquery] => 231.73
  11. )
  1. {u'columns': [{u'Key': {u'type': u'string'}},
  2. {u'Value': {u'type': u'string'}}],
  3. u'data': [
  4. {u'Key': u'agent_15periods_query_timeouts', u'Value': u'0'},
  5. {u'Key': u'agent_15periods_connect_timeouts', u'Value': u'0'},
  6. {u'Key': u'agent_15periods_connect_failures', u'Value': u'0'},
  7. {u'Key': u'agent_15periods_network_errors', u'Value': u'0'},
  8. {u'Key': u'agent_15periods_connect_failures', u'Value': u'0'},
  9. {u'Key': u'agent_15periods_wrong_replies', u'Value': u'0'},
  10. {u'Key': u'agent_15periods_unexpected_closings', u'Value': u'0'},
  11. {u'Key': u'agent_15periods_warnings', u'Value': u'0'},
  12. {u'Key': u'agent_15periods_succeeded_queries', u'Value': u'439'},
  13. {u'Key': u'agent_15periods_msecsperquery', u'Value': u'233.73'},
  14. ],
  15. u'error': u'',
  16. u'total': 0,
  17. u'warning': u''}
  1. {"columns": [{"Key": {"type": "string"}},
  2. {"Value": {"type": "string"}}],
  3. "data": [
  4. {"Key": "agent_15periods_query_timeouts", "Value": "0"},
  5. {"Key": "agent_15periods_connect_timeouts", "Value": "0"},
  6. {"Key": "agent_15periods_connect_failures", "Value": "0"},
  7. {"Key": "agent_15periods_network_errors", "Value": "0"},
  8. {"Key": "agent_15periods_connect_failures", "Value": "0"},
  9. {"Key": "agent_15periods_wrong_replies", "Value": "0"},
  10. {"Key": "agent_15periods_unexpected_closings", "Value": "0"},
  11. {"Key": "agent_15periods_warnings", "Value": "0"},
  12. {"Key": "agent_15periods_succeeded_queries", "Value": "439"},
  13. {"Key": "agent_15periods_msecsperquery", "Value": "233.73"},
  14. ],
  15. "error": "",
  16. "total": 0,
  17. "warning": ""}
  1. {columns=[{Key={type=string}},
  2. {Value={type=string}}],
  3. data=[
  4. {Key=agent_15periods_query_timeouts, Value=0},
  5. {Key=agent_15periods_connect_timeouts, Value=0},
  6. {Key=agent_15periods_connect_failures, Value=0},
  7. {Key=agent_15periods_network_errors, Value=0},
  8. {Key=agent_15periods_connect_failures, Value=0},
  9. {Key=agent_15periods_wrong_replies, Value=0},
  10. {Key=agent_15periods_unexpected_closings, Value=0},
  11. {Key=agent_15periods_warnings, Value=0},
  12. {Key=agent_15periods_succeeded_queries, Value=439},
  13. {Key=agent_15periods_msecsperquery, Value=233.73},
  14. ],
  15. error=,
  16. total=0,
  17. warning=}

Finally, you can check the status of the agents in a specific distributed table. It can be done with a SHOW AGENT index_name STATUS statement. That statement shows the table HA status (i.e. whether or not it uses agent mirrors at all), and then the mirror information (specifically: address, blackhole and persistent flags, and the mirror selection probability used when one of the weighted probability strategies is in effect).

  • SQL
  • PHP
  • Python
  • javascript
  • Java

SQL PHP Python javascript Java

  1. SHOW AGENT dist_index STATUS;
  1. $client->nodes()->agentstatus(
  2. ['body'=>
  3. ['agent'=>'dist_index']
  4. ]
  5. );
  1. utilsApi.sql('SHOW AGENT \'192.168.0.202:6714\' STATUS LIKE \'%15periods%\'')
  1. res = await utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");
  1. utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");

Response

  1. +--------------------------------------+--------------------------------+
  2. | Variable_name | Value |
  3. +--------------------------------------+--------------------------------+
  4. | dstindex_1_is_ha | 1 |
  5. | dstindex_1mirror1_id | 192.168.0.202:6713:loc |
  6. | dstindex_1mirror1_probability_weight | 0.372864 |
  7. | dstindex_1mirror1_is_blackhole | 0 |
  8. | dstindex_1mirror1_is_persistent | 0 |
  9. | dstindex_1mirror2_id | 192.168.0.202:6714:loc |
  10. | dstindex_1mirror2_probability_weight | 0.374635 |
  11. | dstindex_1mirror2_is_blackhole | 0 |
  12. | dstindex_1mirror2_is_persistent | 0 |
  13. | dstindex_1mirror3_id | dev1.manticoresearch.com:6714:loc |
  14. | dstindex_1mirror3_probability_weight | 0.252501 |
  15. | dstindex_1mirror3_is_blackhole | 0 |
  16. | dstindex_1mirror3_is_persistent | 0 |
  17. +--------------------------------------+--------------------------------+
  18. 13 rows in set (0.00 sec)
  1. Array(
  2. [dstindex_1_is_ha] => 1
  3. [dstindex_1mirror1_id] => 192.168.0.202:6713:loc
  4. [dstindex_1mirror1_probability_weight] => 0.372864
  5. [dstindex_1mirror1_is_blackhole] => 0
  6. [dstindex_1mirror1_is_persistent] => 0
  7. [dstindex_1mirror2_id] => 192.168.0.202:6714:loc
  8. [dstindex_1mirror2_probability_weight] => 0.374635
  9. [dstindex_1mirror2_is_blackhole] => 0
  10. [dstindex_1mirror2_is_persistent] => 0
  11. [dstindex_1mirror3_id] => dev1.manticoresearch.com:6714:loc
  12. [dstindex_1mirror3_probability_weight] => 0.252501
  13. [dstindex_1mirror3_is_blackhole] => 0
  14. [dstindex_1mirror3_is_persistent] => 0
  15. )
  1. {u'columns': [{u'Key': {u'type': u'string'}},
  2. {u'Value': {u'type': u'string'}}],
  3. u'data': [
  4. {u'Key': u'dstindex_1_is_ha', u'Value': u'1'},
  5. {u'Key': u'dstindex_1mirror1_id', u'Value': u'192.168.0.202:6713:loc'},
  6. {u'Key': u'dstindex_1mirror1_probability_weight', u'Value': u'0.372864'},
  7. {u'Key': u'dstindex_1mirror1_is_blackhole', u'Value': u'0'},
  8. {u'Key': u'dstindex_1mirror1_is_persistent', u'Value': u'0'},
  9. {u'Key': u'dstindex_1mirror2_id', u'Value': u'192.168.0.202:6714:loc'},
  10. {u'Key': u'dstindex_1mirror2_probability_weight', u'Value': u'0.374635'},
  11. {u'Key': u'dstindex_1mirror2_is_blackhole', u'Value': u'0'},
  12. {u'Key': u'dstindex_1mirror2_is_persistent', u'Value': u'439'},
  13. {u'Key': u'dstindex_1mirror3_id', u'Value': u'dev1.manticoresearch.com:6714:loc'},
  14. {u'Key': u'dstindex_1mirror3_probability_weight', u'Value': u' 0.252501'},
  15. {u'Key': u'dstindex_1mirror3_is_blackhole', u'Value': u'0'},
  16. {u'Key': u'dstindex_1mirror3_is_persistent', u'Value': u'439'}
  17. ],
  18. u'error': u'',
  19. u'total': 0,
  20. u'warning': u''}
  1. {"columns": [{"Key": {"type": "string"}},
  2. {"Value": {"type": "string"}}],
  3. "data": [
  4. {"Key": "dstindex_1_is_ha", "Value": "1"},
  5. {"Key": "dstindex_1mirror1_id", "Value": "192.168.0.202:6713:loc"},
  6. {"Key": "dstindex_1mirror1_probability_weight", "Value": "0.372864"},
  7. {"Key": "dstindex_1mirror1_is_blackhole", "Value": "0"},
  8. {"Key": "dstindex_1mirror1_is_persistent", "Value": "0"},
  9. {"Key": "dstindex_1mirror2_id", "Value": "192.168.0.202:6714:loc"},
  10. {"Key": "dstindex_1mirror2_probability_weight", "Value": "0.374635"},
  11. {"Key": "dstindex_1mirror2_is_blackhole", "Value": "0"},
  12. {"Key": "dstindex_1mirror2_is_persistent", "Value": "439"},
  13. {"Key": "dstindex_1mirror3_id", "Value": "dev1.manticoresearch.com:6714:loc"},
  14. {"Key": "dstindex_1mirror3_probability_weight", "Value": " 0.252501"},
  15. {"Key": "dstindex_1mirror3_is_blackhole", "Value": "0"},
  16. {"Key": "dstindex_1mirror3_is_persistent", "Value": "439"}
  17. ],
  18. "error": "",
  19. "total": 0,
  20. "warning": ""}
  1. {columns=[{Key={type=string}},
  2. {Value={type=string}}],
  3. data=[
  4. {Key=dstindex_1_is_ha, Value=1},
  5. {Key=dstindex_1mirror1_id, Value=192.168.0.202:6713:loc},
  6. {Key=dstindex_1mirror1_probability_weight, Value=0.372864},
  7. {Key=dstindex_1mirror1_is_blackhole, Value=0},
  8. {Key=dstindex_1mirror1_is_persistent, Value=0},
  9. {Key=dstindex_1mirror2_id, Value=192.168.0.202:6714:loc},
  10. {Key=dstindex_1mirror2_probability_weight, Value=0.374635},
  11. {Key=dstindex_1mirror2_is_blackhole, Value=0},
  12. {Key=dstindex_1mirror2_is_persistent, Value=439},
  13. {Key=dstindex_1mirror3_id, Value=dev1.manticoresearch.com:6714:loc},
  14. {Key=dstindex_1mirror3_probability_weight, Value= 0.252501},
  15. {Key=dstindex_1mirror3_is_blackhole, Value=0},
  16. {Key=dstindex_1mirror3_is_persistent, Value=439}
  17. ],
  18. error=,
  19. total=0,
  20. warning=}

SHOW CHARACTER SET

  1. SHOW CHARACTER SET

This is currently a placeholder query that does nothing and reports that a UTF-8 character set is available. It was added in order to keep compatibility with frameworks and connectors that automatically execute this statement.

  1. mysql> SHOW CHARACTER SET;
  2. +---------+---------------+-------------------+--------+
  3. | Charset | Description | Default collation | Maxlen |
  4. +---------+---------------+-------------------+--------+
  5. | utf8 | UTF-8 Unicode | utf8_general_ci | 3 |
  6. +---------+---------------+-------------------+--------+
  7. 1 row in set (0.00 sec)