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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos
Commits
06ed999a
Commit
06ed999a
authored
Oct 14, 2024
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack/erp5: Serve mariadb full logs for bootstrap
parent
6b4346c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
10 deletions
+45
-10
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+2
-2
stack/erp5/instance-mariadb.cfg.in
stack/erp5/instance-mariadb.cfg.in
+42
-8
stack/erp5/instance.cfg.in
stack/erp5/instance.cfg.in
+1
-0
No files found.
stack/erp5/buildout.hash.cfg
View file @
06ed999a
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb]
[template-mariadb]
filename = instance-mariadb.cfg.in
filename = instance-mariadb.cfg.in
md5sum =
e22baff0637d2973585dff2561487b
e5
md5sum =
07a1688916b7f3fac55a71fce0ee80
e5
[template-kumofs]
[template-kumofs]
filename = instance-kumofs.cfg.in
filename = instance-kumofs.cfg.in
...
@@ -70,7 +70,7 @@ md5sum = b95084ae9eed95a68eada45e28ef0c04
...
@@ -70,7 +70,7 @@ md5sum = b95084ae9eed95a68eada45e28ef0c04
[template]
[template]
filename = instance.cfg.in
filename = instance.cfg.in
md5sum =
ca0cb83950dd9079cc289891cce08e7
6
md5sum =
88529a1574d4aae74ef3183b9fa9b06
6
[template-erp5]
[template-erp5]
filename = instance-erp5.cfg.in
filename = instance-erp5.cfg.in
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
06ed999a
...
@@ -37,6 +37,7 @@ recipe = slapos.cookbook:publish.serialised
...
@@ -37,6 +37,7 @@ recipe = slapos.cookbook:publish.serialised
database-list = {{ render_database_list(database_list) }}
database-list = {{ render_database_list(database_list) }}
test-database-list = {{ render_database_list(test_database_list) }}
test-database-list = {{ render_database_list(test_database_list) }}
monitor-base-url = ${monitor-publish-parameters:monitor-base-url}
monitor-base-url = ${monitor-publish-parameters:monitor-base-url}
replication-bootstrap-url = ${mariadb-backup-static-http-server:bootstrap-url}
[publish-early]
[publish-early]
recipe = slapos.cookbook:publish-early
recipe = slapos.cookbook:publish-early
...
@@ -90,29 +91,40 @@ about laxist file mode. -#}
...
@@ -90,29 +91,40 @@ about laxist file mode. -#}
{%- endif %}
{%- endif %}
{% if full_backup_retention_days > -1 -%}
{% if full_backup_retention_days > -1 -%}
[
{{ section('cron-entry-mariadb-backup') }}
]
[
mariadb-backup-script
]
recipe = slapos.
cookbook:cron.d
recipe = slapos.
recipe.template
cron-entries = ${cron:cron-entries
}
output = ${directory:bin}/${:_buildout_section_name_
}
name = mariadb-backup
ln = {{ parameter_dict['coreutils_location'] }}/bin/ln
time = {{ dumps(backup_periodicity) }}
most-recent = most-recent.sql.gz
{# When binlogs are enabled:
{# When binlogs are enabled:
# flush-logs: used so no manipulation on binlogs is needed to restore from
# flush-logs: used so no manipulation on binlogs is needed to restore from
# full + binlogs. The first binlog after a dump starts from dump snapshot and
# full + binlogs. The first binlog after a dump starts from dump snapshot and
# can be fully restored.
# can be fully restored.
# master-data: use value "2" as we are not in a replication case
# master-data: use value "2" as we are not in a replication case
#}
#}
command = "${binary-wrap-mysqldump:wrapper-path}" --all-databases --flush-privileges --single-transaction --max-allowed-packet=128M {% if incremental_backup_retention_days > -1 %}--flush-logs --master-data=2 {% endif %}| {{ parameter_dict['gzip-location'] }}/bin/gzip > "${directory:mariadb-backup-full}/$({{ parameter_dict['coreutils-location'] }}/bin/date "+%Y%m%d%H%M%S").sql.gz"
inline =
#! {{ dash }}
filepath="${directory:mariadb-backup-full}/$({{ parameter_dict['coreutils-location'] }}/bin/date "+%Y%m%d%H%M%S").sql.gz"
"${binary-wrap-mysqldump:wrapper-path}" --all-databases --flush-privileges --single-transaction --max-allowed-packet=128M {% if incremental_backup_retention_days > -1 %}--flush-logs --master-data=2 {% endif %}| {{ parameter_dict['gzip-location'] }}/bin/gzip > $filepath
${:ln} -sf $filepath "${directory:mariadb-backup-full}/${:most-recent}"
{# KEEP GLOB PATTERN IN SYNC with generated filenames above
{# KEEP GLOB PATTERN IN SYNC with generated filenames above
# YYYYmmddHHMMSS -#}
# YYYYmmddHHMMSS -#}
file-glob = ??????????????.sql.gz
file-glob = ??????????????.sql.gz
[{{ section('cron-entry-mariadb-backup') }}]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = mariadb-backup
time = {{ dumps(backup_periodicity) }}
command = ${mariadb-backup-script:output}
{% if full_backup_retention_days > 0 -%}
{% if full_backup_retention_days > 0 -%}
[{{ section("cron-entry-mariadb-backup-expire") }}]
[{{ section("cron-entry-mariadb-backup-expire") }}]
recipe = slapos.cookbook:cron.d
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
cron-entries = ${cron:cron-entries}
name = mariadb-backup-expire
name = mariadb-backup-expire
time = {{ dumps(backup_periodicity) }}
time = {{ dumps(backup_periodicity) }}
command = {{ parameter_dict['findutils-location'] }}/bin/find "${directory:mariadb-backup-full}" -maxdepth 1 -name "${
cron-entry-mariadb-backup
:file-glob}" -daystart -mtime +{{ full_backup_retention_days }} -delete
command = {{ parameter_dict['findutils-location'] }}/bin/find "${directory:mariadb-backup-full}" -maxdepth 1 -name "${
mariadb-backup-script
:file-glob}" -daystart -mtime +{{ full_backup_retention_days }} -delete
{%- endif %}
{%- endif %}
{%- endif %}
{%- endif %}
...
@@ -192,6 +204,28 @@ environ =
...
@@ -192,6 +204,28 @@ environ =
{%- endfor %}
{%- endfor %}
[{{ section('mariadb-backup-static-http-server') }}]
recipe = slapos.recipe.template
output = ${directory:services}/${:_buildout_section_name_}
port = {{ port - 1 }}
bootstrap-url = http://{{ ip_as_host }}:${:port}/${mariadb-backup-script:most-recent}
inline =
#!${buildout:executable}
import os
import socket
import SocketServer, SimpleHTTPServer # Py2
class Server(SocketServer.ThreadingTCPServer):
{%- if use_ipv6 %}
address_family = socket.AF_INET6
{%- endif %}
daemon_threads = True
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
ip = {{ repr(ip) }}
port = ${:port}
os.chdir("${directory:mariadb-backup-full}")
Server((ip, port), Handler).serve_forever()
[{{ section('odbc-ini') }}]
[{{ section('odbc-ini') }}]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
output = ${directory:etc}/odbc.ini
output = ${directory:etc}/odbc.ini
...
@@ -315,7 +349,7 @@ filename = generate-mariadb-slow-query-report
...
@@ -315,7 +349,7 @@ filename = generate-mariadb-slow-query-report
context =
context =
raw slow_query_path ${directory:srv}/backup/logrotate/mariadb_slowquery.log
raw slow_query_path ${directory:srv}/backup/logrotate/mariadb_slowquery.log
raw pt_query_exec ${binary-wrap-pt-digest:wrapper-path}
raw pt_query_exec ${binary-wrap-pt-digest:wrapper-path}
raw dash {{
parameter_dict['dash-location'] }}/bin/dash
raw dash {{
dash }}
raw xz {{ parameter_dict['xz-utils-location'] }}/bin/xz
raw xz {{ parameter_dict['xz-utils-location'] }}/bin/xz
key output_folder directory:slowquery
key output_folder directory:slowquery
...
...
stack/erp5/instance.cfg.in
View file @
06ed999a
...
@@ -189,6 +189,7 @@ unixodbc-location = {{ unixodbc_location }}
...
@@ -189,6 +189,7 @@ unixodbc-location = {{ unixodbc_location }}
mroonga-mariadb-install-sql = {{ mroonga_mariadb_install_sql }}
mroonga-mariadb-install-sql = {{ mroonga_mariadb_install_sql }}
mroonga-mariadb-plugin-dir = {{ mroonga_mariadb_plugin_dir }}
mroonga-mariadb-plugin-dir = {{ mroonga_mariadb_plugin_dir }}
groonga-plugins-path = {{ groonga_plugin_dir }}:{{ groonga_mysql_normalizer_plugin_dir }}
groonga-plugins-path = {{ groonga_plugin_dir }}:{{ groonga_mysql_normalizer_plugin_dir }}
coreutils_location = {{ coreutils_location }}
[dynamic-template-mariadb]
[dynamic-template-mariadb]
<= jinja2-template-base
<= jinja2-template-base
...
...
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