Merge branch 'erp5-component' into erp5
[slapos.git] / stack / erp5 / instance-mariadb.cfg.in
1 [buildout]
2 parts =
3   publish-mariadb-url
4   mariadb-instance
5   logrotate
6   logrotate-entry-mariadb
7   cron
8   cron-entry-logrotate
9   cron-entry-mariadb-backup
10   binary-link
11   promise
12
13 eggs-directory = {{ eggs_directory }}
14 develop-eggs-directory = {{ develop_eggs_directory }}
15 offline = true
16
17 [publish-mariadb-url]
18 recipe = slapos.cookbook:publishurl
19 url = mysql://${mariadb-instance:user}:${mariadb-instance:password}@${mariadb-instance:ip}:${mariadb-instance:port}/${mariadb-instance:database}
20
21 [cron-entry-mariadb-backup]
22 <= cron
23 recipe = slapos.cookbook:cron.d
24 name = mariadb-backup
25 frequency = 0 0 * * *
26 command = ${mariadb-instance:backup-script}
27
28 [mariadb-instance]
29 recipe = slapos.cookbook:generic.mysql
30
31 # Options
32 user = user
33 parallel-test-database-amount = ${slap-parameter:test-database-amount}
34 port = 45678
35 ip = ${slap-network-information:local-ipv4}
36 database = erp5
37 test-user = erp5_test
38 test-database = erp5_test
39 mysql-test-database-base = testdb
40 mysql-test-user-base = testuser
41
42 # Paths
43 wrapper = ${basedirectory:services}/mariadb
44 update-wrapper = ${basedirectory:services}/mariadb_update
45 backup-script = ${rootdirectory:bin}/innobackupex-controller
46 full-backup-directory = ${directory:mariadb-backup-full}
47 incremental-backup-directory = ${directory:mariadb-backup-incremental}
48 data-directory = ${directory:mariadb-data}
49 pid-file = ${basedirectory:run}/mariadb.pid
50 socket = ${basedirectory:run}/mariadb.sock
51 error-log = ${basedirectory:log}/mariadb_error.log
52 slow-query-log = ${basedirectory:log}/mariadb_slowquery.log
53 conf-file = ${rootdirectory:etc}/mariadb.cnf
54 bin-directory = ${rootdirectory:bin}
55 innobackupex-incremental = ${rootdirectory:bin}/innobackupex-incremental
56 innobackupex-full = ${rootdirectory:bin}/innobackupex-full
57
58 # Binary information
59 innobackupex-binary = {{ xtrabackup_location }}/bin/innobackupex
60 mysql-base-directory = {{ mariadb_location }}
61 mysql-binary = {{ mariadb_location }}/bin/mysql
62 mysql-install-binary = {{ mariadb_location }}/scripts/mysql_install_db
63 mysql-upgrade-binary = {{ mariadb_location }}/bin/mysql_upgrade
64 mysqld-binary = {{ mariadb_location }}/bin/mysqld
65 pt-align-binary = {{ perl_siteprefix }}/bin/pt-align
66 pt-archiver-binary = {{ perl_siteprefix }}/bin/pt-archiver
67 pt-collect-binary = {{ perl_siteprefix }}/bin/pt-collect
68 pt-config-diff-binary = {{ perl_siteprefix }}/bin/pt-config-diff
69 pt-deadlock-logger-binary = {{ perl_siteprefix }}/bin/pt-deadlock-logger
70 pt-diskstats-binary = {{ perl_siteprefix }}/bin/pt-diskstats
71 pt-duplicate-key-checker-binary = {{ perl_siteprefix }}/bin/pt-duplicate-key-checker
72 pt-fifo-split-binary = {{ perl_siteprefix }}/bin/pt-fifo-split
73 pt-find-binary = {{ perl_siteprefix }}/bin/pt-find
74 pt-fingerprint-binary = {{ perl_siteprefix }}/bin/pt-fingerprint
75 pt-fk-error-logger-binary = {{ perl_siteprefix }}/bin/pt-fk-error-logger
76 pt-heartbeat-binary = {{ perl_siteprefix }}/bin/pt-heartbeat
77 pt-index-usage-binary = {{ perl_siteprefix }}/bin/pt-index-usage
78 pt-ioprofile-binary = {{ perl_siteprefix }}/bin/pt-ioprofile
79 pt-kill-binary = {{ perl_siteprefix }}/bin/pt-kill
80 pt-log-player-binary = {{ perl_siteprefix }}/bin/pt-log-player
81 pt-mext-binary = {{ perl_siteprefix }}/bin/pt-mext
82 pt-mysql-summary-binary = {{ perl_siteprefix }}/bin/pt-mysql-summary
83 pt-online-schema-change-binary = {{ perl_siteprefix }}/bin/pt-online-schema-change
84 pt-pmp-binary = {{ perl_siteprefix }}/bin/pt-pmp
85 pt-query-advisor-binary = {{ perl_siteprefix }}/bin/pt-query-advisor
86 pt-query-digest-binary = {{ perl_siteprefix }}/bin/pt-query-digest
87 pt-show-grants-binary = {{ perl_siteprefix }}/bin/pt-show-grants
88 pt-sift-binary = {{ perl_siteprefix }}/bin/pt-sift
89 pt-slave-delay-binary = {{ perl_siteprefix }}/bin/pt-slave-delay
90 pt-slave-find-binary = {{ perl_siteprefix }}/bin/pt-slave-find
91 pt-slave-restart-binary = {{ perl_siteprefix }}/bin/pt-slave-restart
92 pt-stalk-binary = {{ perl_siteprefix }}/bin/pt-stalk
93 pt-summary-binary = {{ perl_siteprefix }}/bin/pt-summary
94 pt-table-checksum-binary = {{ perl_siteprefix }}/bin/pt-table-checksum
95 pt-table-sync-binary = {{ perl_siteprefix }}/bin/pt-table-sync
96 pt-table-usage-binary = {{ perl_siteprefix }}/bin/pt-table-usage
97 pt-tcp-model-binary = {{ perl_siteprefix }}/bin/pt-tcp-model
98 pt-trend-binary = {{ perl_siteprefix }}/bin/pt-trend
99 pt-upgrade-binary = {{ perl_siteprefix }}/bin/pt-upgrade
100 pt-variable-advisor-binary = {{ perl_siteprefix }}/bin/pt-variable-advisor
101 pt-visual-explain-binary = {{ perl_siteprefix }}/bin/pt-visual-explain
102 xtrabackup-binary = {{ xtrabackup_location }}/bin/xtrabackup_51
103 perl-binary = {{ perl_location }}/bin/perl
104
105 [logrotate]
106 recipe = slapos.cookbook:logrotate
107 # Binaries
108 logrotate-binary = {{ logrotate_location }}/usr/sbin/logrotate
109 gzip-binary = {{ gzip_location }}/bin/gzip
110 gunzip-binary = {{ gzip_location }}/bin/gunzip
111 # Directories
112 wrapper = ${rootdirectory:bin}/logrotate
113 conf = ${rootdirectory:etc}/logrotate.conf
114 logrotate-entries = ${directory:logrotate-entries}
115 backup = ${directory:logrotate-backup}
116 state-file = ${rootdirectory:srv}/logrotate.status
117
118 [logrotate-entry-mariadb]
119 <= logrotate
120 recipe = slapos.cookbook:logrotate.d
121 name = mariadb
122 log = ${mariadb-instance:error-log} ${mariadb-instance:slow-query-log}
123 post = ${mariadb-instance:mysql-binary} --no-defaults -B --socket=${mariadb-instance:socket} -e "FLUSH LOGS"
124
125 [cron]
126 recipe = slapos.cookbook:cron
127 dcrond-binary = {{ dcron_location }}/sbin/crond
128 cron-entries = ${directory:cron-entries}
129 crontabs = ${directory:crontabs}
130 cronstamps = ${directory:cronstamps}
131 catcher = ${cron-simplelogger:wrapper}
132 binary = ${basedirectory:services}/crond
133
134 [cron-simplelogger]
135 recipe = slapos.cookbook:simplelogger
136 wrapper = ${rootdirectory:bin}/cron_simplelogger
137 log = ${basedirectory:log}/cron.log
138
139 [cron-entry-logrotate]
140 <= cron
141 recipe = slapos.cookbook:cron.d
142 name = logrotate
143 frequency = 0 0 * * *
144 command = ${logrotate:wrapper}
145
146 [binary-link]
147 recipe = slapos.cookbook:symbolic.link
148 target-directory = ${rootdirectory:bin}
149 link-binary =
150   {{ coreutils_location }}/bin/basename
151   {{ coreutils_location }}/bin/cat
152   {{ coreutils_location }}/bin/cp
153   {{ coreutils_location }}/bin/ls
154   {{ coreutils_location }}/bin/tr
155   {{ coreutils_location }}/bin/uname
156   {{ gettext_location }}/lib/gettext/hostname
157   {{ grep_location }}/bin/grep
158   {{ sed_location }}/bin/sed
159   {{ mariadb_location }}/bin/mysql
160
161 [rootdirectory]
162 recipe = slapos.cookbook:mkdirectory
163 etc = ${buildout:directory}/etc
164 var = ${buildout:directory}/var
165 srv = ${buildout:directory}/srv
166 bin = ${buildout:directory}/bin
167
168 [basedirectory]
169 recipe = slapos.cookbook:mkdirectory
170 log = ${rootdirectory:var}/log
171 services = ${rootdirectory:etc}/run
172 promise = ${rootdirectory:etc}/promise
173 run = ${rootdirectory:var}/run
174 backup = ${rootdirectory:srv}/backup
175
176 [directory]
177 recipe = slapos.cookbook:mkdirectory
178 cron-entries = ${rootdirectory:etc}/cron.d
179 crontabs = ${rootdirectory:etc}/crontabs
180 cronstamps = ${rootdirectory:etc}/cronstamps
181 ca-dir = ${rootdirectory:srv}/ssl
182 mariadb-backup-full = ${basedirectory:backup}/mariadb-full
183 mariadb-backup-incremental = ${basedirectory:backup}/mariadb-incremental
184 mariadb-data = ${rootdirectory:srv}/mariadb
185 logrotate-backup = ${basedirectory:backup}/logrotate
186 logrotate-entries = ${rootdirectory:etc}/logrotate.d
187
188 [promise]
189 recipe = slapos.cookbook:check_port_listening
190 path = ${basedirectory:promise}/mariadb
191 hostname = ${mariadb-instance:ip}
192 port = ${mariadb-instance:port}
193
194 [slap-parameter]
195 test-database-amount = 100