Giter Club home page Giter Club logo

Comments (3)

Mickyun avatar Mickyun commented on August 15, 2024
您好,默认digest会存储到Kafka中,您需要修改Arkproxy的配置文件,修改storage为MYSQL,添加将digest数据存储到的数据库IP、port、username、password【具体修改参数见下面的图片】
然后重启Arkproxy,通过业务端口执行的语句都会被存储到指定的MySQL数据库的mysql.query_digest表中。

image

下图为测试结果

image

image

如果在修改的过程中有疑问,随时issue沟通,感谢~

from arkproxy.

mawenbin666 avatar mawenbin666 commented on August 15, 2024
  • 功能实现,但是有一个不太完美的地方
proxy_digest_trace = ON
proxy_sql_trace = ON
这两个参数不能热加载,
比如 config reload,config flush 执行了都不生效,
需要物理重启才能生效,当遇到遇到分析具体问题的时候,这种物理重启会造成线上业务短暂的不可用,不太方便。
如果能做到热加载就完美了。

from arkproxy.

Mickyun avatar Mickyun commented on August 15, 2024

您好:
支持动态加载的,这个是我在自己的测试环境测试的步骤,您可以按照下面的操作测试一下。
操作步骤如下:

  1. 使用set global的方式关闭trace和digest
mysql> set global proxy_sql_trace = off;

mysql> set global proxy_digest_trace =off;
  1. 将配置加载到外部的配置文件中
show variables;  //获取proxy_config_file参数值

config write outfile '/data/arkagent/package/arkproxy/conf/arkproxy_14444.cnf';  //用proxy_config_file值替换


mysql> show variables;
+--------------------------------------+---------------------------------------------------------+
| Variable_name                        | Value                                                   |
+--------------------------------------+---------------------------------------------------------+
| proxy_async_connect_server           | ON                                                      |
| proxy_backend_passwd                 | arkproxy                                                |
| proxy_backend_user                   | arkproxy                                                |
| proxy_check_consistend_period        | 10                                                      |
| proxy_check_slave_lag_period         | 10                                                      |
| proxy_config_file                    | /data/arkagent/package/arkproxy/conf/arkproxy_14444.cnf |
| proxy_config_host                    |                                                         |
| proxy_config_passwd                  |                                                         |
| proxy_config_port                    | 0                                                       |
| proxy_config_user                    |                                                         |
| proxy_consistend_max_delay_time      | 1000                                                    |
| proxy_digest_trace                   | ON                                                      |
| proxy_enable_consistend_read         | 0                                                       |
| proxy_flush_thread_num               | 5                                                       |
| proxy_format_fullpath                | OFF                                                     |
| proxy_format_num_per_time            | 10                                                      |
| proxy_format_parameterize            | ON                                                      |
| proxy_format_thread_num              | 5                                                       |
| proxy_general_log                    | OFF                                                     |
| proxy_general_log_file               | /data/arkagent/package/arkproxy/log/arkproxy_14444.log  |
| proxy_incoming_addresses             | 10.0.0.174:14544                                        |
| proxy_init_connect                   |                                                         |
| proxy_log_error                      | /data/arkagent/package/arkproxy/log/error_14444.log     |
| proxy_max_connections                | 1000                                                    |
| proxy_multi_write_mode               | OFF                                                     |
| proxy_namespace                      |                                                         |
| proxy_net_buffer_outlier_scale       | 1.500000                                                |
| proxy_net_per_buffer_max_size        | 0                                                       |
| proxy_non_encrypted_ips              | 127.0.0.1                                               |
| proxy_not_router_mode                | OFF                                                     |
| proxy_port                           | 14444                                                   |
| proxy_recv_queue_size                | 1000                                                    |
| proxy_send_queue_size                | 10                                                      |
| proxy_server_address                 | 10.0.0.174                                              |
| proxy_server_heartbeat_period        | 100                                                     |
| proxy_server_uuid                    | 0f529943-2022-11eb-87be-080027458038                    |
| proxy_shell_listen_port              | 14544                                                   |
| proxy_shell_password                 | vMFqq2EQxJopv8g6                                        |
| proxy_shell_username                 | arkproxy                                                |
| proxy_sql_trace                      | ON                                                      |
| proxy_sql_trace_thread_num           | 5                                                       |
| proxy_thread_pool_idle_timeout       | 60                                                      |
| proxy_thread_pool_max_threads        | 65536                                                   |
| proxy_thread_pool_oversubscribe      | 3                                                       |
| proxy_thread_pool_size               | 8                                                       |
| proxy_thread_pool_stall_limit        | 500                                                     |
| proxy_trace_busy_strategy            | 0                                                       |
| proxy_trace_busy_wait_time           | 500                                                     |
| proxy_trace_client_queue_size        | 1000                                                    |
| proxy_trace_flush_thread_sleep_msec  | 500                                                     |
| proxy_trace_format_thread_sleep_msec | 500                                                     |
| proxy_trace_hash_mem_length          | 134217728                                               |
| proxy_trace_hash_size                | 200                                                     |
| proxy_trace_max_delay_time           | 3                                                       |
| proxy_trace_queue_array_length       | 500                                                     |
| proxy_trace_sql_bucket_length        | 100                                                     |
| proxy_trace_storage                  | MYSQL                                                   |
| proxy_trace_storage_host             | 10.0.0.173                                              |
| proxy_trace_storage_passwd           | arkcontrol                                              |
| proxy_trace_storage_port             | 4444                                                    |
| proxy_trace_storage_user             | arkcontrol                                              |
| proxy_username_encypted              | OFF                                                     |
| proxy_version                        | 20.06.30                                                |
+--------------------------------------+---------------------------------------------------------+
63 rows in set (0.07 sec)

查看variables已经为关闭状态

mysql> show variables;
+--------------------------------------+---------------------------------------------------------+
| Variable_name | Value |
+--------------------------------------+---------------------------------------------------------+
| proxy_async_connect_server | ON |
| proxy_backend_passwd | arkproxy |
| proxy_backend_user | arkproxy |
| proxy_check_consistend_period | 10 |
| proxy_check_slave_lag_period | 10 |
| proxy_config_file | /data/arkagent/package/arkproxy/conf/arkproxy_14444.cnf |
| proxy_config_host | |
| proxy_config_passwd | |
| proxy_config_port | 0 |
| proxy_config_user | |
| proxy_consistend_max_delay_time | 1000 |
| proxy_digest_trace | OFF |
| proxy_enable_consistend_read | 0 |
| proxy_flush_thread_num | 5 |
| proxy_format_fullpath | OFF |
| proxy_format_num_per_time | 10 |
| proxy_format_parameterize | ON |
| proxy_format_thread_num | 5 |
| proxy_general_log | OFF |
| proxy_general_log_file | /data/arkagent/package/arkproxy/log/arkproxy_14444.log |
| proxy_incoming_addresses | 10.0.0.174:14544 |
| proxy_init_connect | |
| proxy_log_error | /data/arkagent/package/arkproxy/log/error_14444.log |
| proxy_max_connections | 1000 |
| proxy_multi_write_mode | OFF |
| proxy_namespace | |
| proxy_net_buffer_outlier_scale | 1.500000 |
| proxy_net_per_buffer_max_size | 0 |
| proxy_non_encrypted_ips | 127.0.0.1 |
| proxy_not_router_mode | OFF |
| proxy_port | 14444 |
| proxy_recv_queue_size | 1000 |
| proxy_send_queue_size | 10 |
| proxy_server_address | 10.0.0.174 |
| proxy_server_heartbeat_period | 100 |
| proxy_server_uuid | 0f529943-2022-11eb-87be-080027458038 |
| proxy_shell_listen_port | 14544 |
| proxy_shell_password | vMFqq2EQxJopv8g6 |
| proxy_shell_username | arkproxy |
| proxy_sql_trace | OFF |
| proxy_sql_trace_thread_num | 5 |
| proxy_thread_pool_idle_timeout | 60 |
| proxy_thread_pool_max_threads | 65536 |
| proxy_thread_pool_oversubscribe | 3 |
| proxy_thread_pool_size | 8 |
| proxy_thread_pool_stall_limit | 500 |
| proxy_trace_busy_strategy | 0 |
| proxy_trace_busy_wait_time | 500 |
| proxy_trace_client_queue_size | 1000 |
| proxy_trace_flush_thread_sleep_msec | 500 |
| proxy_trace_format_thread_sleep_msec | 500 |
| proxy_trace_hash_mem_length | 134217728 |
| proxy_trace_hash_size | 200 |
| proxy_trace_max_delay_time | 3 |
| proxy_trace_queue_array_length | 500 |
| proxy_trace_sql_bucket_length | 100 |
| proxy_trace_storage | MYSQL |
| proxy_trace_storage_host | 10.0.0.173 |
| proxy_trace_storage_passwd | arkcontrol |
| proxy_trace_storage_port | 4444 |
| proxy_trace_storage_user | arkcontrol |
| proxy_username_encypted | OFF |
| proxy_version | 20.06.30 |
+--------------------------------------+---------------------------------------------------------+
63 rows in set (0.08 sec)

  1. 查看配置文件
[arkproxy]
proxy_async_connect_server               = ON
proxy_backend_passwd                     = arkproxy
proxy_backend_user                       = arkproxy
proxy_check_consistend_period            = 10
proxy_check_slave_lag_period             = 10
proxy_config_host                        =
proxy_config_passwd                      =
proxy_config_port                        = 0
proxy_config_user                        =
proxy_consistend_max_delay_time          = 1000
proxy_digest_trace                       = OFF
............................
proxy_sql_trace                          = OFF
...........................

from arkproxy.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.