Commit 9c8ff5a5 authored by Łukasz Nowak's avatar Łukasz Nowak

Checkpoint: mariadb part is *installable*.

It means that there are no grave buildout/python errors. Functionality status
is not met yet.
parent 8ab75986
...@@ -126,19 +126,19 @@ class Recipe(GenericBaseRecipe): ...@@ -126,19 +126,19 @@ class Recipe(GenericBaseRecipe):
) )
path_list.append(mysqld) path_list.append(mysqld)
# backup configuration # backup configuration
full_backup = self.options['full-backup-path'] full_backup = self.options['full-backup-directory']
incremental_backup = self.options['incremental-backup-path'] incremental_backup = self.options['incremental-backup-directory']
innobackupex_argument_list = [self.options['perl-binary'], innobackupex_argument_list = [self.options['perl-binary'],
self.options['innobackupex-binary'], self.options['innobackupex-binary'],
'--defaults-file=%s' % mysql_conf_file, '--defaults-file=%s' % mysql_conf_file,
'--socket=%s' %mysql_conf['socket'].strip(), '--user=root', '--socket=%s' %mysql_conf['socket'].strip(), '--user=root',
'--ibbackup=%s'% self.options['xtrabackup-binary']] '--ibbackup=%s'% self.options['xtrabackup-binary']]
environment = dict(PATH='%s' % self.bin_directory) environment = dict(PATH='%s' % self.options['bin-directory'])
innobackupex_incremental = self.createPythonScript(self.options['innobackupex-incremental'], 'slapos.recipe.librecipe.execute.executee', [innobackupex_argument_list + ['--incremental'], environment]) innobackupex_incremental = self.createPythonScript(self.options['innobackupex-incremental'], 'slapos.recipe.librecipe.execute.executee', [innobackupex_argument_list + ['--incremental'], environment])
path_list.append(innobackupex_incremental) path_list.append(innobackupex_incremental)
innobackupex_full = self.createPythonScript(self.options['innobackupex-full'], 'slapos.recipe.librecipe.execute.executee', [innobackupex_argument_list, environment]) innobackupex_full = self.createPythonScript(self.options['innobackupex-full'], 'slapos.recipe.librecipe.execute.executee', [innobackupex_argument_list, environment])
path_list.append(innobackupex_full) path_list.append(innobackupex_full)
backup_controller = self.createPythonScript(self.options['innobackupex-controller'], __name__ + '.innobackupex.controller', [innobackupex_incremental, innobackupex_full, full_backup, incremental_backup]) backup_controller = self.createPythonScript(self.options['backup-script'], __name__ + '.innobackupex.controller', [innobackupex_incremental, innobackupex_full, full_backup, incremental_backup])
path_list.append(backup_controller) path_list.append(backup_controller)
# maatkit installation # maatkit installation
for mk_script_name in ( for mk_script_name in (
...@@ -151,13 +151,12 @@ class Recipe(GenericBaseRecipe): ...@@ -151,13 +151,12 @@ class Recipe(GenericBaseRecipe):
'mk-index-usage', 'mk-index-usage',
'mk-query-advisor', 'mk-query-advisor',
): ):
mk_argument_list = [self.options['perl_binary'], mk_argument_list = [self.options['perl-binary'],
self.options['%s_binary' % mk_script_name], self.options['%s-binary' % mk_script_name],
'--defaults-file=%s' % mysql_conf_file, '--defaults-file=%s' % mysql_conf_file,
'--socket=%s' %mysql_conf['socket'].strip(), '--user=root', '--socket=%s' %mysql_conf['socket'].strip(), '--user=root',
] ]
environment = dict(PATH='%s' % self.bin_directory) mk_exe = self.createPythonScript(os.path.join(self.options['bin-directory'], mk_script_name), 'slapos.recipe.librecipe.execute.executee', [mk_argument_list, environment])
mk_exe = self.createPythonScript(os.path.join(self.bin_directory, 'mk_script_name,'), 'slapos.recipe.librecipe.execute.executee', [mk_argument_list, environment])
path_list.append(mk_exe) path_list.append(mk_exe)
return path_list return path_list
...@@ -14,14 +14,14 @@ offline = true ...@@ -14,14 +14,14 @@ offline = true
[publish-mariadb-url] [publish-mariadb-url]
recipe = slapos.cookbook:publishurl recipe = slapos.cookbook:publishurl
url = mysqls://$${mariadb:user}:$${mariadb:password}@$${mariadb:ip}:$${mariadb:port}/$${mariadb:database} url = mysqls://$${mariadb-instance:user}:$${mariadb-instance:password}@$${mariadb-instance:ip}:$${mariadb-instance:port}/$${mariadb-instance:database}
[cron-entry-mariadb-backup] [cron-entry-mariadb-backup]
<= cron <= cron
recipe = slapos.cookbook:cron.d recipe = slapos.cookbook:cron.d
name = mariadb-backup name = mariadb-backup
frequency = 0 0 * * * frequency = 0 0 * * *
command = $${mariadb:innobackupex-controller} command = $${mariadb-instance:innobackupex-controller}
[mariadb-instance] [mariadb-instance]
recipe = slapos.cookbook:generic.mysql recipe = slapos.cookbook:generic.mysql
...@@ -34,19 +34,25 @@ ip = $${slap-network-information:local-ipv4} ...@@ -34,19 +34,25 @@ ip = $${slap-network-information:local-ipv4}
database = erp5 database = erp5
test-user = erp5_test test-user = erp5_test
test-database = erp5_test test-database = erp5_test
mysql-test-database-base = erp5_test_parallel
mysql-test-user-base = erp5_test_parallel
# Paths # Paths
wrapper = $${basedirectory:services}/mariadb wrapper = $${basedirectory:services}/mariadb
update-wrapper = $${basedirectory:services}/mariadb_update update-wrapper = $${basedirectory:services}/mariadb_update
backup-directory = $${directory:mariadb-backup} backup-script = $${rootdirectory:bin}/innobackupex-controller
full-backup-directory = $${directory:mariadb-backup-full}
incremental-backup-directory = $${directory:mariadb-backup-incremental}
data-directory = $${directory:mariadb-data} data-directory = $${directory:mariadb-data}
pid-file = $${basedirectory:run}/mariadb.pid pid-file = $${basedirectory:run}/mariadb.pid
socket = $${basedirectory:run}/mariadb.sock socket = $${basedirectory:run}/mariadb.sock
error-log = $${basedirectory:log}/mariadb_error.log error-log = $${basedirectory:log}/mariadb_error.log
slow-query-log = $${basedirectory:log}/mariadb_slowquery.log slow-query-log = $${basedirectory:log}/mariadb_slowquery.log
conf-file = $${rootdirectory:etc}/mariadb.cnf conf-file = $${rootdirectory:etc}/mariadb.cnf
backup-pending-directory = $${directory:mariadb-backup-pending}
dumpname = dump.sql.gz dumpname = dump.sql.gz
bin-directory = $${rootdirectory:bin}
innobackupex-incremental = $${rootdirectory:bin}/innobackupex-incremental
innobackupex-full = $${rootdirectory:bin}/innobackupex-full
# Binary information # Binary information
innobackupex-binary = ${xtrabackup:location}/bin/innobackupex innobackupex-binary = ${xtrabackup:location}/bin/innobackupex
...@@ -54,21 +60,22 @@ mysql-binary = ${mariadb:location}/bin/mysql ...@@ -54,21 +60,22 @@ mysql-binary = ${mariadb:location}/bin/mysql
mysql-install-binary = ${mariadb:location}/bin/mysql_install_db mysql-install-binary = ${mariadb:location}/bin/mysql_install_db
mysql-upgrade-binary = ${mariadb:location}/bin/mysql_upgrade mysql-upgrade-binary = ${mariadb:location}/bin/mysql_upgrade
mysqld-binary = ${mariadb:location}/libexec/mysqld mysqld-binary = ${mariadb:location}/libexec/mysqld
mk-variable-advisor_binary = ${perl:siteprefix}/bin/mk-variable-advisor mk-variable-advisor-binary = ${perl:siteprefix}/bin/mk-variable-advisor
mk-table-usage_binary = ${perl:siteprefix}/bin/mk-table-usage mk-table-usage-binary = ${perl:siteprefix}/bin/mk-table-usage
mk-visual-explain_binary = ${perl:siteprefix}/bin/mk-visual-explain mk-visual-explain-binary = ${perl:siteprefix}/bin/mk-visual-explain
mk-config-diff_binary = ${perl:siteprefix}/bin/mk-config-diff mk-config-diff-binary = ${perl:siteprefix}/bin/mk-config-diff
mk-deadlock-logger_binary = ${perl:siteprefix}/bin/mk-deadlock-logger mk-deadlock-logger-binary = ${perl:siteprefix}/bin/mk-deadlock-logger
mk-error-log_binary = ${perl:siteprefix}/bin/mk-error-log mk-error-log-binary = ${perl:siteprefix}/bin/mk-error-log
mk-index-usage_binary = ${perl:siteprefix}/bin/mk-index-usage mk-index-usage-binary = ${perl:siteprefix}/bin/mk-index-usage
mk-query-advisor_binary = ${perl:siteprefix}/bin/mk-query-advisor mk-query-advisor-binary = ${perl:siteprefix}/bin/mk-query-advisor
xtrabackup-binary = ${xtrabackup:location}/bin/xtrabackup_51 xtrabackup-binary = ${xtrabackup:location}/bin/xtrabackup_51
perl-binary = ${perl:location}/bin/perl
[logrotate] [logrotate]
recipe = slapos.cookbook:logrotate recipe = slapos.cookbook:logrotate
# Binaries # Binaries
logrotate-binary = ${logrotate:location}/usr/sbin/logrotate logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
gzip-binary = $${buildout:gzip-binary} gzip-binary = ${gzip:location}/bin/gzip
gunzip-binary = ${gzip:location}/bin/gunzip gunzip-binary = ${gzip:location}/bin/gunzip
# Directories # Directories
wrapper = $${rootdirectory:bin}/logrotate wrapper = $${rootdirectory:bin}/logrotate
...@@ -81,10 +88,10 @@ state-file = $${rootdirectory:srv}/logrotate.status ...@@ -81,10 +88,10 @@ state-file = $${rootdirectory:srv}/logrotate.status
<= logrotate <= logrotate
recipe = slapos.cookbook:logrotate.d recipe = slapos.cookbook:logrotate.d
name = mariadb name = mariadb
log = $${mariadb:error-log} $${mariadb:slow-query-log} log = $${mariadb-instance:error-log} $${mariadb-instance:slow-query-log}
frequency = daily frequency = daily
rotate-num = 30 rotate-num = 30
post = $${mariadb:mysql-binary} --no-defaults -B --socket=$${mariadb:socket} -e "FLUSH LOGS" post = $${mariadb-instance:mysql-binary} --no-defaults -B --socket=$${mariadb-instance:socket} -e "FLUSH LOGS"
sharedscripts = true sharedscripts = true
notifempty = true notifempty = true
create = true create = true
...@@ -115,7 +122,7 @@ command = $${logrotate:wrapper} ...@@ -115,7 +122,7 @@ command = $${logrotate:wrapper}
recipe = slapos.cookbook:cron.d recipe = slapos.cookbook:cron.d
name = mariadb-backup name = mariadb-backup
frequency = 0 0 * * * frequency = 0 0 * * *
command = $${mariadb:backup-script} command = $${mariadb-instance:backup-script}
[rootdirectory] [rootdirectory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -138,8 +145,8 @@ crontabs = $${rootdirectory:etc}/crontabs/ ...@@ -138,8 +145,8 @@ crontabs = $${rootdirectory:etc}/crontabs/
cronstamps = $${rootdirectory:etc}/cronstamps/ cronstamps = $${rootdirectory:etc}/cronstamps/
cronoutput = $${basedirectory:log}/cron/ cronoutput = $${basedirectory:log}/cron/
ca-dir = $${rootdirectory:srv}/ssl/ ca-dir = $${rootdirectory:srv}/ssl/
mariadb-backup = $${basedirectory:backup}/mariadb/ mariadb-backup-full = $${basedirectory:backup}/mariadb-full/
mariadb-backup-pending = $${basedirectory:backup}/mariadb-pending/ mariadb-backup-incremental = $${basedirectory:backup}/mariadb-incremental/
mariadb-data = $${rootdirectory:srv}/mariadb/ mariadb-data = $${rootdirectory:srv}/mariadb/
logrotate-backup = $${basedirectory:backup}/logrotate/ logrotate-backup = $${basedirectory:backup}/logrotate/
logrotate-entries = $${rootdirectory:etc}/logrotate.d/ logrotate-entries = $${rootdirectory:etc}/logrotate.d/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment