当前位置:网站首页>Archery database audit platform deployment
Archery database audit platform deployment
2022-07-28 06:54:00 【opreator.ke】
One 【 Introduce 】
Official website :https://archerydms.com/
github:https://github.com/hhyo/Archery
Archery yes archer Branch project of , Located at SQL Audit query platform , Designed to improve DBA Work efficiency , Support multi database SQL Go online and check , At the same time, it supports rich MySQL Operation and maintenance functions , All functions are compatible with mobile phone operation .
Two 【 Deploy 】
download Releases file , Decompress and enter docker-compose Folder # start-up docker-compose -f docker-compose.yml up -d # Table structure initialization docker exec -ti archery /bin/bash cd /opt/archery source /opt/venv4archery/bin/activate python3 manage.py makemigrations sql python3 manage.py migrate # Data initialization python3 manage.py dbshell<sql/fixtures/auth_group.sql python3 manage.py dbshell<src/init_sql/mysql_slow_query_review.sql # Create administrative users python3 manage.py createsuperuser # Restart the service docker restart archery # Log viewing and troubleshooting docker logs archery -f --tail=10 logs/archery.log |
|---|
3、 ... and 【 Feature list 】

Four 【 Plug in processing 】 4.1 Database slow log plug-in The server builds the database mysql processing method :
Archery Cannot automatically collect slow queries , You need to deploy the script manually . according to github The documents on the are as follows :
1 Execute the script to create the table , stay archery The database creates two tables about collecting slow query information :mysql_slow_query_review and mysql_slow_query_review_history
Create database :
route :/opt/archery/src/init_sql/mysql_slow_query_review.sql
pt Tool script execution :
route :/opt/archery/src/script/analysis_slow_query.sh
Copy the script SQL, stay archery The associated mysql In the implementation of
2 Deploy to the target database, that is, the server that needs to view the slow log pt Tools .
install pt Tools
| download wget https://www.percona.com/downloads/percona-toolkit/3.0.12/binary/redhat/6/x86_64/percona-toolkit-3.0.12-1.el6.x86_64.rpm install yum install -y percona-toolkit-3.0.12-1.el6.x86_64.rpm The command defaults to /usr/bin/pt-query-digest Next |
|---|
Modify the script
#!/bin/bash # To configure Archery Database connection address # Slow log location of the analyzed instance , It is recommended to clean the log file regularly , Otherwise, the analysis efficiency will be affected #pt-query-digest Executable file path # Connection information of the analyzed instance # Get the last analysis time , Please delete during initialization last_analysis_time_$hostname file , All log data can be analyzed # Collect the logs if [[ $? -ne 0 ]]; then |
|---|
Adjust the timing task trigger pt Tools synchronized to archery
crontab -e
3.rds Database synchronization
3.1 Alibaba cloud officially provides docking , Just fill in ak/sk key that will do .
3.2 Other cloud databases , For example, Hua Weiyun / Tencent, cloud, etc. ,
Method 1: You can modify the source code yourself slowlog.py The corresponding sdk, Synchronize database slow logs .
Method 2: Get the slow log of Huawei cloud database api Interface , Get slow log file , Through PT Tools synchronized to archery.
边栏推荐
- MySQL common commands
- KVM hot migration
- Array solution script
- Technology sharing | common proxy tools for interface testing
- 搭建PHP7私有仓库
- Hdu-1097-a hard puzzle (fast power)
- Pku-2739-sum of constructive prime numbers
- HDU-1097-A hard puzzle(快速幂)
- Technology sharing | sending requests using curl
- How to store floating point data in memory
猜你喜欢
随机推荐
Initializingbean interface and examples
Build php7 private warehouse
DNS domain name resolution service
NAT和PAT的原理及配置
HDU-2036-改革春风吹满地(多边形面积模板)
Explain in detail
Pku-2739-sum of constructive prime numbers
Test interview questions collection (I) | common required questions and procedures of software testing (with answers)
Scratch command
2022 Tanabata gift recommendation! Nice, cheap and practical gift recommendation
遍历 二叉树
QT uses MSVC compiler to output Chinese garbled code
Insertion and deletion of nodes in linked list
How about air conduction Bluetooth headset? It's the most worthwhile air conduction headset to start with
elastic常用高频命令
Lancher deployment practice
网络——网络层
HDU-5783 Divide the Sequence(贪心水题)
---栈&队列---
Personal understanding of Chinese remainder theorem








