Commit 23842c3f authored by Jérome Perrin's avatar Jérome Perrin

component/mariadb: install in shared mode

This was not shared, installing mroonga writes a plugin in mariadb's
plugin dir and it's not allowed for one part to write in another part's
folder.
The approach is to install mroonga plugin in it's own plugin directory,
then copy all mariadb default plugins in this plugin directory and
configure instance to use mroonga's plugin directory.
parent c1baadd4
...@@ -14,7 +14,7 @@ extends = ...@@ -14,7 +14,7 @@ extends =
[groonga] [groonga]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = false shared = true
url = https://packages.groonga.org/source/groonga/groonga-9.1.2.tar.gz url = https://packages.groonga.org/source/groonga/groonga-9.1.2.tar.gz
md5sum = 5266c49b758dde744854cb8cfe025812 md5sum = 5266c49b758dde744854cb8cfe025812
# temporary patch to respect more tokens in natural language mode. # temporary patch to respect more tokens in natural language mode.
...@@ -43,12 +43,17 @@ environment = ...@@ -43,12 +43,17 @@ environment =
LDFLAGS=-Wl,-rpath=${jemalloc:location}/lib -L${jemalloc:location}/lib -Wl,-rpath=${libstemmer:location}/lib -L${libstemmer:location}/lib -Wl,-rpath=${zlib:location}/lib -L${zlib:location}/lib LDFLAGS=-Wl,-rpath=${jemalloc:location}/lib -L${jemalloc:location}/lib -Wl,-rpath=${libstemmer:location}/lib -L${libstemmer:location}/lib -Wl,-rpath=${zlib:location}/lib -L${zlib:location}/lib
PATH=${patch:location}/bin:%(PATH)s PATH=${patch:location}/bin:%(PATH)s
[groonga-normalizer-mysql] [groonga-normalizer-mysql]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = false shared = true
url = https://packages.groonga.org/source/groonga-normalizer-mysql/groonga-normalizer-mysql-1.1.4.tar.gz url = https://packages.groonga.org/source/groonga-normalizer-mysql/groonga-normalizer-mysql-1.1.4.tar.gz
md5sum = effa67fb271d49810850a3b275d040f6 md5sum = effa67fb271d49810850a3b275d040f6
location = ${groonga:location}
groonga-plugin-dir = @@LOCATION@@/lib/groonga/plugins/
pre-configure = mkdir -p ${:groonga-plugin-dir}
post-install = cp -ra ${groonga:location}/lib/groonga/plugins/* ${:groonga-plugin-dir}
make-targets = GROONGA_PLUGINS_DIR=${:groonga-plugin-dir} install
configure-options = configure-options =
--disable-static --disable-static
environment = environment =
......
...@@ -29,10 +29,11 @@ parts = ...@@ -29,10 +29,11 @@ parts =
[mariadb] [mariadb]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true
url = https://downloads.mariadb.org/f/mariadb-${:version}/source/mariadb-${:version}.tar.gz/from/http%3A//fr.mirror.babylon.network/mariadb/?serve url = https://downloads.mariadb.org/f/mariadb-${:version}/source/mariadb-${:version}.tar.gz/from/http%3A//fr.mirror.babylon.network/mariadb/?serve
version = 10.4.12 version = 10.4.12
md5sum = 97d7c0f508c04a31c138fdb24e95dbc4 md5sum = 97d7c0f508c04a31c138fdb24e95dbc4
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = @@LOCATION@@
pre-configure = pre-configure =
set '\bSET(PLUGIN_AUTH_PAM YES)' cmake/build_configurations/mysql_release.cmake set '\bSET(PLUGIN_AUTH_PAM YES)' cmake/build_configurations/mysql_release.cmake
grep -q "$@" grep -q "$@"
...@@ -88,8 +89,12 @@ post-install = ...@@ -88,8 +89,12 @@ post-install =
[mroonga-mariadb] [mroonga-mariadb]
# mroonga - a storage engine for MySQL. It provides fast fulltext search feature to all MySQL users. # mroonga - a storage engine for MySQL. It provides fast fulltext search feature to all MySQL users.
# http://mroonga.github.com/ # https://mroonga.org/
#
# To use mroonga, configure mariadb instance to use ${mroonga-mariadb:plugin-dir}
# as plugin-dir ( https://mariadb.com/kb/en/server-system-variables/#plugin_dir )
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true
url = https://packages.groonga.org/source/mroonga/mroonga-9.12.tar.gz url = https://packages.groonga.org/source/mroonga/mroonga-9.12.tar.gz
md5sum = d0af673f1bad3b9ccf33870bb2344a25 md5sum = d0af673f1bad3b9ccf33870bb2344a25
pre-configure = pre-configure =
...@@ -98,13 +103,19 @@ pre-configure = ...@@ -98,13 +103,19 @@ pre-configure =
cd fake_mariadb_source cd fake_mariadb_source
ln -s ${mariadb:location}/wsrep-lib ln -s ${mariadb:location}/wsrep-lib
cp -a ${mariadb:location}/include/mysql/server include cp -a ${mariadb:location}/include/mysql/server include
mv include/private sql cp -a include/private sql
chmod -R a+w include sql # so that buildout can delete this compile-dir after install
mkdir -p ${:plugin-dir}
configure-options = configure-options =
--with-mysql-source=fake_mariadb_source --with-mysql-source=fake_mariadb_source
--with-mysql-config=${mariadb:location}/bin/mysql_config --with-mysql-config=${mariadb:location}/bin/mysql_config
--disable-static --disable-static
--disable-document --disable-document
post-install =
cp -ra ${mariadb:location}/lib/plugin/* ${:plugin-dir}
plugin-dir = @@LOCATION@@/lib/plugin
install-sql = @@LOCATION@@/share/mroonga/install.sql install-sql = @@LOCATION@@/share/mroonga/install.sql
make-targets = plugindir=${:plugin-dir} install
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/mroonga_boolean.patch#c818568fe35ca6a4298f18e575d962a0 ${:_profile_base_location_}/mroonga_boolean.patch#c818568fe35ca6a4298f18e575d962a0
...@@ -113,3 +124,4 @@ environment = ...@@ -113,3 +124,4 @@ environment =
CPPFLAGS=-I${groonga:location}/include/groonga -I${pcre:location}/include CPPFLAGS=-I${groonga:location}/include/groonga -I${pcre:location}/include
LDFLAGS=-L${groonga:location}/lib LDFLAGS=-L${groonga:location}/lib
PKG_CONFIG_PATH=${groonga:location}/lib/pkgconfig:${groonga-normalizer-mysql:location}/lib/pkgconfig PKG_CONFIG_PATH=${groonga:location}/lib/pkgconfig:${groonga-normalizer-mysql:location}/lib/pkgconfig
GROONGA_PLUGINS_DIR=${groonga-normalizer-mysql:groonga-plugin-dir}
...@@ -191,6 +191,7 @@ context = ...@@ -191,6 +191,7 @@ context =
key mariadb_slow_query_report_script mariadb-slow-query-report-script:target key mariadb_slow_query_report_script mariadb-slow-query-report-script:target
key mariadb_start_clone_from_backup mariadb-start-clone-from-backup:target key mariadb_start_clone_from_backup mariadb-start-clone-from-backup:target
key mroonga_mariadb_install_sql mroonga-mariadb:install-sql key mroonga_mariadb_install_sql mroonga-mariadb:install-sql
key mroonga_mariadb_plugin_dir mroonga-mariadb:plugin-dir
key matplotlibrc_location matplotlibrc:location key matplotlibrc_location matplotlibrc:location
key parts_directory buildout:parts-directory key parts_directory buildout:parts-directory
key openssl_location openssl:location key openssl_location openssl:location
......
...@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196 ...@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb] [template-mariadb]
filename = instance-mariadb.cfg.in filename = instance-mariadb.cfg.in
md5sum = 63bac9fc58537e55a6c8c42d0be54fbe md5sum = 4749cc5c55a57aa84f1d404676ba70f8
[template-kumofs] [template-kumofs]
filename = instance-kumofs.cfg.in filename = instance-kumofs.cfg.in
...@@ -42,7 +42,7 @@ md5sum = d32417746fcf671d4e86a70379815039 ...@@ -42,7 +42,7 @@ md5sum = d32417746fcf671d4e86a70379815039
[template-my-cnf] [template-my-cnf]
filename = my.cnf.in filename = my.cnf.in
md5sum = 771bfd921aa5e59e1b4712ba113fa84b md5sum = 7944ec58a2c6ee74a56219bacebfd145
[template-mariadb-initial-setup] [template-mariadb-initial-setup]
filename = mariadb_initial_setup.sql.in filename = mariadb_initial_setup.sql.in
...@@ -70,7 +70,7 @@ md5sum = cc19560b9400cecbd23064d55c501eec ...@@ -70,7 +70,7 @@ md5sum = cc19560b9400cecbd23064d55c501eec
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = c846676bbfd09505e328984aaa9d7f08 md5sum = cf7ca9055b29e26ef5eda6ebbd75fa51
[monitor-template-dummy] [monitor-template-dummy]
filename = dummy.cfg filename = dummy.cfg
......
...@@ -129,6 +129,7 @@ socket = ${directory:run}/mariadb.sock ...@@ -129,6 +129,7 @@ socket = ${directory:run}/mariadb.sock
data-directory = ${directory:srv}/mariadb data-directory = ${directory:srv}/mariadb
tmp-directory = ${directory:tmp} tmp-directory = ${directory:tmp}
etc-directory = ${directory:etc} etc-directory = ${directory:etc}
plugin-directory = {{ dumps(parameter_dict['mroonga-mariadb-plugin-dir']) }}
pid-file = ${directory:run}/mariadb.pid pid-file = ${directory:run}/mariadb.pid
error-log = ${directory:log}/mariadb_error.log error-log = ${directory:log}/mariadb_error.log
slow-query-log = ${directory:log}/mariadb_slowquery.log slow-query-log = ${directory:log}/mariadb_slowquery.log
......
...@@ -155,6 +155,7 @@ promise-check-slow-queries-digest-result = {{ bin_directory }}/check-slow-querie ...@@ -155,6 +155,7 @@ promise-check-slow-queries-digest-result = {{ bin_directory }}/check-slow-querie
percona-tools-location = {{ percona_toolkit_location }} percona-tools-location = {{ percona_toolkit_location }}
unixodbc-location = {{ unixodbc_location }} unixodbc-location = {{ unixodbc_location }}
mroonga-mariadb-install-sql = {{ mroonga_mariadb_install_sql }} mroonga-mariadb-install-sql = {{ mroonga_mariadb_install_sql }}
mroonga-mariadb-plugin-dir = {{ mroonga_mariadb_plugin_dir }}
[dynamic-template-mariadb] [dynamic-template-mariadb]
<= jinja2-template-base <= jinja2-template-base
......
...@@ -32,6 +32,7 @@ innodb_file_per_table = {{ parameter_dict['innodb-file-per-table'] }} ...@@ -32,6 +32,7 @@ innodb_file_per_table = {{ parameter_dict['innodb-file-per-table'] }}
default_time_zone = '+00:00' default_time_zone = '+00:00'
plugin_load = ha_mroonga plugin_load = ha_mroonga
plugin-dir = {{ parameter_dict['plugin-directory'] }}
max_connections = {{ parameter_dict['max-connection-count'] }} max_connections = {{ parameter_dict['max-connection-count'] }}
......
...@@ -102,6 +102,7 @@ context = ...@@ -102,6 +102,7 @@ context =
key mariadb_slow_query_report_script mariadb-slow-query-report-script:target key mariadb_slow_query_report_script mariadb-slow-query-report-script:target
key mariadb_start_clone_from_backup mariadb-start-clone-from-backup:target key mariadb_start_clone_from_backup mariadb-start-clone-from-backup:target
key mroonga_mariadb_install_sql mroonga-mariadb:install-sql key mroonga_mariadb_install_sql mroonga-mariadb:install-sql
key mroonga_mariadb_plugin_dir mroonga-mariadb:plugin-dir
key percona_toolkit_location percona-toolkit:location key percona_toolkit_location percona-toolkit:location
key template_php_ini template-php.ini:output key template_php_ini template-php.ini:output
key template_apache_conf template-apache.conf:output key template_apache_conf template-apache.conf:output
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[instance] [instance]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 92a93bb3b9f6663d967b0fb57244a1fa md5sum = b50fc416f25d6e0503cdd7ed1cd48314
[instance-apache-php] [instance-apache-php]
filename = instance-apache-php.cfg.in filename = instance-apache-php.cfg.in
......
...@@ -90,6 +90,7 @@ promise-check-slow-queries-digest-result = {{ bin_directory }}/check-slow-querie ...@@ -90,6 +90,7 @@ promise-check-slow-queries-digest-result = {{ bin_directory }}/check-slow-querie
percona-tools-location = {{ percona_toolkit_location }} percona-tools-location = {{ percona_toolkit_location }}
unixodbc-location = {{ unixodbc_location }} unixodbc-location = {{ unixodbc_location }}
mroonga-mariadb-install-sql = {{ mroonga_mariadb_install_sql }} mroonga-mariadb-install-sql = {{ mroonga_mariadb_install_sql }}
mroonga-mariadb-plugin-dir = {{ mroonga_mariadb_plugin_dir }}
check-computer-memory-binary = {{ bin_directory }}/check-computer-memory check-computer-memory-binary = {{ bin_directory }}/check-computer-memory
bin-directory = {{ bin_directory }} bin-directory = {{ bin_directory }}
......
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