Provide executable shell
[slapos.git] / software / erp5 / instance-mariadb.cfg
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
12 eggs-directory = ${buildout:eggs-directory}
13 develop-eggs-directory = ${buildout:develop-eggs-directory}
14 offline = true
15
16 [publish-mariadb-url]
17 recipe = slapos.cookbook:publishurl
18 url = mysql://$${mariadb-instance:user}:$${mariadb-instance:password}@$${mariadb-instance:ip}:$${mariadb-instance:port}/$${mariadb-instance:database}
19
20 [cron-entry-mariadb-backup]
21 <= cron
22 recipe = slapos.cookbook:cron.d
23 name = mariadb-backup
24 frequency = 0 0 * * *
25 command = $${mariadb-instance:backup-script}
26
27 [mariadb-instance]
28 recipe = slapos.cookbook:generic.mysql
29
30 # Options
31 user = user
32 parallel-test-database-amount = 100
33 port = 45678
34 ip = $${slap-network-information:local-ipv4}
35 database = erp5
36 test-user = erp5_test
37 test-database = erp5_test
38 mysql-test-database-base = testdb
39 mysql-test-user-base = testuser
40
41 # Paths
42 wrapper = $${basedirectory:services}/mariadb
43 update-wrapper = $${basedirectory:services}/mariadb_update
44 backup-script = $${rootdirectory:bin}/innobackupex-controller
45 full-backup-directory = $${directory:mariadb-backup-full}
46 incremental-backup-directory = $${directory:mariadb-backup-incremental}
47 data-directory = $${directory:mariadb-data}
48 pid-file = $${basedirectory:run}/mariadb.pid
49 socket = $${basedirectory:run}/mariadb.sock
50 error-log = $${basedirectory:log}/mariadb_error.log
51 slow-query-log = $${basedirectory:log}/mariadb_slowquery.log
52 conf-file = $${rootdirectory:etc}/mariadb.cnf
53 dumpname = dump.sql.gz
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-binary = ${mariadb:location}/bin/mysql
61 mysql-install-binary = ${mariadb:location}/bin/mysql_install_db
62 mysql-upgrade-binary = ${mariadb:location}/bin/mysql_upgrade
63 mysqld-binary = ${mariadb:location}/libexec/mysqld
64 pt-archiver-binary = ${perl:siteprefix}/bin/pt-archiver
65 pt-config-diff-binary = ${perl:siteprefix}/bin/pt-config-diff
66 pt-deadlock-logger-binary = ${perl:siteprefix}/bin/pt-deadlock-logger
67 pt-duplicate-key-checker-binary = ${perl:siteprefix}/bin/pt-duplicate-key-checker
68 pt-fifo-split-binary = ${perl:siteprefix}/bin/pt-fifo-split
69 pt-find-binary = ${perl:siteprefix}/bin/pt-find
70 pt-fk-error-logger-binary = ${perl:siteprefix}/bin/pt-fk-error-logger
71 pt-heartbeat-binary = ${perl:siteprefix}/bin/pt-heartbeat
72 pt-index-usage-binary = ${perl:siteprefix}/bin/pt-index-usage
73 pt-kill-binary = ${perl:siteprefix}/bin/pt-kill
74 pt-log-player-binary = ${perl:siteprefix}/bin/pt-log-player
75 pt-online-schema-change-binary = ${perl:siteprefix}/bin/pt-online-schema-change
76 pt-query-advisor-binary = ${perl:siteprefix}/bin/pt-query-advisor
77 pt-query-digest-binary = ${perl:siteprefix}/bin/pt-query-digest
78 pt-show-grants-binary = ${perl:siteprefix}/bin/pt-show-grants
79 pt-slave-delay-binary = ${perl:siteprefix}/bin/pt-slave-delay
80 pt-slave-find-binary = ${perl:siteprefix}/bin/pt-slave-find
81 pt-slave-restart-binary = ${perl:siteprefix}/bin/pt-slave-restart
82 pt-table-checksum-binary = ${perl:siteprefix}/bin/pt-table-checksum
83 pt-table-sync-binary = ${perl:siteprefix}/bin/pt-table-sync
84 pt-tcp-model-binary = ${perl:siteprefix}/bin/pt-tcp-model
85 pt-trend-binary = ${perl:siteprefix}/bin/pt-trend
86 pt-upgrade-binary = ${perl:siteprefix}/bin/pt-upgrade
87 pt-variable-advisor-binary = ${perl:siteprefix}/bin/pt-variable-advisor
88 pt-visual-explain-binary = ${perl:siteprefix}/bin/pt-visual-explain
89 xtrabackup-binary = ${xtrabackup:location}/bin/xtrabackup_51
90 perl-binary = ${perl:location}/bin/perl
91
92 [logrotate]
93 recipe = slapos.cookbook:logrotate
94 # Binaries
95 logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
96 gzip-binary = ${gzip:location}/bin/gzip
97 gunzip-binary = ${gzip:location}/bin/gunzip
98 # Directories
99 wrapper = $${rootdirectory:bin}/logrotate
100 conf = $${rootdirectory:etc}/logrotate.conf
101 logrotate-entries = $${directory:logrotate-entries}
102 backup = $${directory:logrotate-backup}
103 state-file = $${rootdirectory:srv}/logrotate.status
104
105 [logrotate-entry-mariadb]
106 <= logrotate
107 recipe = slapos.cookbook:logrotate.d
108 name = mariadb
109 log = $${mariadb-instance:error-log} $${mariadb-instance:slow-query-log}
110 post = $${mariadb-instance:mysql-binary} --no-defaults -B --socket=$${mariadb-instance:socket} -e "FLUSH LOGS"
111
112 [cron]
113 recipe = slapos.cookbook:cron
114 dcrond-binary = ${dcron:location}/sbin/crond
115 cron-entries = $${directory:cron-entries}
116 crontabs = $${directory:crontabs}
117 cronstamps = $${directory:cronstamps}
118 catcher = $${cron-simplelogger:binary}
119 binary = $${basedirectory:services}/crond
120
121 [cron-simplelogger]
122 recipe = slapos.cookbook:simplelogger
123 binary = $${rootdirectory:bin}/cron_simplelogger
124 output = $${directory:cronoutput}
125
126 [cron-entry-logrotate]
127 <= cron
128 recipe = slapos.cookbook:cron.d
129 name = logrotate
130 frequency = 0 0 * * *
131 command = $${logrotate:wrapper}
132
133 [binary-link]
134 recipe = slapos.cookbook:symbolic.link
135 target-directory = $${rootdirectory:bin}
136 link-binary = 
137   ${coreutils:location}/bin/basename
138   ${coreutils:location}/bin/cat
139   ${coreutils:location}/bin/cp
140   ${coreutils:location}/bin/ls
141   ${coreutils:location}/bin/tr
142   ${coreutils:location}/bin/uname
143   ${gettext:location}/lib/gettext/hostname
144   ${grep:location}/bin/grep
145   ${sed:location}/bin/sed
146   ${mariadb:location}/bin/mysql
147
148 [rootdirectory]
149 recipe = slapos.cookbook:mkdirectory
150 etc = $${buildout:directory}/etc
151 var = $${buildout:directory}/var
152 srv = $${buildout:directory}/srv
153 bin = $${buildout:directory}/bin
154
155 [basedirectory]
156 recipe = slapos.cookbook:mkdirectory
157 log = $${rootdirectory:var}/log
158 services = $${rootdirectory:etc}/run
159 run = $${rootdirectory:var}/run
160 backup = $${rootdirectory:srv}/backup
161
162 [directory]
163 recipe = slapos.cookbook:mkdirectory
164 cron-entries = $${rootdirectory:etc}/cron.d
165 crontabs = $${rootdirectory:etc}/crontabs
166 cronstamps = $${rootdirectory:etc}/cronstamps
167 cronoutput = $${basedirectory:log}/cron
168 ca-dir = $${rootdirectory:srv}/ssl
169 mariadb-backup-full = $${basedirectory:backup}/mariadb-full
170 mariadb-backup-incremental = $${basedirectory:backup}/mariadb-incremental
171 mariadb-data = $${rootdirectory:srv}/mariadb
172 logrotate-backup = $${basedirectory:backup}/logrotate
173 logrotate-entries = $${rootdirectory:etc}/logrotate.d
174