From 796b71a992208bd0d76c1eb6bb1b8d6c18820107 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 4 Mar 2019 09:54:28 +0100 Subject: [PATCH] =?UTF-8?q?simplication=20d=C3=A9claration=20des=20noeuds?= =?UTF-8?q?=20+=20ajustement=20r=C3=A8gle=20de=20firewall=20+=20d=C3=A9mar?= =?UTF-8?q?rer=20mariadb=20en=20postservice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dicos/25_bdd_server.xml | 28 +++++++++++----------------- postservice/00-bdd-cluster | 11 +++++++++++ posttemplate/25-bdd-cluster | 20 -------------------- tmpl/galera.cnf | 4 ++-- 4 files changed, 24 insertions(+), 39 deletions(-) create mode 100755 postservice/00-bdd-cluster delete mode 100755 posttemplate/25-bdd-cluster diff --git a/dicos/25_bdd_server.xml b/dicos/25_bdd_server.xml index 5292cc4..62540d0 100644 --- a/dicos/25_bdd_server.xml +++ b/dicos/25_bdd_server.xml @@ -2,25 +2,24 @@ - + mariadb - 3306 - mariadb + 3306 + mariadb - - 4444 - 4567 - 4568 - 4567 - mariadb - - ipMariaDBLimit + + 3306 + 4444 + 4567 + 4568 + 4567 + dbClusterMember @@ -117,9 +116,8 @@ galera_cluster - - + ROW @@ -169,9 +167,6 @@ ifMariaDBLimit - - nom_domaine_machine - Default accLimits @@ -184,7 +179,6 @@ MariaDB MariaDB Tunning - dbTunning dbMariaDB diff --git a/postservice/00-bdd-cluster b/postservice/00-bdd-cluster new file mode 100755 index 0000000..7f9cf0c --- /dev/null +++ b/postservice/00-bdd-cluster @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "instance" ]] && [[ "$(CreoleGet dbEnable)" == "oui" ]] && [[ "$(CreoleGet dbEnableCluster)" == "oui" ]] && [[ "$(CreoleGet dbClusterPosition)" == "Leader" ]] +then + service mariadb stop + galera_new_cluster +fi + +exit 0 diff --git a/posttemplate/25-bdd-cluster b/posttemplate/25-bdd-cluster deleted file mode 100755 index 1b56ee3..0000000 --- a/posttemplate/25-bdd-cluster +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -db=$(CreoleGet dbEnable non) -cluster=$(CreoleGet dbEnableCluster non) -role=$(CreoleGet dbClusterPosition 'Node') -gstateFile="/var/lib/mysql/grastate.dat" - -if [[ ${db} == "oui" ]] -then - if [[ ${cluster} == "oui" ]] - then - if [[ ${role} == "Leader" ]] - then - service mariadb stop - galera_new_cluster - fi - fi -fi - -exit 0 \ No newline at end of file diff --git a/tmpl/galera.cnf b/tmpl/galera.cnf index e455286..8040ea8 100644 --- a/tmpl/galera.cnf +++ b/tmpl/galera.cnf @@ -8,7 +8,7 @@ wsrep_on=ON wsrep_provider=/usr/lib/galera/libgalera_smm.so # Galera Cluster Configuration wsrep_cluster_name="%%dbClusterName" -wsrep_cluster_address="gcomm://%%nodeName,%%custom_join(%%dbClusterMember, ',')" +wsrep_cluster_address="gcomm://%%dbClusterMember # Tunning wsrep_provider_options="gcache.size=%%dbClusterGcacheSizeMb" @@ -18,4 +18,4 @@ wsrep_sst_method=%%dbSSTMethod # Galera Node Configuration wsrep_node_address="%%getVar('adresse_ip_' + %%ifDBCluster)" -wsrep_node_name="%%nodeName" +wsrep_node_name="%%dbClusterMember[%%dbClusterMemberIndex]