Commit 67dbe6d0 authored by Julien Muchembled's avatar Julien Muchembled

neoppod: stop using deprecated slapos.cookbook:generic.mysql

Contrary to ERP5, there's no mysql-update service:
- this simplifies the SR
- after reading the MySQL documentation, the automatic use of mysql_upgrade
  is quite frightening:
  « You should always back up your current MySQL installation before performing
  an upgrade. »
  « After running mysql_upgrade, stop the server and restart it so that any
  changes made to the system tables take effect. » (which is currently not done
  by the recipe)
- the future of NEO is an embedded DB like libmysqld
parent 61711abc
......@@ -4,29 +4,38 @@ parts +=
neo-storage
logrotate-storage
[mariadb-instance]
recipe = slapos.cookbook:generic.mysql
user = user
database = neo
conf-file = ${directory:etc}/mariadb.cnf
# No networking (ip & port options)
[mysqld]
recipe = slapos.cookbook:generic.mysql.wrap_mysqld
output = ${directory:etc_run}/mariadb
binary = ${:mysql-base-directory}/bin/mysqld
configuration-file = ${my-cnf:rendered}
data-directory = ${directory:srv_mariadb}
bin-directory = ${directory:bin}
pid-file = ${directory:var_run}/mariadb.pid
mysql-install-binary = ${:mysql-base-directory}/scripts/mysql_install_db
mysql-base-directory = {{ mariadb_location }}
[my-cnf-parameters]
socket = ${directory:var_run}/mariadb.sock
data-directory = ${mysqld:data-directory}
pid-file = ${directory:var_run}/mariadb.pid
error-log = ${directory:log}/mariadb_error.log
slow-query-log = ${directory:log}/mariadb_slowquery.log
long-query-time = {{ dumps(slapparameter_dict.get('long-query-time', 1)) }}
relaxed-writes = {{ dumps(slapparameter_dict.get('relaxed-writes', False)) }}
init-file = ${init-script:rendered}
wrapper = ${directory:etc_run}/mariadb
update-wrapper = ${directory:etc_run}/mariadb_update
mysql-base-directory = {{ mariadb_location }}
mysql-binary = {{ mariadb_location }}/bin/mysql
mysql-install-binary = {{ mariadb_location }}/scripts/mysql_install_db
mysql-upgrade-binary = {{ mariadb_location }}/bin/mysql_upgrade
mysqld-binary = {{ mariadb_location }}/bin/mysqld
[my-cnf]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/mariadb.cnf
template = {{ template_my_cnf }}
context = section parameter_dict my-cnf-parameters
mroonga =
[init-script]
recipe = slapos.recipe.template:jinja2
# XXX: is there a better location ?
rendered = ${directory:etc}/mariadb_initial_setup.sql
database = neo
template = inline:
CREATE DATABASE IF NOT EXISTS ${:database};
[neo-storage]
recipe = slapos.cookbook:neoppod.storage
......@@ -37,7 +46,7 @@ ip = {{ (ipv4_set | list)[0] }}
cluster = {{ dumps(slapparameter_dict['cluster']) }}
masters = {{ dumps(slapparameter_dict.get('masters', '')) }}
database-adapter = MySQL
database-parameters = ${mariadb-instance:user}:${mariadb-instance:password}@${mariadb-instance:database}${mariadb-instance:socket}
database-parameters = root@${init-script:database}${my-cnf-parameters:socket}
wait-database = 60
[directory]
......
......@@ -46,6 +46,7 @@ template = {{ neo_storage_mysql }}
extra-context =
key master_cfg neo-master:rendered
raw mariadb_location {{ mariadb_location }}
raw template_my_cnf {{ template_my_cnf }}
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
......
{% set socket = parameter_dict['socket'] -%}
[mysqld]
skip_networking
socket = {{ socket }}
datadir = {{ parameter_dict['data-directory'] }}
pid_file = {{ parameter_dict['pid-file'] }}
log_error = {{ parameter_dict['error-log'] }}
slow_query_log
slow_query_log_file = {{ parameter_dict['slow-query-log'] }}
long_query_time = {{ parameter_dict['long-query-time'] }}
init_file = {{ parameter_dict['init-file'] }}
log_warnings = 1
disable-log-bin
## The following settings come from ERP5 configuration.
max_allowed_packet = 128M
query_cache_size = 32M
innodb_file_per_table = 0
innodb_locks_unsafe_for_binlog = 1
# Some dangerous settings you may want to uncomment temporarily
# if you only want performance or less disk access.
{% set x = '' if parameter_dict['relaxed-writes'] else '#' -%}
{{x}}innodb_flush_log_at_trx_commit = 0
{{x}}innodb_flush_method = nosync
{{x}}innodb_doublewrite = 0
{{x}}sync_frm = 0
# Force utf8 usage
collation_server = utf8_unicode_ci
character_set_server = utf8
skip_character_set_client_handshake
[client]
socket = {{ socket }}
user = root
......@@ -49,12 +49,17 @@ md5sum = 25724ba46203c57b680976dbe4ba67b7
[instance-neo-storage-mysql]
< = cluster
md5sum = 1117184530207258b194e27dbe724cd5
md5sum = 3fcf0e6146c62421f45fe9b3aeeb5cf5
[template-my-cnf]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/my.cnf.in
md5sum = 38b4eb7225f9b7c18875b4d2ab398278
[template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
md5sum = c7147d7c09294385b4995f6480fd976e
md5sum = fadc905aa50375e89cd3871741ad3507
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
context =
......@@ -66,6 +71,7 @@ context =
key neo_master instance-neo-master:target
key neo_storage_mysql instance-neo-storage-mysql:target
key mariadb_location mariadb:location
key template_my_cnf template-my-cnf:target
key logrotate_base template-logrotate-base:rendered
[neoppod]
......
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