simplification + nom de domaine plutot que IP

This commit is contained in:
Emmanuel Garette 2019-02-19 16:37:00 +01:00
parent be45f4e3fa
commit 5817d9aee4
2 changed files with 25 additions and 33 deletions

View File

@ -28,13 +28,13 @@
<variables>
<family name="Services">
<variable name="dbEnable" type='oui/non' description='Activer le serveur de base de données MariaDB'>
<value>non</value>
<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>
</variable>
</family>
<family name="Database">
<family name="MariaDB" icon='mysql-alt'>
<variable name='dbEnableCluster' type='oui/non' description="Activer la mise en grappe MariaDB Galera ?">
<value>non</value>
</variable>
@ -51,13 +51,10 @@
</variable>
<variable name="accLimitTarget" type="string" description="Restriction d'accès à ces IP/noms d'hôtes (liste séparateur séparateur ',')" />
<variable name="dbClusterGcacheSizeMb" type="number" description="FIXME Gcachesize">
<value>128</value>
</variable>
</family>
<!-- Tunning -->
<family name="Database Tunning" mode="expert">
<family name="MariaDB Tunning" mode="expert" icon='mysql-alt'>
<variable name="dbInnoDBBufferPoolPercentage" type="number" description="Pourcentage de mémoire à dédier à MariaDB">
<value>20</value>
</variable>
@ -114,18 +111,16 @@
</variable>
</family>
<family name="Database Cluster">
<family name="Grappe MariaDB" icon='mysql-alt'>
<variable name='dbClusterPosition' type='string' description="Rôle dans la grappe" mandatory='True'/>
<variable name='ifDBCluster' type='string' description="Interface réseau dédiée à la grappe BDD"/>
<!-- FIXME : Fill this variable with nom_machine -->
<variable name='nodeName' type='string' description="Nom du noeud local"/>
<variable name='dbClusterMember' type='string' description="Membre de la grappe BDD" multi='True'/>
<variable name='dbClusterMemberIP' type='ip' description="Adresse IP"/>
<!-- Expert Variables -->
<variable name='dbClusterName' type='string' description='Nom de la grappe'>
<value>galera_cluster</value>
</variable>
<variable name='ifDBCluster' type='string' description="Interface réseau dédiée à la grappe BDD"/>
<variable name='nodeName' type='domain' description="Nom de domaine du noeud"/>
<variable name='dbClusterMember' type='domain' description="Nom de domaine des membres de la grappe"/>
<!-- Expert Variables -->
<variable name='dbBinLogFormat' type='string' mode='expert' description='Format du binlog'>
<value>ROW</value>
</variable>
@ -135,7 +130,7 @@
<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)">
<variable name='dbClusterGcacheSizeMb' type='number' mode='expert' description="Write-set Cache Size (gcache.size)">
<value>128</value>
</variable>
<!-- End -->
@ -149,14 +144,13 @@
<param type='eole'>ipMariaDBLimit</param>
</check>
<check name='valid_enum' target='dbBinLogFormatr'>
<param>['ROW', 'STATEMENT', 'MIXED', 'NONE']</param>
</check>
<check name='valid_enum' target='ifDBCluster'>
<param>['eth0', 'eth1', 'eth2', 'eth3', 'eth4']</param>
</check>
<group master='dbClusterMember'>
<slave>dbClusterMemberIP</slave>
</group>
<check name='valid_enum' target='accLimits'>
<param>['Default','Custom']</param>
</check>
@ -175,6 +169,9 @@
<slave>ifMariaDBLimit</slave>
</group>
<fill name='calc_multi_condition' target='nodeName'>
<param type='eole'>nom_domaine_machine</param>
</fill>
<fill name='calc_multi_condition' target='accLimitTarget'>
<param>Default</param>
<param type='eole' name='condition_1'>accLimits</param>
@ -184,13 +181,13 @@
<condition name='disabled_if_in' source="dbEnable">
<param>non</param>
<target type='family'>Database</target>
<target type='family'>Database Cluster</target>
<target type='family'>Database Tunning</target>
<target type='service_accesslist'>dbCluster</target>
<target type='family'>MariaDB</target>
<!--target type='family'>Grappe MariaDB</target-->
<target type='family'>MariaDB Tunning</target>
<!--target type='service_accesslist'>dbCluster</target-->
<target type='filelist'>dbTunning</target>
<target type='filelist'>dbMariaDB</target>
<target type='filelist'>dbCluster</target>
<!--target type='filelist'>dbCluster</target-->
<target type='servicelist'>bdd</target>
</condition>
@ -203,7 +200,7 @@
<condition name='disabled_if_in' source="dbEnableCluster">
<param>non</param>
<target type='family'>Database Cluster</target>
<target type='family'>Grappe MariaDB</target>
<target type='service_accesslist'>dbCluster</target>
<target type='filelist'>dbCluster</target>
</condition>

View File

@ -8,12 +8,7 @@ wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
# Galera Cluster Configuration
wsrep_cluster_name="%%dbClusterName"
%set %%nodeIP = %%getVar('adresse_ip_' + %%ifDBCluster, '')
wsrep_cluster_address="gcomm://%%nodeIP%slurp
%for %%node in %%dbClusterMember
,%%node.dbClusterMemberIP%slurp
%end for
"
wsrep_cluster_address="gcomm://%%nodeName,%%custom_join(%%dbClusterMember, ',')"
# Tunning
wsrep_provider_options="gcache.size=%%dbClusterGcacheSizeMb"
@ -22,5 +17,5 @@ wsrep_provider_options="gcache.size=%%dbClusterGcacheSizeMb"
wsrep_sst_method=%%dbSSTMethod
# Galera Node Configuration
wsrep_node_address="%%nodeIP"
wsrep_node_name="%%nodeName"
wsrep_node_address="%%getVar('adresse_ip_' + %%ifDBCluster)"
wsrep_node_name="%%nodeName"