[buildout] parts = publish-mariadb-url mariadb-instance logrotate logrotate-entry-mariadb cron cron-entry-logrotate cron-entry-mariadb-backup binary-link eggs-directory = ${buildout:eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory} offline = true [publish-mariadb-url] recipe = slapos.cookbook:publishurl url = mysql://$${mariadb-instance:user}:$${mariadb-instance:password}@$${mariadb-instance:ip}:$${mariadb-instance:port}/$${mariadb-instance:database} [cron-entry-mariadb-backup] <= cron recipe = slapos.cookbook:cron.d name = mariadb-backup frequency = 0 0 * * * command = $${mariadb-instance:backup-script} [mariadb-instance] recipe = slapos.cookbook:generic.mysql # Options user = user parallel-test-database-amount = 100 port = 45678 ip = $${slap-network-information:local-ipv4} database = erp5 test-user = erp5_test test-database = erp5_test mysql-test-database-base = testdb mysql-test-user-base = testuser # Paths wrapper = $${basedirectory:services}/mariadb update-wrapper = $${basedirectory:services}/mariadb_update 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} pid-file = $${basedirectory:run}/mariadb.pid socket = $${basedirectory:run}/mariadb.sock error-log = $${basedirectory:log}/mariadb_error.log slow-query-log = $${basedirectory:log}/mariadb_slowquery.log conf-file = $${rootdirectory:etc}/mariadb.cnf dumpname = dump.sql.gz bin-directory = $${rootdirectory:bin} innobackupex-incremental = $${rootdirectory:bin}/innobackupex-incremental innobackupex-full = $${rootdirectory:bin}/innobackupex-full # Binary information innobackupex-binary = ${xtrabackup:location}/bin/innobackupex mysql-binary = ${mariadb:location}/bin/mysql mysql-install-binary = ${mariadb:location}/bin/mysql_install_db mysql-upgrade-binary = ${mariadb:location}/bin/mysql_upgrade mysqld-binary = ${mariadb:location}/libexec/mysqld pt-archiver-binary = ${perl:siteprefix}/bin/pt-archiver pt-config-diff-binary = ${perl:siteprefix}/bin/pt-config-diff pt-deadlock-logger-binary = ${perl:siteprefix}/bin/pt-deadlock-logger pt-duplicate-key-checker-binary = ${perl:siteprefix}/bin/pt-duplicate-key-checker pt-fifo-split-binary = ${perl:siteprefix}/bin/pt-fifo-split pt-find-binary = ${perl:siteprefix}/bin/pt-find pt-fk-error-logger-binary = ${perl:siteprefix}/bin/pt-fk-error-logger pt-heartbeat-binary = ${perl:siteprefix}/bin/pt-heartbeat pt-index-usage-binary = ${perl:siteprefix}/bin/pt-index-usage pt-kill-binary = ${perl:siteprefix}/bin/pt-kill pt-log-player-binary = ${perl:siteprefix}/bin/pt-log-player pt-online-schema-change-binary = ${perl:siteprefix}/bin/pt-online-schema-change pt-query-advisor-binary = ${perl:siteprefix}/bin/pt-query-advisor pt-query-digest-binary = ${perl:siteprefix}/bin/pt-query-digest pt-show-grants-binary = ${perl:siteprefix}/bin/pt-show-grants pt-slave-delay-binary = ${perl:siteprefix}/bin/pt-slave-delay pt-slave-find-binary = ${perl:siteprefix}/bin/pt-slave-find pt-slave-restart-binary = ${perl:siteprefix}/bin/pt-slave-restart pt-table-checksum-binary = ${perl:siteprefix}/bin/pt-table-checksum pt-table-sync-binary = ${perl:siteprefix}/bin/pt-table-sync pt-tcp-model-binary = ${perl:siteprefix}/bin/pt-tcp-model pt-trend-binary = ${perl:siteprefix}/bin/pt-trend pt-upgrade-binary = ${perl:siteprefix}/bin/pt-upgrade pt-variable-advisor-binary = ${perl:siteprefix}/bin/pt-variable-advisor pt-visual-explain-binary = ${perl:siteprefix}/bin/pt-visual-explain xtrabackup-binary = ${xtrabackup:location}/bin/xtrabackup_51 perl-binary = ${perl:location}/bin/perl [logrotate] recipe = slapos.cookbook:logrotate # Binaries logrotate-binary = ${logrotate:location}/usr/sbin/logrotate gzip-binary = ${gzip:location}/bin/gzip gunzip-binary = ${gzip:location}/bin/gunzip # Directories wrapper = $${rootdirectory:bin}/logrotate conf = $${rootdirectory:etc}/logrotate.conf logrotate-entries = $${directory:logrotate-entries} backup = $${directory:logrotate-backup} state-file = $${rootdirectory:srv}/logrotate.status [logrotate-entry-mariadb] <= logrotate recipe = slapos.cookbook:logrotate.d name = mariadb log = $${mariadb-instance:error-log} $${mariadb-instance:slow-query-log} post = $${mariadb-instance:mysql-binary} --no-defaults -B --socket=$${mariadb-instance:socket} -e "FLUSH LOGS" [cron] recipe = slapos.cookbook:cron dcrond-binary = ${dcron:location}/sbin/crond cron-entries = $${directory:cron-entries} crontabs = $${directory:crontabs} cronstamps = $${directory:cronstamps} catcher = $${cron-simplelogger:wrapper} binary = $${basedirectory:services}/crond [cron-simplelogger] recipe = slapos.cookbook:simplelogger wrapper = $${rootdirectory:bin}/cron_simplelogger log = $${basedirectory:log}/cron.log [cron-entry-logrotate] <= cron recipe = slapos.cookbook:cron.d name = logrotate frequency = 0 0 * * * command = $${logrotate:wrapper} [binary-link] recipe = slapos.cookbook:symbolic.link target-directory = $${rootdirectory:bin} link-binary = ${coreutils:location}/bin/basename ${coreutils:location}/bin/cat ${coreutils:location}/bin/cp ${coreutils:location}/bin/ls ${coreutils:location}/bin/tr ${coreutils:location}/bin/uname ${gettext:location}/lib/gettext/hostname ${grep:location}/bin/grep ${sed:location}/bin/sed ${mariadb:location}/bin/mysql [rootdirectory] recipe = slapos.cookbook:mkdirectory etc = $${buildout:directory}/etc var = $${buildout:directory}/var srv = $${buildout:directory}/srv bin = $${buildout:directory}/bin [basedirectory] recipe = slapos.cookbook:mkdirectory log = $${rootdirectory:var}/log services = $${rootdirectory:etc}/run run = $${rootdirectory:var}/run backup = $${rootdirectory:srv}/backup [directory] recipe = slapos.cookbook:mkdirectory cron-entries = $${rootdirectory:etc}/cron.d crontabs = $${rootdirectory:etc}/crontabs cronstamps = $${rootdirectory:etc}/cronstamps ca-dir = $${rootdirectory:srv}/ssl mariadb-backup-full = $${basedirectory:backup}/mariadb-full mariadb-backup-incremental = $${basedirectory:backup}/mariadb-incremental mariadb-data = $${rootdirectory:srv}/mariadb logrotate-backup = $${basedirectory:backup}/logrotate logrotate-entries = $${rootdirectory:etc}/logrotate.d