Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
897a5592
Commit
897a5592
authored
May 23, 2017
by
Hardik Juneja
Committed by
Rafael Monnerat
Jun 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack/erp5: Add pt-digest for mariadb slow query logs
parent
77421a0d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
2 deletions
+56
-2
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+7
-0
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+6
-2
stack/erp5/instance-mariadb.cfg.in
stack/erp5/instance-mariadb.cfg.in
+19
-0
stack/erp5/instance.cfg.in
stack/erp5/instance.cfg.in
+2
-0
stack/erp5/mysql-querydigest.sh.in
stack/erp5/mysql-querydigest.sh.in
+22
-0
No files found.
stack/erp5/buildout.cfg
View file @
897a5592
...
...
@@ -163,6 +163,10 @@ command = grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link
<= download-base
mode = 755
[mariadb-slow-query-report-script]
<= download-base
mode = 755
[template-mariadb]
<= download-base
link-binary =
...
...
@@ -267,10 +271,13 @@ context =
key logrotate_location logrotate:location
key mariadb_location mariadb:location
key mariadb_resiliency_after_import_script mariadb-resiliency-after-import-script:target
key mariadb_slow_query_report_script mariadb-slow-query-report-script:target
key matplotlibrc_location matplotlibrc:location
key mesa_location mesa:location
key onlyoffice_x2t_location onlyoffice-x2t:location
key parts_directory buildout:parts-directory
key openssl_location openssl:location
key percona_toolkit_location percona-toolkit:location
key pixman_location pixman:location
key poppler_location poppler:location
key postfix_location postfix:location
...
...
stack/erp5/buildout.hash.cfg
View file @
897a5592
...
...
@@ -17,9 +17,13 @@
filename = instance-mariadb-resiliency-after-import-script.sh.in
md5sum = 844d62cd6f9d6e3d1d78d52de2b72a49
[mariadb-slow-query-report-script]
filename = mysql-querydigest.sh.in
md5sum = dc974bd74cf967ae6250d81322629c44
[template-mariadb]
filename = instance-mariadb.cfg.in
md5sum =
354095bdd9851f6fb7eeaf3006b1fe94
md5sum =
49c03d03042b3757248f283abf6059e0
[template-kumofs]
filename = instance-kumofs.cfg.in
...
...
@@ -71,7 +75,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0
[template]
filename = instance.cfg.in
md5sum =
3b283bce73339e38ae81d18d257cf0b4
md5sum =
51abbd0cb3e70dc0bca2629ba1a4177a
[monitor-template-dummy]
filename = dummy.cfg
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
897a5592
...
...
@@ -230,6 +230,12 @@ command = mysql_upgrade
command-line = "{{ parameter_dict['mariadb-location'] }}/bin/${:command}"
command = mysql_tzinfo_to_sql
[binary-wrap-pt-digest]
<= binary-wrap-base
command-line = "{{ parameter_dict['percona-tools-location'] }}/bin/${:command}"
command = pt-query-digest
[directory]
recipe = slapos.cookbook:mkdirectory
bin = ${buildout:directory}/bin
...
...
@@ -272,6 +278,19 @@ context =
key server_executable mysqld:rendered
key update_executable update-mysql:output
[{{ section('monitor-generate-mariadb-slow-query-report') }}]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['mariadb-slow-query-report-script'] }}
rendered = ${monitor-directory:reports}/${:filename}
output-folder = ${directory:srv}/monitor/
filename = mariadb_slow_query_every_23_hour
mode = 755
context =
raw slow_query_path ${directory:srv}/backup/logrotate/mariadb_slowquery.log
raw pt_query_exec ${binary-wrap-pt-digest:wrapper-path}
raw dash {{ parameter_dict['dash-location'] }}/bin/dash
key output_folder :output-folder
[{{ section('promise') }}]
recipe = slapos.cookbook:wrapper
command-line = "{{ parameter_dict['bin-directory'] }}/is-local-tcp-port-opened" "${my-cnf-parameters:ip}" "${my-cnf-parameters:port}"
...
...
stack/erp5/instance.cfg.in
View file @
897a5592
...
...
@@ -174,6 +174,8 @@ template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
link-binary = {{ dumps(mariadb_link_binary) }}
bin-directory = {{ bin_directory }}
mariadb-resiliency-after-import-script = {{ mariadb_resiliency_after_import_script }}
mariadb-slow-query-report-script = {{ mariadb_slow_query_report_script }}
percona-tools-location = {{ percona_toolkit_location }}
template-monitor = {{ template_monitor }}
[dynamic-template-mariadb]
...
...
stack/erp5/mysql-querydigest.sh.in
0 → 100644
View file @
897a5592
#!{{dash}}
# BEWARE: This file is operated by slapgrid
SLOW_QUERY_PATH='{{slow_query_path}}'
OUTPUT_FOLDER='{{output_folder}}'
PT_QUERY_EXEC='{{pt_query_exec}}'
if [ ! -d "$OUTPUT_FOLDER" ]; then
echo "ERROR: output_folder don't exists"
exit 0
fi
TODAY=`date +%Y%m%d`
SLOW_LOG=$SLOW_QUERY_PATH-$TODAY
if [ ! -f "$SLOW_LOG" ]; then
echo "ERROR: cannot read mysql slow query log file $SLOW_LOG. Exiting."
exit 1
fi
eval $PT_QUERY_EXEC $SLOW_LOG
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment