Skip to content

Commit

Permalink
Merge branch 'github' of github.com:hhyo/archer into github
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo committed Jul 30, 2018
2 parents 4367ca2 + 200ae04 commit 356989a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
### 慢日志管理
1. settings中SLOWQUERY改为True
2. 安装percona-toolkit(版本>3.0),以centos为例
2. 安装percona-toolkit(版本=3.0.6),以centos为例
```
yum -y install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
yum -y install percona-toolkit.x86_64
Expand Down Expand Up @@ -264,18 +264,15 @@ inception无法连接备份库
| 银行卡 | (.*)(.{4})$ | 2 | 隐藏后四位|
| 邮箱 | (.*)@(.*) | 2 | 去除后缀|
#### 查询权限管理
- 查询权限管理的审批流程和SQL上线是隔离的,需要到后台数据管理进行配置
- 审核人看不到待审核工单
代办列表被隐藏至右上角的消息图标中,当有待审核信息时会显示图标,可以进入查看待办数据
#### 审核人看不到查询权限申请待审核工单
查询权限申请待办列表被隐藏至右上角的消息图标中,当有待审核信息时会显示图标,可以进入查看待办数据
#### 慢日志管理
- 检查脚本内的配置,hostname和archer主库配置内容保持一致,用于archer做筛选
- 检查mysql_slow_query_review_history表收集的日志信息hostname_max是否和hostname一致
#### 慢日志不显示
- 检查脚本内的配置,hostname和archer主库配置内容保持一致,用于archer做筛选
- 检查mysql_slow_query_review_history表收集的日志信息hostname_max是否和hostname一致
#### 定时任务
- 未执行
检查django-apscheduler相关表是否有创建,可使用`python3 manage.py migrate`创建
#### 定时任务未执行
- 检查django-apscheduler相关表是否有创建,可使用`python3 manage.py migrate`创建
## 联系方式
QQ群524233225
20 changes: 13 additions & 7 deletions sql/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from .const import WorkflowDict
from .inception import InceptionDao
from .models import users, master_config, slave_config, QueryPrivilegesApply, QueryPrivileges, QueryLog, SlowQuery, \
SlowQueryHistory
SlowQueryHistory, AliyunRdsConfig
from .data_masking import Masking
from .workflow import Workflow
from .permission import role_required, superuser_required
Expand Down Expand Up @@ -818,9 +818,12 @@ def slowquery_review(request):

# 判断是RDS还是其他实例
cluster_info = master_config.objects.get(cluster_name=cluster_name)
if settings.ALIYUN_RDS_MANAGE:
# 调用阿里云慢日志接口
result = aliyun_rds_slowquery_review(request)
if len(AliyunRdsConfig.objects.filter(cluster_name=cluster_name)) > 0:
if settings.ALIYUN_RDS_MANAGE:
# 调用阿里云慢日志接口
result = aliyun_rds_slowquery_review(request)
else:
raise Exception('未开启rds管理,无法查看rds数据!')
else:
StartTime = request.POST.get('StartTime')
EndTime = request.POST.get('EndTime')
Expand Down Expand Up @@ -920,9 +923,12 @@ def slowquery_review_history(request):

# 判断是RDS还是其他实例
cluster_info = master_config.objects.get(cluster_name=cluster_name)
if settings.ALIYUN_RDS_MANAGE:
# 调用阿里云慢日志接口
result = aliyun_rds_slowquery_review_history(request)
if len(AliyunRdsConfig.objects.filter(cluster_name=cluster_name)) > 0:
if settings.ALIYUN_RDS_MANAGE:
# 调用阿里云慢日志接口
result = aliyun_rds_slowquery_review_history(request)
else:
raise Exception('未开启rds管理,无法查看rds数据!')
else:
StartTime = request.POST.get('StartTime')
EndTime = request.POST.get('EndTime')
Expand Down
8 changes: 0 additions & 8 deletions sql/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,5 @@
url(r'^kill_session/$', views_ajax.kill_session, name='kill_session'),
url(r'^sapce_status/$', views_ajax.tablesapce, name='tablesapce'),
url(r'^del_sqlcronjob/$', jobs.del_sqlcronjob, name='del_sqlcronjob'),

]

if settings.ALIYUN_RDS_MANAGE:
from . import aliyun_function

aliyun_function_url = [
url(r'^sapce_status/$', aliyun_function.sapce_status, name='sapce_status'),
]
urlpatterns.extend(aliyun_function_url)

0 comments on commit 356989a

Please sign in to comment.