From 41caccbf4ba5c5df6d846dc2f4a99c0c7bf28a4b Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Wed, 18 Nov 2020 19:12:24 +0200 Subject: [PATCH] Separate MariaDB installation and Galera configuration MDBCI now supports separate Galera server .cnf configuring. Changing MDBCI config template in order to use this MDBCI capability. It allows to use any MariaDB product in the backend (Community or Enterprise, production, staging or CI) --- system-test/create_user.sh | 2 + system-test/create_user_galera.sh | 2 + system-test/maxtest/src/mariadb_nodes.cc | 1 + .../mdbci/templates/default.json.template | 68 ++++++++++++------- .../mdbci/templates/performance.json.template | 68 ------------------- 5 files changed, 49 insertions(+), 92 deletions(-) delete mode 100644 system-test/mdbci/templates/performance.json.template diff --git a/system-test/create_user.sh b/system-test/create_user.sh index 4fac0a098..bf95275b8 100755 --- a/system-test/create_user.sh +++ b/system-test/create_user.sh @@ -7,6 +7,8 @@ mysql --force $1 <& /dev/null +CREATE DATABASE IF NOT EXISTS test; + DROP USER IF EXISTS '$node_user'@'%'; CREATE USER '$node_user'@'%' IDENTIFIED BY '$node_password'; GRANT ALL PRIVILEGES ON *.* TO '$node_user'@'%' $require_ssl WITH GRANT OPTION; diff --git a/system-test/create_user_galera.sh b/system-test/create_user_galera.sh index e7eff8738..0cdb78b1d 100755 --- a/system-test/create_user_galera.sh +++ b/system-test/create_user_galera.sh @@ -13,6 +13,8 @@ done mysql --force < cluster_address.cnf", true); ssh_node_f(i, true, "echo wsrep_cluster_address=gcomm://%s >> cluster_address.cnf", gcomm.c_str()); ssh_node(i, "cp cluster_address.cnf /etc/my.cnf.d/", true); + ssh_node(i, "cp cluster_address.cnf /etc/mysql/my.cnf.d/", true); ssh_node(i, "rm -rf /var/lib/mysql/*", true); ssh_node(i, "mysql_install_db --user=mysql", true); diff --git a/system-test/mdbci/templates/default.json.template b/system-test/mdbci/templates/default.json.template index 2853513d2..d0af854e6 100644 --- a/system-test/mdbci/templates/default.json.template +++ b/system-test/mdbci/templates/default.json.template @@ -265,12 +265,17 @@ "labels" : [ "GALERA_BACKEND" ], - "product" : { - "name": "galera", - "version": "${galera_version}", - "cnf_template" : "galera_server1.cnf", - "cnf_template_path": "${cnf_path}" - } + "products" : [ + { + "name": "${product}", + "version": "${version}" + }, + { + "name": "galera_config", + "cnf_template" : "galera_server1.cnf" + } + ], + "cnf_template_path": "${cnf_path}" }, "galera_001" : @@ -282,12 +287,17 @@ "labels" : [ "GALERA_BACKEND" ], - "product" : { - "name": "galera", - "version": "${galera_version}", - "cnf_template" : "galera_server2.cnf", - "cnf_template_path": "${cnf_path}" - } + "products" : [ + { + "name": "${product}", + "version": "${version}" + }, + { + "name": "galera_config", + "cnf_template" : "galera_server2.cnf" + } + ], + "cnf_template_path": "${cnf_path}" }, "galera_002" : @@ -299,12 +309,17 @@ "labels" : [ "GALERA_BACKEND" ], - "product" : { - "name": "galera", - "version": "${galera_version}", - "cnf_template" : "galera_server3.cnf", - "cnf_template_path": "${cnf_path}" - } + "products" : [ + { + "name": "${product}", + "version": "${version}" + }, + { + "name": "galera_config", + "cnf_template" : "galera_server3.cnf" + } + ], + "cnf_template_path": "${cnf_path}" }, "galera_003" : @@ -316,12 +331,17 @@ "labels" : [ "GALERA_BACKEND" ], - "product" : { - "name": "galera", - "version": "${galera_version}", - "cnf_template" : "galera_server4.cnf", - "cnf_template_path": "${cnf_path}" - } + "products" : [ + { + "name": "${product}", + "version": "${version}" + }, + { + "name": "galera_config", + "cnf_template" : "galera_server4.cnf" + } + ], + "cnf_template_path": "${cnf_path}" }, "maxscale_000" : diff --git a/system-test/mdbci/templates/performance.json.template b/system-test/mdbci/templates/performance.json.template deleted file mode 100644 index 8d5652cbd..000000000 --- a/system-test/mdbci/templates/performance.json.template +++ /dev/null @@ -1,68 +0,0 @@ -{ - -###nodes### - - "galera_000" : - { - "hostname" : "galera000", - "box" : "centos_7_libvirt", - "memory_size" : "2048", - "product" : { - "name": "galera", - "version": "###galera_version###", - "cnf_template" : "galera_server1.cnf", - "cnf_template_path": "~/build-scripts/test-setup-scripts/cnf" - } - }, - - "galera_001" : - { - "hostname" : "galera001", - "box" : "centos_7_libvirt", - "memory_size" : "2048", - "product" : { - "name": "galera", - "version": "###galera_version###", - "cnf_template" : "galera_server2.cnf", - "cnf_template_path": "~/build-scripts/test-setup-scripts/cnf" - } - }, - - "galera_002" : - { - "hostname" : "galera002", - "box" : "centos_7_libvirt", - "memory_size" : "2048", - "product" : { - "name": "galera", - "version": "###galera_version###", - "cnf_template" : "galera_server3.cnf", - "cnf_template_path": "~/build-scripts/test-setup-scripts/cnf" - } - }, - - "galera_003" : - { - "hostname" : "galera003", - "box" : "centos_7_libvirt", - "memory_size" : "2048", - "product" : { - "name": "galera", - "version": "###galera_version###", - "cnf_template" : "galera_server4.cnf", - "cnf_template_path": "~/build-scripts/test-setup-scripts/cnf" - } - }, - - "maxscale" : - { - "hostname" : "maxscale", - "box" : "###box###", - "memory_size" : "2048", - "product" : { - "name" : "maxscale_ci", - "version" : "${target}" - } - - } -}