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
Eric Zheng
slapos
Commits
28876452
Commit
28876452
authored
Aug 30, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5: make MariaDB database creation more robust
parent
d22d0d6a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
25 deletions
+24
-25
software/neoppod/software-common.cfg
software/neoppod/software-common.cfg
+5
-0
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+1
-0
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+2
-2
stack/erp5/instance-mariadb.cfg.in
stack/erp5/instance-mariadb.cfg.in
+15
-23
stack/erp5/instance.cfg.in
stack/erp5/instance.cfg.in
+1
-0
No files found.
software/neoppod/software-common.cfg
View file @
28876452
...
@@ -147,6 +147,11 @@ template =
...
@@ -147,6 +147,11 @@ template =
--datadir="$datadir.new"
--datadir="$datadir.new"
mv -v "$datadir.new" "$datadir"
mv -v "$datadir.new" "$datadir"
}
}
{%- if environ is defined %}
{%- for variable in environ.splitlines() %}
{{ variable }} \
{%- endfor %}
{%- endif %}
exec '${mariadb:location}/bin/mysqld' \
exec '${mariadb:location}/bin/mysqld' \
--defaults-file='{{defaults_file}}' \
--defaults-file='{{defaults_file}}' \
"$@"
"$@"
...
...
stack/erp5/buildout.cfg
View file @
28876452
...
@@ -294,6 +294,7 @@ context =
...
@@ -294,6 +294,7 @@ context =
key template_mariadb template-mariadb:target
key template_mariadb template-mariadb:target
key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_my_cnf template-my-cnf:target
key template_my_cnf template-my-cnf:target
key template_mysqld_wrapper template-mysqld-wrapper:rendered
key template_postfix template-postfix:target
key template_postfix template-postfix:target
key template_postfix_aliases template-postfix-aliases:target
key template_postfix_aliases template-postfix-aliases:target
key template_postfix_main_cf template-postfix-main-cf:target
key template_postfix_main_cf template-postfix-main-cf:target
...
...
stack/erp5/buildout.hash.cfg
View file @
28876452
...
@@ -26,7 +26,7 @@ md5sum = d95e8500bdc72d1f40b97cc414656e7e
...
@@ -26,7 +26,7 @@ md5sum = d95e8500bdc72d1f40b97cc414656e7e
[template-mariadb]
[template-mariadb]
filename = instance-mariadb.cfg.in
filename = instance-mariadb.cfg.in
md5sum =
5a93ff00ee4eb60cc065d51fb437877a
md5sum =
8abd802536f2243d17dea33c225a11ae
[template-kumofs]
[template-kumofs]
filename = instance-kumofs.cfg.in
filename = instance-kumofs.cfg.in
...
@@ -70,7 +70,7 @@ md5sum = c64f35f825200fe35328641b2b8e0fdd
...
@@ -70,7 +70,7 @@ md5sum = c64f35f825200fe35328641b2b8e0fdd
[template]
[template]
filename = instance.cfg.in
filename = instance.cfg.in
md5sum = f
81f4c9881bf868882cd56fe6a769666
md5sum = f
6c6820f9b3653d0d5c29708606fc591
[monitor-template-dummy]
[monitor-template-dummy]
filename = dummy.cfg
filename = dummy.cfg
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
28876452
...
@@ -126,7 +126,7 @@ command = {{ parameter_dict['findutils-location'] }}/bin/find "${directory:maria
...
@@ -126,7 +126,7 @@ command = {{ parameter_dict['findutils-location'] }}/bin/find "${directory:maria
ip = {{ ip }}
ip = {{ ip }}
port = {{ port }}
port = {{ port }}
socket = ${directory:run}/mariadb.sock
socket = ${directory:run}/mariadb.sock
data-directory = ${directory:
mariadb-data}
data-directory = ${directory:
srv}/mariadb
tmp-directory = ${directory:tmp}
tmp-directory = ${directory:tmp}
etc-directory = ${directory:etc}
etc-directory = ${directory:etc}
pid-file = ${directory:run}/mariadb.pid
pid-file = ${directory:run}/mariadb.pid
...
@@ -178,25 +178,18 @@ mysql_tzinfo_to_sql = ${binary-wrap-mysql_tzinfo_to_sql:wrapper-path}
...
@@ -178,25 +178,18 @@ mysql_tzinfo_to_sql = ${binary-wrap-mysql_tzinfo_to_sql:wrapper-path}
[{{ section('mysqld') }}]
[{{ section('mysqld') }}]
< = jinja2-template-executable
< = jinja2-template-executable
# Note: all rendering is done when this file is rendered, not when the mysqld
# section is installed - so I only use jinja2 as a fancy way to write an
# executable file with partition-dependent but instance-parameters independent
# content.
template = inline:#!{{ dash }}
'{{ parameter_dict['mariadb-location'] }}/scripts/mysql_install_db' \
--defaults-file='${my-cnf:rendered}' \
--skip-name-resolve \
--datadir='${my-cnf-parameters:data-directory}' \
--basedir='{{ parameter_dict['mariadb-location'] }}' \
&& ODBCSYSINI='${my-cnf-parameters:etc-directory}' \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{{ parameter_dict['unixodbc-location'] }}/lib \
{% for variable in slapparameter_dict.get('environment-variables', ()) %}
{{ variable }} \
{% endfor %}
exec '{{ parameter_dict['mariadb-location'] }}/bin/mysqld' \
--defaults-file='${my-cnf:rendered}' \
"$@"
rendered = ${directory:services}/mariadb
rendered = ${directory:services}/mariadb
template = {{ parameter_dict['template-mysqld-wrapper'] }}
context =
key defaults_file my-cnf:rendered
key datadir my-cnf-parameters:data-directory
key environ :environ
environ =
ODBCSYSINI='${my-cnf-parameters:etc-directory}'
LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}'{{ parameter_dict['unixodbc-location'] }}/lib'
{% for variable in slapparameter_dict.get('environment-variables', ()) %}
{{ variable }}
{% endfor %}
[odbc-ini-text]
[odbc-ini-text]
text = {{ dumps(slapparameter_dict.get('odbc-ini', '').encode('base64')) }}
text = {{ dumps(slapparameter_dict.get('odbc-ini', '').encode('base64')) }}
...
@@ -265,7 +258,6 @@ tmp = ${buildout:directory}/tmp
...
@@ -265,7 +258,6 @@ tmp = ${buildout:directory}/tmp
backup = ${:srv}/backup
backup = ${:srv}/backup
mariadb-backup-full = ${:backup}/mariadb-full
mariadb-backup-full = ${:backup}/mariadb-full
mariadb-backup-incremental = ${:backup}/mariadb-incremental
mariadb-backup-incremental = ${:backup}/mariadb-incremental
mariadb-data = ${:srv}/mariadb
mariadb-ssl = ${:etc}/mariadb-ssl
mariadb-ssl = ${:etc}/mariadb-ssl
var = ${buildout:directory}/var
var = ${buildout:directory}/var
log = ${:var}/log
log = ${:var}/log
...
@@ -275,7 +267,7 @@ slowquery = ${monitor-directory:private}/slowquery_digest
...
@@ -275,7 +267,7 @@ slowquery = ${monitor-directory:private}/slowquery_digest
[{{ section('resiliency-exclude-file') }}]
[{{ section('resiliency-exclude-file') }}]
# Generate rdiff exclude file in case of resiliency
# Generate rdiff exclude file in case of resiliency
< = jinja2-template-base
< = jinja2-template-base
template = {{ 'inline:{{ "${
directory:mariadb-data
}/**\\n${directory:mariadb-backup-incremental}/**\\n${directory:log}/**\\n${directory:tmp}/**\\n" }}' }}
template = {{ 'inline:{{ "${
my-cnf-parameters:data-directory
}/**\\n${directory:mariadb-backup-incremental}/**\\n${directory:log}/**\\n${directory:tmp}/**\\n" }}' }}
rendered = ${directory:srv}/exporter.exclude
rendered = ${directory:srv}/exporter.exclude
[{{ section("resiliency-identity-signature-script")}}]
[{{ section("resiliency-identity-signature-script")}}]
...
@@ -295,7 +287,7 @@ rendered = ${directory:bin}/start-clone-from-backup
...
@@ -295,7 +287,7 @@ rendered = ${directory:bin}/start-clone-from-backup
context =
context =
key dash dash:dash
key dash dash:dash
key client binary-wrap-mysql:wrapper-path
key client binary-wrap-mysql:wrapper-path
key data_directory
directory:mariadb-data
key data_directory
my-cnf-parameters:data-directory
key pid_file my-cnf-parameters:pid-file
key pid_file my-cnf-parameters:pid-file
key server mysqld:rendered
key server mysqld:rendered
key update update-mysql:output
key update update-mysql:output
...
@@ -309,7 +301,7 @@ rendered = ${directory:bin}/restore-from-backup
...
@@ -309,7 +301,7 @@ rendered = ${directory:bin}/restore-from-backup
context =
context =
key dash dash:dash
key dash dash:dash
key mysql_executable binary-wrap-mysql:wrapper-path
key mysql_executable binary-wrap-mysql:wrapper-path
key mariadb_data_directory
directory:mariadb-data
key mariadb_data_directory
my-cnf-parameters:data-directory
key mariadb_backup_directory directory:mariadb-backup-full
key mariadb_backup_directory directory:mariadb-backup-full
key pid_file my-cnf-parameters:pid-file
key pid_file my-cnf-parameters:pid-file
key binlog_path my-cnf-parameters:binlog-path
key binlog_path my-cnf-parameters:binlog-path
...
...
stack/erp5/instance.cfg.in
View file @
28876452
...
@@ -141,6 +141,7 @@ gzip-location = {{ gzip_location }}
...
@@ -141,6 +141,7 @@ gzip-location = {{ gzip_location }}
mariadb-location = {{ mariadb_location }}
mariadb-location = {{ mariadb_location }}
template-my-cnf = {{ template_my_cnf }}
template-my-cnf = {{ template_my_cnf }}
template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
template-mysqld-wrapper = {{ template_mysqld_wrapper }}
link-binary = {{ dumps(mariadb_link_binary) }}
link-binary = {{ dumps(mariadb_link_binary) }}
mariadb-resiliency-after-import-script = {{ mariadb_resiliency_after_import_script }}
mariadb-resiliency-after-import-script = {{ mariadb_resiliency_after_import_script }}
mariadb-slow-query-report-script = {{ mariadb_slow_query_report_script }}
mariadb-slow-query-report-script = {{ mariadb_slow_query_report_script }}
...
...
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