Compare commits
1 Commits
master
...
pkg/dev/eo
Author | SHA1 | Date |
---|---|---|
Philippe Caseiro | 6d4b75c679 |
4
Makefile
4
Makefile
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
SOURCE=eole-mariadb
|
SOURCE=eole-mariadb
|
||||||
VERSION=0.0.1
|
VERSION=0.0.1
|
||||||
EOLE_VERSION=2.7
|
EOLE_VERSION=2.6
|
||||||
EOLE_RELEASE=2.7.1
|
EOLE_RELEASE=2.6.2
|
||||||
PKGAPPS=non
|
PKGAPPS=non
|
||||||
#FLASK_MODULE=<APPLICATION>
|
#FLASK_MODULE=<APPLICATION>
|
||||||
|
|
||||||
|
|
129
README.md
129
README.md
|
@ -1,139 +1,12 @@
|
||||||
# eole-mariadb
|
# eole-mariadb
|
||||||
|
|
||||||
Paquet porté pour la 2.7.1. Les tests n'ont été réalisé que sur un Eolebase.
|
|
||||||
|
|
||||||
La version utilisé est mariadb 10.3
|
|
||||||
|
|
||||||
Ajout de ce paquet sur une 2.7.1 :
|
|
||||||
|
|
||||||
## Add the Cadoles repository on all the nodes and the Leader
|
|
||||||
|
|
||||||
GenConfig [Mode Expert] -> Dépôts Tiers
|
|
||||||
|
|
||||||
* Libellé du dépôt : Cadoles dev
|
|
||||||
* Déclaration du dépôt : deb [ arch=all ] https://vulcain.cadoles.com 2.7.1-dev main
|
|
||||||
* Méthode de récupération de la clé publique du dépôt : URL de la clé
|
|
||||||
* URL de la clé : https://vulcain.cadoles.com/cadoles.gpg
|
|
||||||
|
|
||||||
## Add the MariaDB repository on all the nodes and the Leader
|
|
||||||
|
|
||||||
GenConfig (Mode Expert) -> Dépôt tiers :
|
|
||||||
* Libellé du dépôt : MariaDB
|
|
||||||
* Déclaration du dépôt : deb [ arch=amd64 ] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.3/ubuntu bionic main
|
|
||||||
* Méthode de récupération de la clé publique du dépôt : serveur de clés
|
|
||||||
* URL du serveur de clés : hkp://keyserver.ubuntu.com:80
|
|
||||||
* Empreinte de la clé : 0xF1656F24C74CD1D8
|
|
||||||
|
|
||||||
#######################################################################
|
|
||||||
|
|
||||||
Paquet porté pour la 2.7.0. Les tests n'ont été réalisé que sur un Eolebase.
|
|
||||||
|
|
||||||
La version utilisé est mariadb 10.3
|
|
||||||
|
|
||||||
Ajout de ce paquet sur une 2.7.0 :
|
|
||||||
|
|
||||||
## Add the Cadoles repository on all the nodes and the Leader
|
|
||||||
|
|
||||||
GenConfig [Mode Expert] -> Dépôts Tiers
|
|
||||||
|
|
||||||
* Libellé du dépôt : Cadoles dev
|
|
||||||
* Déclaration du dépôt : deb [ arch=all ] https://vulcain.cadoles.com 2.7.0-dev main
|
|
||||||
* Méthode de récupération de la clé publique du dépôt : URL de la clé
|
|
||||||
* URL de la clé : https://vulcain.cadoles.com/cadoles.gpg
|
|
||||||
|
|
||||||
## Add the MariaDB repository on all the nodes and the Leader
|
|
||||||
|
|
||||||
GenConfig (Mode Expert) -> Dépôt tiers :
|
|
||||||
* Libellé du dépôt : MariaDB
|
|
||||||
* Déclaration du dépôt : deb [ arch=amd64 ] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.3/ubuntu bionic main
|
|
||||||
* Méthode de récupération de la clé publique du dépôt : serveur de clés
|
|
||||||
* URL du serveur de clés : hkp://keyserver.ubuntu.com:80
|
|
||||||
* Empreinte de la clé : 0xF1656F24C74CD1D8
|
|
||||||
|
|
||||||
#######################################################################
|
|
||||||
|
|
||||||
|
|
||||||
Début des travaux pour l'utilisation de mariadb
|
Début des travaux pour l'utilisation de mariadb
|
||||||
dans Eole avec des fonctionalitées avancées du type
|
dans Eole avec des fonctionalitées avancées du type
|
||||||
mise en clustter
|
mise en clustter
|
||||||
|
|
||||||
# How-to for Eole 2.6.2 (using this repo dico and templates)
|
# How-to for Eole 2.6.2 (using this repo dico and templates)
|
||||||
|
|
||||||
Start with 3 fresh eolebase 2.6.2 instancied.
|
### FIXME
|
||||||
|
|
||||||
One for the Clustter Leader, another for the cluster Node another for the Arbitrator, the arbitrator can be replaced by another node.
|
|
||||||
|
|
||||||
The order is very important, Never configure a Node before the Leader ! The Leader must be the first one.
|
|
||||||
|
|
||||||
## Add the Cadoles repository on all the nodes and the Leader
|
|
||||||
|
|
||||||
GenConfig [Mode Expert] -> Dépôts Tiers
|
|
||||||
|
|
||||||
* Libellé du dépôt : Cadoles dev
|
|
||||||
* Déclaration du dépôt : deb [ arch=all ] https://vulcain.cadoles.com 2.6.2-dev main
|
|
||||||
* Méthode de récupération de la clé publique du dépôt : URL de la clé
|
|
||||||
* URL de la clé : https://vulcain.cadoles.com/cadoles.gpg
|
|
||||||
|
|
||||||
## Add the MariaDB repository on all the nodes and the Leader
|
|
||||||
|
|
||||||
GenConfig (Mode Expert) -> Dépôt tiers :
|
|
||||||
* Libellé du dépôt : MariaDB
|
|
||||||
* Déclaration du dépôt : deb [arch=amd64] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.2/ubuntu xenial main
|
|
||||||
* Méthode de récupération de la clé publique du dépôt : serveur de clés
|
|
||||||
* URL du serveur de clés : hkp://keyserver.ubuntu.com:80
|
|
||||||
* Empreinte de la clé : 0xF1656F24C74CD1D8
|
|
||||||
|
|
||||||
## Configure the Leader :
|
|
||||||
|
|
||||||
GenConfig (Mode Normal) -> Services :
|
|
||||||
* Activer le serveur de base de données MariaDB : oui
|
|
||||||
|
|
||||||
GenConfig (Mode Normal) -> Database :
|
|
||||||
* Activer la mise en grappe MariaDB Galera ? : oui
|
|
||||||
|
|
||||||
GenConfig (Mode Normal) -> Database cluster :
|
|
||||||
* Rôle dans la grappe : Leader
|
|
||||||
* Interface réseau dédiée à la grappe BDD : eth0
|
|
||||||
* Nom du noeud local : <THE NAME YOU WANT>
|
|
||||||
* Membre de la grappe BDD :
|
|
||||||
* Membre de la grappe BDD : <NAME OF THE LEADER>
|
|
||||||
* Adresse IP : <IP OF THE LEADER>
|
|
||||||
|
|
||||||
* Membre de la grappe BDD : <NAME OF THE ARBITRATOR OR NODE>
|
|
||||||
* Adresse IP : <IP OF THE NODE OR ARBITRATOR>
|
|
||||||
* *Nom de la grappe : <NAME OF THE CLUSTER>
|
|
||||||
|
|
||||||
## Reconfigure Leader !
|
|
||||||
Run reconfigure command !
|
|
||||||
|
|
||||||
## Configure the Nodes !
|
|
||||||
|
|
||||||
GenConfig (Mode Normal) -> Services :
|
|
||||||
* Activer le serveur de base de données MariaDB : oui
|
|
||||||
|
|
||||||
GenConfig (Mode Normal) -> Database :
|
|
||||||
* Activer la mise en grappe MariaDB Galera ? : oui
|
|
||||||
|
|
||||||
GenConfig (Mode Normal) -> Database cluster :
|
|
||||||
* Rôle dans la grappe : Node
|
|
||||||
* Interface réseau dédiée à la grappe BDD : eth0
|
|
||||||
* Nom du noeud local : <THE NAME YOU WANT>
|
|
||||||
* Membre de la grappe BDD :
|
|
||||||
* Membre de la grappe BDD : <NAME OF THE LEADER>
|
|
||||||
* Adresse IP : <IP OF THE LEADER>
|
|
||||||
|
|
||||||
* Membre de la grappe BDD : <NAME OF THE ARBITRATOR OR NODE>
|
|
||||||
* Adresse IP : <IP OF THE NODE OR ARBITRATOR>
|
|
||||||
* *Nom de la grappe : <NAME OF THE CLUSTER>
|
|
||||||
|
|
||||||
## Reconfigure the Nodes !
|
|
||||||
Run reconfigure command on each node one by one.
|
|
||||||
|
|
||||||
## Configure the Arbitrator if needed !
|
|
||||||
|
|
||||||
If you have only 2 nodes you need to setup an arbitrator, for this follow the tutorial in the eole-galera-arbitrator project page https://forge.cadoles.com/Cadoles/eole-galera-arbitrator
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# How-to for Eole 2.6.2 (From scratch)
|
# How-to for Eole 2.6.2 (From scratch)
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ def getMemoryPercentage(percent):
|
||||||
percent = int(percent)
|
percent = int(percent)
|
||||||
totalMemory = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
|
totalMemory = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
|
||||||
memoryToUse = (totalMemory*percent)/100
|
memoryToUse = (totalMemory*percent)/100
|
||||||
memoryMb = int(memoryToUse/(1024.**2))
|
memoryMb = memoryToUse/(1024.**2)
|
||||||
return "{0}M".format(memoryMb)
|
return "{0}M".format(int(memoryMb))
|
||||||
except:
|
except:
|
||||||
return "Error during memory percentage calculation"
|
return "Error during memory percentage calculation"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
9
|
|
@ -0,0 +1,18 @@
|
||||||
|
Source: eole-mariadb
|
||||||
|
Section: web
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: Cadoles <eole@ac-dijon.fr>
|
||||||
|
Build-Depends: debhelper (>= 9)
|
||||||
|
Standards-Version: 3.9.3
|
||||||
|
Homepage: https://forge.cadoles.com/Cadoles/eole-mariadb
|
||||||
|
Vcs-Git: https://forge.cadoles.com/Cadoles/eole-mariadb.git
|
||||||
|
Vcs-Browser: https://forge.cadoles.com/Cadoles/eole-mariadb
|
||||||
|
|
||||||
|
Package: eole-mariadb
|
||||||
|
Architecture: all
|
||||||
|
Depends: ${misc:Depends}, mariadb-server
|
||||||
|
Conflicts: eole-mysql
|
||||||
|
Provides: eole-mysql
|
||||||
|
Description: Dictionnaires et templates pour la configuration d'un serveur MariaDB, testée uniquement avec eolebase
|
||||||
|
.
|
||||||
|
Pour toute information complémentaire, veuillez vous rendre sur la forge Cadoles.
|
|
@ -0,0 +1,44 @@
|
||||||
|
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Upstream-Name: {PROJECT}
|
||||||
|
Source: {URL}
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: YEAR {UPSTREAM} {AUTHOR} <{MAIL}>
|
||||||
|
License: {UPSTREAM LICENSE}
|
||||||
|
|
||||||
|
Files: debian/*
|
||||||
|
Copyright: 2012 Équipe EOLE <eole@ac-dijon.fr>
|
||||||
|
License: CeCILL-2
|
||||||
|
|
||||||
|
License: {UPSTREAM LICENSE}
|
||||||
|
{TEXT OF THE LICENSE}
|
||||||
|
|
||||||
|
License: CeCILL-2
|
||||||
|
This software is governed by the CeCILL-2 license under French law and
|
||||||
|
abiding by the rules of distribution of free software. You can use,
|
||||||
|
modify and or redistribute the software under the terms of the CeCILL-2
|
||||||
|
license as circulated by CEA, CNRS and INRIA at the following URL
|
||||||
|
"http://www.cecill.info";.
|
||||||
|
.
|
||||||
|
As a counterpart to the access to the source code and rights to copy,
|
||||||
|
modify and redistribute granted by the license, users are provided only
|
||||||
|
with a limited warranty and the software's author, the holder of the
|
||||||
|
economic rights, and the successive licensors have only limited
|
||||||
|
liability.
|
||||||
|
.
|
||||||
|
In this respect, the user's attention is drawn to the risks associated
|
||||||
|
with loading, using, modifying and/or developing or reproducing the
|
||||||
|
software by the user in light of its specific status of free software,
|
||||||
|
that may mean that it is complicated to manipulate, and that also
|
||||||
|
therefore means that it is reserved for developers and experienced
|
||||||
|
professionals having in-depth computer knowledge. Users are therefore
|
||||||
|
encouraged to load and test the software's suitability as regards their
|
||||||
|
requirements in conditions enabling the security of their systems and/or
|
||||||
|
data to be ensured and, more generally, to use and operate it in the
|
||||||
|
same conditions as regards security.
|
||||||
|
.
|
||||||
|
The fact that you are presently reading this means that you have had
|
||||||
|
knowledge of the CeCILL-2 license and that you accept its terms.
|
||||||
|
.
|
||||||
|
On Eole systems, the complete text of the CeCILL-2 License can be found
|
||||||
|
in '/usr/share/common-licenses/CeCILL-2-en'.
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Set per distribution debian tag
|
||||||
|
[DEFAULT]
|
||||||
|
debian-tag = debian/eole/%(version)s
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/make -f
|
||||||
|
# -*- makefile -*-
|
||||||
|
|
||||||
|
# Uncomment this to turn on verbose mode.
|
||||||
|
#export DH_VERBOSE=1
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@
|
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
3.0 (native)
|
|
@ -1,232 +1,191 @@
|
||||||
<creole>
|
<creole>
|
||||||
<files>
|
<files>
|
||||||
<file filelist='dbMariaDB' name='/etc/mysql/conf.d/mariadb.cnf' rm='True' mkdir='True'/>
|
<file filelist='dbCluster' name='/etc/mysql/conf.d/galera.cnf' rm='True' mkdir='True'/>
|
||||||
<file filelist='dbCluster' name='/etc/mysql/conf.d/galera.cnf' rm='True' mkdir='True'/>
|
<file filelist='dbTunning' name='/etc/mysql/conf.d/tunning.cnf' rm='True' mkdir='True'/>
|
||||||
<file filelist='dbTunning' name='/etc/mysql/conf.d/tunning.cnf' rm='True' mkdir='True'/>
|
<service_access service='mariadb'>
|
||||||
|
<port service_accesslist='mariadb' protocol='tcp'>3306</port>
|
||||||
|
<tcpwrapper service_accesslist='mariadb'>mariadb</tcpwrapper>
|
||||||
|
</service_access>
|
||||||
|
<service_access service='galera'>
|
||||||
|
<port service_accesslist='dbCluster' protocol='tcp'>4444</port>
|
||||||
|
<port service_accesslist='dbCluster' protocol='tcp'>4567</port>
|
||||||
|
<port service_accesslist='dbCluster' protocol='tcp'>4568</port>
|
||||||
|
<port service_accesslist='dbCluster' protocol='udp'>4567</port>
|
||||||
|
<tcpwrapper service_accesslist='mariadb'>mariadb</tcpwrapper>
|
||||||
|
</service_access>
|
||||||
|
|
||||||
<service servicelist='bdd'>mariadb</service>
|
<service_restriction service='mariadb'>
|
||||||
<service_access service='mariadb'>
|
|
||||||
<port protocol='tcp'>3306</port>
|
|
||||||
<tcpwrapper>mariadb</tcpwrapper>
|
|
||||||
</service_access>
|
|
||||||
<service_restriction service='mariadb'>
|
|
||||||
<ip interface='ifMariaDBLimit' interface_type="SymLinkOption" netmask='maskMariaDBLimit' netmask_type='SymLinkOption' ip_type='SymLinkOption'>ipMariaDBLimit</ip>
|
<ip interface='ifMariaDBLimit' interface_type="SymLinkOption" netmask='maskMariaDBLimit' netmask_type='SymLinkOption' ip_type='SymLinkOption'>ipMariaDBLimit</ip>
|
||||||
</service_restriction>
|
</service_restriction>
|
||||||
|
|
||||||
<service_access service='galera'>
|
<service_restriction service='galera'>
|
||||||
<port service_accesslist='dbCluster' protocol='tcp'>3306</port>
|
<ip interface='ifDBCluster' interface_type="SymLinkOption" netmask='255.255.255.255' ip_type='SymLinkOption'>dbClusterMemberIP</ip>
|
||||||
<port service_accesslist='dbCluster' protocol='tcp'>4444</port>
|
|
||||||
<port service_accesslist='dbCluster' protocol='tcp'>4567</port>
|
|
||||||
<port service_accesslist='dbCluster' protocol='tcp'>4568</port>
|
|
||||||
<port service_accesslist='dbCluster' protocol='udp'>4567</port>
|
|
||||||
</service_access>
|
|
||||||
<service_restriction service='galera'>
|
|
||||||
<ip interface='ifDBCluster' interface_type="SymLinkOption" netmask='255.255.255.255' ip_type='SymLinkOption'>dbClusterMember</ip>
|
|
||||||
</service_restriction>
|
</service_restriction>
|
||||||
</files>
|
</files>
|
||||||
<variables>
|
<variables>
|
||||||
<family name="Services">
|
<family name="Services">
|
||||||
<variable name="dbEnable" type='oui/non' description='Activer le serveur de base de données MariaDB'>
|
<variable name="dbEnable" type='oui/non' description='Activer le serveur de base de données MariaDB'>
|
||||||
<value>oui</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbEnableBackup" type='oui/non' description='Activer la sauvegarde sur le serveur de base de données MariaDB'>
|
|
||||||
<value>non</value>
|
<value>non</value>
|
||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
<family name="MariaDB" icon='mysql-alt'>
|
<family name="DataBase">
|
||||||
<variable name='dbEnableCluster' type='oui/non' description="Activer la mise en grappe MariaDB Galera ?">
|
<variable name='dbEnableCluster' type='oui/non' description="Activer la mise en grappe MariaDB Galera ?">
|
||||||
<value>non</value>
|
<value>non</value>
|
||||||
</variable>
|
</variable>
|
||||||
<variable name='ipMariaDBLimit' type='network' description="Adresse IP réseau autorisée pour les connexions distantes au serveur MySQL" multi='True' mandatory='True'/>
|
<variable name='ipMariaDBLimit' type='network' description="Adresse IP réseau autorisée pour les connexions distantes au serveur MySQL" multi='True' mandatory='True'/>
|
||||||
<variable name='maskMariaDBLimit' type='netmask' description="Masque du sous réseau pour les connexions distantes au serveur MySQL" mandatory='True'/>
|
<variable name='maskMariaDBLimit' type='netmask' description="Masque du sous réseau pour les connexions distantes au serveur MySQL" mandatory='True'/>
|
||||||
<variable name='ifMariaDBLimit' type='string' description="Interface pour les connexions distantes au serveur MySQL" mandatory='True'>
|
<variable name='ifMariaDBLimit' type='string' description="Interface pour les connexions distantes au serveur MySQL" mandatory='True'>
|
||||||
<value>auto</value>
|
<value>auto</value>
|
||||||
</variable>
|
</variable>
|
||||||
|
|
||||||
<variable name="dbCreateFixAdmin" type='oui/non' description="Créer des comptes admin MySQL avec un mot de passe fixe"/>
|
<variable name="dbCreateFixAdmin" type='oui/non' description="Créer des comptes admin MySQL avec un mot de passe fixe"/>
|
||||||
<variable name="accName" type='string' description="Nom du compte" multi="True"/>
|
<variable name="accName" type='string' description="Nom du compte" multi="True"/>
|
||||||
<variable name="accLimits" type='string' description="Limiter les accès des comptes">
|
<variable name="accLimits" type='string' description="Limiter les accès des comptes">
|
||||||
<value>Default</value>
|
<value>Default</value>
|
||||||
</variable>
|
</variable>
|
||||||
<variable name="accLimitTarget" type="string" description="Restriction d'accès à ces IP/noms d'hôtes (liste séparateur séparateur ',')" />
|
<variable name="accLimitTarget" type="string" description="Restriction d'accès à ces IP/noms d'hôtes (liste séparateur séparateur ',')" />
|
||||||
<variable name="create_db" type='oui/non' description="Créer des bases de données">
|
|
||||||
<value>non</value>
|
|
||||||
</variable>
|
|
||||||
</family>
|
|
||||||
<family name="MariaDB Databases">
|
|
||||||
<variable name="db_name" type='string' description='Nom de la base de donnée' multi="True"/>
|
|
||||||
<variable name="db_admin_user" type='string' description="Nom de l'utilisateur gestionnaire de la base de données"/>
|
|
||||||
</family>
|
|
||||||
|
|
||||||
<!-- Tunning -->
|
<variable name="dbClusterGcacheSizeMb" type="number" description="FIXME Gcachesize">
|
||||||
<family name="MariaDB Tunning" mode="expert" icon='mysql-alt'>
|
<value>128</value>
|
||||||
<variable name="dbInnoDBBufferPoolPercentage" type="number" description="Pourcentage de mémoire à dédier à MariaDB">
|
</variable>
|
||||||
<value>20</value>
|
</family>
|
||||||
</variable>
|
|
||||||
<variable name="dbInnoDBLogBufferSize" type='number' description="Taille du tampon utilisé pour écrire les fichiers de transaction innodb sur le disque (en Mo)">
|
|
||||||
<value>8</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='dbInnoDBLogFileSize' type='number' description="Taille des fichiers de transaction InnoDB">
|
|
||||||
<value>6</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='dbInnoDBLockWaitTimeout' type='number' description="Nombre de millisecondes d'attente avant de fermer la connection en lock (innodb_lock_wait_timeout)">
|
|
||||||
<value>120</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbMaxConnections" type="number" description="Nombre de connection maximum pour le serveur de bases de données (max_connections)">
|
|
||||||
<value>100</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbThreadCacheSize" type="number" description="Nombre de threads mis en cache par le serveur MariaDB">
|
|
||||||
<value>16</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbCacheQueryEnable" type="oui/non" description="Activer la mise en cache des requêtes">
|
|
||||||
<value>non</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbQueryCacheLimit" type="string" description="Taille maximum des résultats de requêtes à mettre en cache">
|
|
||||||
<value>900K</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbQueryCacheMinRestUnit" type="string" description="Taille des blocks du cache des requêtes">
|
|
||||||
<value>2K</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbQueryCacheSize" type="string" description="Taille maximum du cache des requêtes">
|
|
||||||
<value>80M</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbTmpTableSize" type="string" description="Taille maximum des tables internes stockées en mémoire">
|
|
||||||
<value>64M</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbEnableSlowQueryLogs" type="oui/non" description="Journaliser les requêtes lentes (Slow Query)">
|
|
||||||
<value>non</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbSlowQueryLogFile" type="string" description="Fichier de journalisation des requêtes lentes">
|
|
||||||
<value>/var/log/mysql/slow-query.log</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbSlowQueryLogTime" type="number" description="Durée à partir de laquelle une requête est considérée comme lente (en secondes)">
|
|
||||||
<value>1</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbWaitTimeout" type="number" description="Durée maximum d'inactivité d'une session (en secondes)">
|
|
||||||
<value>20</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbAutoOptimizeAndRepare" type="oui/non" description="Activer l'autoréparation et optimisation de toutes les bases de données">
|
|
||||||
<value>non</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="dbMaxAllowedPacket" type='number' description="Taille maximum d'un paquet (en Mo)">
|
|
||||||
<value>32</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='dbInteractiveTimeout' type='number' description="Nombre de secondes d'attente avant de fermer la connection en mode interactif">
|
|
||||||
<value>28800</value>
|
|
||||||
</variable>
|
|
||||||
</family>
|
|
||||||
|
|
||||||
<family name="Grappe MariaDB" icon='mysql-alt'>
|
<!-- Tunning -->
|
||||||
<variable name='dbClusterPosition' type='string' description="Rôle dans la grappe" mandatory='True'/>
|
<family name="DataBase Tunning" mode="expert">
|
||||||
<variable name='dbClusterName' type='string' description='Nom de la grappe'>
|
<variable name="dbInnoDBBufferPoolPercentage" type="number" description="Pourcentage de mémoire à dédier à MariaDB">
|
||||||
<value>galera_cluster</value>
|
<value>20</value>
|
||||||
</variable>
|
</variable>
|
||||||
<variable name='ifDBCluster' type='string' description="Interface réseau dédiée à la grappe BDD" mandatory='True'/>
|
<variable name="dbMaxConnections" type="number" description="Nombre de connection maximum pour le serveur de bases de données (max_connections)">
|
||||||
<variable name='dbClusterMember' type='domain' description="Nom de domaine des membres de la grappe" multi="True" mandatory='True'/>
|
<value>100</value>
|
||||||
<variable name="dbClusterMemberIndex" description="Index du serveur dans la liste des membres de la grappe" type="number" mandatory="True"/>
|
</variable>
|
||||||
<!-- Expert Variables -->
|
<variable name="dbThreadCacheSize" type="number" description="Nombre de threads mis en cache par le serveur MariaDB">
|
||||||
<variable name='dbBinLogFormat' type='string' mode='expert' description='Format du binlog'>
|
<value>16</value>
|
||||||
<value>ROW</value>
|
</variable>
|
||||||
</variable>
|
<variable name="dbCacheQueryEnable" type="oui/non" description="Activer la mise en cache des requêtes">
|
||||||
<variable name='dbDefaultStorage' type='string' mode='expert' description='Default storage engine'>
|
<value>non</value>
|
||||||
<value>innodb</value>
|
</variable>
|
||||||
</variable>
|
<variable name="dbQueryCacheLimit" type="string" description="Taille maximum des résultats de requêtes à mettre en cache">
|
||||||
<variable name='dbSSTMethod' type='string' mode='expert' description='Méthode SST'>
|
<value>900K</value>
|
||||||
<value>rsync</value>
|
</variable>
|
||||||
</variable>
|
<variable name="dbQueryCacheMinRestUnit" type="string" description="Taille des blocks du cache des requêtes">
|
||||||
<variable name='dbClusterGcacheSizeMb' type='number' mode='expert' description="Write-set Cache Size (gcache.size)">
|
<value>2K</value>
|
||||||
<value>128</value>
|
</variable>
|
||||||
</variable>
|
<variable name="dbQueryCacheSize" type="string" description="Taille maximum du cache des requêtes">
|
||||||
<!-- End -->
|
<value>80M</value>
|
||||||
</family>
|
</variable>
|
||||||
<separators>
|
<variable name="dbTmpTableSize" type="string" description="Taille maximum des tables internes stockées en mémoire">
|
||||||
<separator name='dbCreateFixAdmin'>Comptes d'administration supplémentaires</separator>
|
<value>64M</value>
|
||||||
<separator name='create_db'>Ajouter des bases de données</separator>
|
</variable>
|
||||||
</separators>
|
<variable name="dbEnableSlowQueryLogs" type="oui/non" description="Journaliser les requêtes lentes (Slow Query)">
|
||||||
</variables>
|
<value>non</value>
|
||||||
<constraints>
|
</variable>
|
||||||
<check name="valid_ipnetmask" target="maskMariaDBLimit" level="warning">
|
<variable name="dbSlowQueryLogFile" type="string" description="Fichier de journalisation des requêtes lentes">
|
||||||
<param type='eole'>ipMariaDBLimit</param>
|
<value>/var/log/mysql/slow-query.log</value>
|
||||||
</check>
|
</variable>
|
||||||
|
<variable name="dbSlowQueryLogTime" type="number" description="Durée à partir de laquelle une requête est considérée comme lente (en secondes)">
|
||||||
|
<value>1</value>
|
||||||
|
</variable>
|
||||||
|
<variable name="dbWaitTimeout" type="number" description="Durée maximum d'inactivité d'une session (en secondes)">
|
||||||
|
<value>20</value>
|
||||||
|
</variable>
|
||||||
|
<variable name="dbAutoOptimizeAndRepare" type="oui/non" description="Activer l'autoréparation et optimisation de toutes les bases de données">
|
||||||
|
<value>non</value>
|
||||||
|
</variable>
|
||||||
|
</family>
|
||||||
|
|
||||||
<check name='valid_enum' target='dbBinLogFormat'>
|
<family name="Database Cluster">
|
||||||
<param>['ROW', 'STATEMENT', 'MIXED', 'NONE']</param>
|
<variable name='ifDBCluster' type='string' description="Interface réseau dédiée à la grappe BDD"/>
|
||||||
</check>
|
|
||||||
<check name='valid_enum' target='ifDBCluster'>
|
|
||||||
<param>['eth0', 'eth1', 'eth2', 'eth3', 'eth4']</param>
|
|
||||||
</check>
|
|
||||||
|
|
||||||
<check name='valid_enum' target='accLimits'>
|
<!-- FIXME : Fill this variable with nom_machine -->
|
||||||
<param>['Default','Custom']</param>
|
<variable name='nodeName' type='string' description="Nom du noeud local"/>
|
||||||
</check>
|
|
||||||
|
|
||||||
<check name='valid_enum' target='dbClusterPosition'>
|
<variable name='dbClusterMember' type='string' description="Membre de la grappe BDD" multi='True'/>
|
||||||
<param>['Leader','Node']</param>
|
<variable name='dbClusterMemberIP' type='ip' description="Adresse IP"/>
|
||||||
</check>
|
<!-- Expert Variables -->
|
||||||
|
<variable name='dbClusterName' type='string' description='Nom de la grappe'>
|
||||||
|
<value>galera_cluster</value>
|
||||||
|
</variable>
|
||||||
|
<variable name='dbBinLogFormat' type='string' mode='expert' description='Format du binlog'>
|
||||||
|
<value>ROW</value>
|
||||||
|
</variable>
|
||||||
|
<variable name='dbDefaultStorage' type='string' mode='expert' description='Default storage engine'>
|
||||||
|
<value>innodb</value>
|
||||||
|
</variable>
|
||||||
|
<variable name='dbSSTMethod' type='string' mode='expert' description='Méthode SST'>
|
||||||
|
<value>rsync</value>
|
||||||
|
</variable>
|
||||||
|
<variable name='dbClusterGcacheSize' type='number' mode='expert' description="Write-set Cache Size (gcache.size)">
|
||||||
|
<value>128</value>
|
||||||
|
</variable>
|
||||||
|
<!-- End -->
|
||||||
|
</family>
|
||||||
|
<separators>
|
||||||
|
<separator name='dbCreateFixAdmin'>Comptes d'administration supplémentaires</separator>
|
||||||
|
</separators>
|
||||||
|
</variables>
|
||||||
|
<constraints>
|
||||||
|
<check name='valid_enum' target='ifDBCluster'>
|
||||||
|
<param>['eth0', 'eth1', 'eth2', 'eth3', 'eth4']</param>
|
||||||
|
</check>
|
||||||
|
|
||||||
<group master='accName'>
|
<group master='dbClusterMember'>
|
||||||
<slave>accLimits</slave>
|
<slave>dbClusterMemberIP</slave>
|
||||||
<slave>accLimitTarget</slave>
|
</group>
|
||||||
</group>
|
|
||||||
|
|
||||||
<group master='ipMariaDBLimit'>
|
<check name='valid_enum' target='accLimits'>
|
||||||
<slave>maskMariaDBLimit</slave>
|
<param>['Default','Custom']</param>
|
||||||
<slave>ifMariaDBLimit</slave>
|
</check>
|
||||||
</group>
|
|
||||||
|
|
||||||
<group master='db_name'>
|
<group master='accName'>
|
||||||
<slave>db_admin_user</slave>
|
<slave>accLimits</slave>
|
||||||
</group>
|
<slave>accLimitTarget</slave>
|
||||||
|
</group>
|
||||||
|
|
||||||
<fill name='calc_multi_condition' target='accLimitTarget'>
|
<group master='ipMariaDBLimit'>
|
||||||
<param>Default</param>
|
<slave>maskMariaDBLimit</slave>
|
||||||
<param type='eole' name='condition_1'>accLimits</param>
|
<slave>ifMariaDBLimit</slave>
|
||||||
<param name='default_match'>Default</param>
|
</group>
|
||||||
<param name='mismatch'>""</param>
|
|
||||||
</fill>
|
|
||||||
|
|
||||||
<condition name='disabled_if_in' source="dbEnable">
|
<fill name='calc_multi_condition' target='accLimitTarget'>
|
||||||
<param>non</param>
|
<param>Default</param>
|
||||||
<target type='family'>MariaDB</target>
|
<param type='eole' name='condition_1'>accLimits</param>
|
||||||
<!--target type='family'>Grappe MariaDB</target-->
|
<param name='default_match'>Default</param>
|
||||||
<target type='family'>MariaDB Tunning</target>
|
<param name='mismatch'>""</param>
|
||||||
<target type='filelist'>dbTunning</target>
|
</fill>
|
||||||
<target type='filelist'>dbMariaDB</target>
|
|
||||||
<!--target type='filelist'>dbCluster</target-->
|
|
||||||
<target type='servicelist'>bdd</target>
|
|
||||||
</condition>
|
|
||||||
|
|
||||||
<condition name='disabled_if_in' source='create_db'>
|
<condition name='disabled_if_in' source="dbCreateFixAdmin">
|
||||||
<param>non</param>
|
<param>non</param>
|
||||||
<target type='family'>MariaDB Databases</target>
|
<target type='variable'>accName</target>
|
||||||
</condition>
|
<target type='variable'>accLimits</target>
|
||||||
|
<target type='variable'>accLimitTarget</target>
|
||||||
|
</condition>
|
||||||
|
|
||||||
<condition name='disabled_if_in' source="dbCreateFixAdmin">
|
<condition name='disabled_if_in' source="dbEnableCluster">
|
||||||
<param>non</param>
|
<param>non</param>
|
||||||
<target type='variable'>accName</target>
|
<target type='family'>Database Cluster</target>
|
||||||
<target type='variable'>accLimits</target>
|
<target type='service_accesslist'>dbCluster</target>
|
||||||
<target type='variable'>accLimitTarget</target>
|
<target type='filelist'>dbCluster</target>
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<condition name='disabled_if_in' source="dbEnableCluster">
|
<condition name='disabled_if_in' source="dbEnable">
|
||||||
<param>non</param>
|
<param>non</param>
|
||||||
<target type='family'>Grappe MariaDB</target>
|
<target type='family'>Database Cluster</target>
|
||||||
<target type='service_accesslist'>dbCluster</target>
|
<target type='family'>Database</target>
|
||||||
<target type='filelist'>dbCluster</target>
|
<target type='service_accesslist'>dbCluster</target>
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<condition name='disabled_if_in' source="dbCacheQueryEnable">
|
<condition name='disabled_if_in' source="dbCacheQueryEnable">
|
||||||
<param>non</param>
|
<param>non</param>
|
||||||
<target type='variable'>dbQueryCacheLimit</target>
|
<target type='variable'>dbQueryCacheLimit</target>
|
||||||
<target type='variable'>dbQueryCacheMinRestUnit</target>
|
<target type='variable'>dbQueryCacheMinRestUnit</target>
|
||||||
<target type='variable'>dbQueryCacheSize</target>
|
<target type='variable'>dbQueryCacheSize</target>
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<condition name='disabled_if_in' source="dbEnableSlowQueryLogs">
|
<condition name='disabled_if_in' source="dbEnableSlowQueryLogs">
|
||||||
<param>non</param>
|
<param>non</param>
|
||||||
<target type='variable'>dbSlowQueryLogTime</target>
|
<target type='variable'>dbSlowQueryLogTime</target>
|
||||||
<target type='variable'>dbSlowQueryLogFile</target>
|
<target type='variable'>dbSlowQueryLogFile</target>
|
||||||
</condition>
|
</condition>
|
||||||
</constraints>
|
</constraints>
|
||||||
<help/>
|
<help/>
|
||||||
</creole>
|
</creole>
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
creolefuncs_DATA_DIR := $(DESTDIR)/usr/share/creole/funcs
|
creolefuncs_DATA_DIR := $(DESTDIR)/usr/share/creole/funcs
|
||||||
schedule_extra_DATA_DIR := $(DESTDIR)/usr/share/eole/creole/extra/schedule/
|
|
||||||
schedule_config_DATA_DIR := $(DESTDIR)/usr/share/eole/schedule/
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/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
|
|
|
@ -2,12 +2,6 @@
|
||||||
|
|
||||||
todo=$(CreoleGet dbCreateFixAdmin 'non')
|
todo=$(CreoleGet dbCreateFixAdmin 'non')
|
||||||
autoRepair=$(CreoleGet dbAutoOptimizeAndRepare 'non')
|
autoRepair=$(CreoleGet dbAutoOptimizeAndRepare 'non')
|
||||||
role=$(CreoleGet dbClusterPosition 'Leader')
|
|
||||||
|
|
||||||
if [[ ${role} == 'Node' ]]
|
|
||||||
then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${todo} != 'non' ]]
|
if [[ ${todo} != 'non' ]]
|
||||||
then
|
then
|
||||||
|
@ -19,17 +13,13 @@ then
|
||||||
tempFile=$(mktemp -p /root)
|
tempFile=$(mktemp -p /root)
|
||||||
sqlFile=$(mktemp -p /root)
|
sqlFile=$(mktemp -p /root)
|
||||||
|
|
||||||
password=$(pwgen -1 10)
|
|
||||||
/usr/share/eole/sbin/mariadbPwd ${password}
|
|
||||||
|
|
||||||
accounts=($(CreoleGet accName))
|
accounts=($(CreoleGet accName))
|
||||||
limits="$(CreoleGet accLimitTarget '')"
|
limits="$(CreoleGet accLimitTarget '')"
|
||||||
accLimits=(${limits// /})
|
accLimits=(${limits// /})
|
||||||
|
index=0
|
||||||
|
|
||||||
previousUsers=($(awk -F ':' '{print $1}' ${readerfile} ))
|
previousUsers=($(awk -F ':' '{print $1}' ${readerfile} ))
|
||||||
|
|
||||||
index=0
|
|
||||||
|
|
||||||
for user in ${accounts[@]}
|
for user in ${accounts[@]}
|
||||||
do
|
do
|
||||||
PASS=$(awk -F ':' "/${user}:/ {print \$2}" ${readerfile})
|
PASS=$(awk -F ':' "/${user}:/ {print \$2}" ${readerfile})
|
||||||
|
@ -41,21 +31,15 @@ then
|
||||||
then
|
then
|
||||||
hostsList+=(${accLimits[${index}]//,/ })
|
hostsList+=(${accLimits[${index}]//,/ })
|
||||||
else
|
else
|
||||||
ipAddr=($(CreoleGet ipMariaDBLimit))
|
ipAddr=($(CreoleGet ip_my_dist))
|
||||||
ipMask=($(CreoleGet maskMariaDBLimit))
|
ipMask=($(CreoleGet mask_my_dist))
|
||||||
ix=0
|
if [[ ${ipMask} == "255.255.255.255" ]]
|
||||||
for ip in ${ipAddr[@]}
|
then
|
||||||
do
|
hostsList+=("${ipAddr}")
|
||||||
if [[ ${ipMask[${ix}]} == "255.255.255.255" ]]
|
else
|
||||||
then
|
hostsList+=("${ipAddr}/${ipMask}")
|
||||||
hostsList+=("${ip}")
|
fi
|
||||||
else
|
|
||||||
hostsList+=("${ip}/${ipMask[${ix}]}")
|
|
||||||
fi
|
|
||||||
ix=$((ix+1))
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for hst in ${hostsList[@]}
|
for hst in ${hostsList[@]}
|
||||||
do
|
do
|
||||||
SQL="DROP USER IF EXISTS '${user}'@'${hst}';"
|
SQL="DROP USER IF EXISTS '${user}'@'${hst}';"
|
||||||
|
@ -71,7 +55,7 @@ then
|
||||||
index=$((index+1))
|
index=$((index+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
mysql -u root --password=${password} < ${sqlFile}
|
mysql < ${sqlFile}
|
||||||
|
|
||||||
mv ${tempFile} ${readerfile}
|
mv ${tempFile} ${readerfile}
|
||||||
chmod 600 ${readerfile}
|
chmod 600 ${readerfile}
|
||||||
|
@ -80,10 +64,8 @@ fi
|
||||||
|
|
||||||
if [[ ${autoRepair} == "oui" ]]
|
if [[ ${autoRepair} == "oui" ]]
|
||||||
then
|
then
|
||||||
|
mysqlcheck -u root --auto-repair --check --optimize --all-databases
|
||||||
mysqlcheck -u root -p ${password} --auto-repair --check --all-databases
|
|
||||||
mysqlcheck -u root -p ${password} --optimize --check --all-databases
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Initialize root password
|
|
||||||
# and secure MariaDB installation
|
|
||||||
#
|
|
||||||
|
|
||||||
INITDONE="/etc/eole/.galera"
|
|
||||||
|
|
||||||
[[ "$(CreoleGet dbEnable)" == "non" ]] && exit 0
|
|
||||||
[[ -e ${INITDONE} ]] && exit 0
|
|
||||||
|
|
||||||
ROLE=$(CreoleGet dbClusterPosition 'Leader')
|
|
||||||
SECURE_CMD="mysql_secure_installation"
|
|
||||||
PASSWORD=$(pwgen -1 10)
|
|
||||||
passwd="/usr/share/eole/sbin/mariadbPwd"
|
|
||||||
logdir="/var/log/eole"
|
|
||||||
logfile="${logdir}/maria-init.log"
|
|
||||||
|
|
||||||
[[ ! -d "${logdir}" ]] && mkdir -p ${logdir}
|
|
||||||
|
|
||||||
if [[ ${ROLE} == "Leader" ]]
|
|
||||||
then
|
|
||||||
service mysql start
|
|
||||||
${passwd} ${PASSWORD}
|
|
||||||
|
|
||||||
# Run secure installation script
|
|
||||||
${SECURE_CMD} > ${logfile} 2>&1 <<__EOF__
|
|
||||||
${PASSWORD}
|
|
||||||
y
|
|
||||||
n
|
|
||||||
y
|
|
||||||
y
|
|
||||||
y
|
|
||||||
y
|
|
||||||
__EOF__
|
|
||||||
if [[ ${?} -eq 0 ]]
|
|
||||||
then
|
|
||||||
service mysql stop
|
|
||||||
touch ${INITDONE}
|
|
||||||
exit ${?}
|
|
||||||
else
|
|
||||||
service mysql stop
|
|
||||||
exit ${?}
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
|
@ -1,19 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<creole>
|
|
||||||
<variables>
|
|
||||||
<family name="mariadb" description="Exportation des bases de données MariaDB">
|
|
||||||
<variable name="description" type="string" hidden="True"><value>Exportation des bases MariaDB</value></variable>
|
|
||||||
<variable name="day" type="schedule" description="Périodicité d'exécution"><value>daily</value></variable>
|
|
||||||
<variable name="mode" type="schedulemod" hidden="True"><value>pre</value></variable>
|
|
||||||
</family>
|
|
||||||
</variables>
|
|
||||||
<constraints>
|
|
||||||
<fill name='calc_multi_condition' target='schedule.mariadb.day'>
|
|
||||||
<param>non</param>
|
|
||||||
<param type='eole' name='condition_1'>dbEnableBackup</param>
|
|
||||||
<param name='match'>none</param>
|
|
||||||
<param name='mismatch'>daily</param>
|
|
||||||
</fill>
|
|
||||||
</constraints>
|
|
||||||
</creole>
|
|
|
@ -1,19 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
DESC="Exportation des bases MariaDB"
|
|
||||||
|
|
||||||
. /usr/share/eole/schedule/config.sh
|
|
||||||
|
|
||||||
MYSQLSAVDIR=$SAVDIR/sql
|
|
||||||
OPTION="--lock-tables"
|
|
||||||
|
|
||||||
if [[ -d ${MYSQLSAVDIR} ]]
|
|
||||||
then
|
|
||||||
rm -rf ${MYSQLSAVDIR}
|
|
||||||
mkdir -p ${MYSQLSAVDIR}
|
|
||||||
fi
|
|
||||||
|
|
||||||
mariabackup --defaults-file=/etc/mysql/debian.cnf --backup --target-dir=$MYSQLSAVDIR
|
|
||||||
exit $?
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Renew MariaDB root password
|
|
||||||
# Just like old (mysql_pwd.py)
|
|
||||||
#
|
|
||||||
cmd="mysql"
|
|
||||||
options='--defaults-file=/etc/mysql/debian.cnf'
|
|
||||||
|
|
||||||
role=$(CreoleGet dbClusterPosition 'Leader')
|
|
||||||
|
|
||||||
if [[ ${role} == "Leader" ]]
|
|
||||||
then
|
|
||||||
if [[ -z ${1} ]]
|
|
||||||
then
|
|
||||||
read -s -p "New Password : " password
|
|
||||||
echo
|
|
||||||
else
|
|
||||||
password="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
sql="FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '${password}';"
|
|
||||||
|
|
||||||
${cmd} ${options} -e "${sql}"
|
|
||||||
exit $?
|
|
||||||
else
|
|
||||||
echo "This command don't work in a MariaDB Cluster Node, try in the Leader"
|
|
||||||
exit 3
|
|
||||||
fi
|
|
|
@ -8,7 +8,12 @@ wsrep_on=ON
|
||||||
wsrep_provider=/usr/lib/galera/libgalera_smm.so
|
wsrep_provider=/usr/lib/galera/libgalera_smm.so
|
||||||
# Galera Cluster Configuration
|
# Galera Cluster Configuration
|
||||||
wsrep_cluster_name="%%dbClusterName"
|
wsrep_cluster_name="%%dbClusterName"
|
||||||
wsrep_cluster_address="gcomm://%%custom_join(%%dbClusterMember, ',')"
|
%set %%nodeIP = %%getVar('adresse_ip_' + %%ifDBCluster, '')
|
||||||
|
wsrep_cluster_address="gcomm://%%nodeIP%slurp
|
||||||
|
%for %%node in %%dbClusterMember
|
||||||
|
,%%node.dbClusterMemberIP%slurp
|
||||||
|
%end for
|
||||||
|
"
|
||||||
|
|
||||||
# Tunning
|
# Tunning
|
||||||
wsrep_provider_options="gcache.size=%%dbClusterGcacheSizeMb"
|
wsrep_provider_options="gcache.size=%%dbClusterGcacheSizeMb"
|
||||||
|
@ -17,5 +22,5 @@ wsrep_provider_options="gcache.size=%%dbClusterGcacheSizeMb"
|
||||||
wsrep_sst_method=%%dbSSTMethod
|
wsrep_sst_method=%%dbSSTMethod
|
||||||
|
|
||||||
# Galera Node Configuration
|
# Galera Node Configuration
|
||||||
wsrep_node_address="%%getVar('adresse_ip_' + %%ifDBCluster)"
|
wsrep_node_address="%%nodeIP"
|
||||||
wsrep_node_name="%%dbClusterMember[%%dbClusterMemberIndex]
|
wsrep_node_name="%%nodeName"
|
|
@ -1,21 +0,0 @@
|
||||||
# MariaDB-specific config file.
|
|
||||||
# Read by /etc/mysql/my.cnf
|
|
||||||
|
|
||||||
[client]
|
|
||||||
# Default is Latin1, if you need UTF-8 set this (also in server section)
|
|
||||||
#default-character-set = utf8
|
|
||||||
|
|
||||||
[mysqld]
|
|
||||||
#
|
|
||||||
# * Character sets
|
|
||||||
#
|
|
||||||
# Default is Latin1, if you need UTF-8 set all this (also in client section)
|
|
||||||
#
|
|
||||||
#character-set-server = utf8
|
|
||||||
#collation-server = utf8_general_ci
|
|
||||||
#character_set_server = utf8
|
|
||||||
#collation_server = utf8_general_ci
|
|
||||||
# Import all .cnf files from configuration directory
|
|
||||||
plugin-load-add = auth_socket.so
|
|
||||||
!includedir /etc/mysql/mariadb.conf.d/
|
|
||||||
|
|
|
@ -3,29 +3,18 @@ innodb_file_per_table=1
|
||||||
skip-name-resolve
|
skip-name-resolve
|
||||||
|
|
||||||
innodb_buffer_pool_size=%%getMemoryPercentage(%%getVar('dbInnoDBBufferPoolPercentage', 10))
|
innodb_buffer_pool_size=%%getMemoryPercentage(%%getVar('dbInnoDBBufferPoolPercentage', 10))
|
||||||
innodb_log_buffer_size=%%{dbInnoDBLogBufferSize}M
|
|
||||||
innodb_log_file_size=%%{dbInnoDBLogFileSize}M
|
|
||||||
innodb_lock_wait_timeout=%%{dbInnoDBLockWaitTimeout}
|
|
||||||
|
|
||||||
max_connections=%%dbMaxConnections
|
max_connections=%%dbMaxConnections
|
||||||
thread_cache_size=%%dbThreadCacheSize
|
thread_cache_size=%%dbThreadCacheSize
|
||||||
|
|
||||||
%if %%dbCacheQueryEnable == 'oui'
|
%if %%dbCacheQueryEnable == 'oui'
|
||||||
query_cache_type = 1
|
query_cache_type = 1
|
||||||
query_cache_limit = %%getVar('dbQueryCacheLimit')
|
query_cache_limit = %%getVar('dbQueryCacheLimit')
|
||||||
query_cache_min_res_unit = %%getVar('dbQueryCacheMinRestUnit')
|
query_cache_min_res_unit = %%getVar('dbQueryCacheMinResUint')
|
||||||
query_cache_size = %%getVar('dbQueryCacheSize')
|
query_cache_size = %%getVar('dbQueryCacheSize')
|
||||||
%else
|
|
||||||
query_cache_type = 0
|
|
||||||
query_cache_size = 0
|
|
||||||
%end if
|
%end if
|
||||||
|
|
||||||
tmp_table_size = %%dbTmpTableSize
|
tmp_table_size = %%dbTmpTableSize
|
||||||
max_heap_table_size = %%dbTmpTableSize
|
max_heap_table_size = %%dbTmpTableSize
|
||||||
max_allowed_packet = %%{dbMaxAllowedPacket}M
|
|
||||||
|
|
||||||
wait_timeout = %%dbWaitTimeout
|
|
||||||
interactive_timeout = %%{dbInteractiveTimeout}
|
|
||||||
|
|
||||||
%if %%dbEnableSlowQueryLogs == "oui"
|
%if %%dbEnableSlowQueryLogs == "oui"
|
||||||
slow-query-log = 1
|
slow-query-log = 1
|
||||||
|
@ -33,4 +22,5 @@ slow-query-log-file = %%getVar('dbSlowQueryLogFile')
|
||||||
long_query_time = %%getVar('dbSlowQueryLogTime')
|
long_query_time = %%getVar('dbSlowQueryLogTime')
|
||||||
%end if
|
%end if
|
||||||
|
|
||||||
|
wait_timeout = %%dbWaitTimeout
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue