Adding eole dictionnary

This commit is contained in:
Philippe Caseiro 2018-04-10 16:15:28 +02:00
parent 0fcf4678e5
commit 9ab3cffb63
2 changed files with 184 additions and 4 deletions

122
README.md
View File

@ -3,3 +3,125 @@
Début des travaux pour l'utilisation de mariadb
dans Eole avec des fonctionalitées avancées du type
mise en clustter
# How-to for Eole 2.6.2
## Sources
* https://mariadb.com/kb/en/library/getting-started-with-mariadb-galera-cluster/
* https://mariadb.com/kb/en/library/installing-mariadb-deb-files/#installing-mariadb-galera-cluster-with-apt-get
* https://downloads.mariadb.org/mariadb/repositories/#mirror=ovh&distro=Ubuntu&distro_release=xenial--ubuntu_xenial&version=10.2
* http://galeracluster.com/documentation-webpages/?id=galera_parameters_0.8
* https://mariadb.com/kb/en/library/mariadb-galera-cluster-known-limitations/
## Requirements
* 2 eolebase 2.6.2 servers
## Adding MariaDB (Galera) cluster repository (on each server)
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
## Installing MariaDB software on the First Node aka "Node1"
* Query-Auto
* apt install mariadb-server
### Secure MariaDB installation
* mysql_secure_installation
### Configure the Master
* vim /etc/mysql/conf.d/galera.cnf
```
[mysqld]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
# Galera Provider Configuration
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
# Galera Cluster Configuration
wsrep_cluster_name="eole_cluster"
wsrep_cluster_address="gcomm://<IP_NODE1>,<IP_NODE2>"
# Galera Synchronization Configuration
wsrep_sst_method=rsync
# Galera Node Configuration
wsrep_node_address="<IP_NODE1>"
wsrep_node_name="Node1"
```
### Open Firewall ports
* 3306/tcp
* 4444/tcp
* 4567/tcp
* 4568/tcp
* 4567/udp
### Bootstraping the new cluster
* systemctl stop mariadb
* galera_new_cluster
### Check cluster size
* mysql -u root -p -e "show status like 'wsrep_cluster_size'"
```
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 1 |
+--------------------+-------+
```
## Installing MariaDB software in the Second node aka "Node2"
* Query-Auto
* apt install mariadb-server
### Secure MariaDB installation
* mysql_secure_installation
### Configure the Master
* vim /etc/mysql/conf.d/galera.cnf
```
[mysqld]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
# Galera Provider Configuration
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
# Galera Cluster Configuration
wsrep_cluster_name="eole_cluster"
wsrep_cluster_address="gcomm://<IP_NODE1>,<IP_NODE2>"
# Galera Synchronization Configuration
wsrep_sst_method=rsync
# Galera Node Configuration
wsrep_node_address="<IP_NODE2>"
wsrep_node_name="Node2"
```
### Open Firewall ports
* 3306/tcp
* 4444/tcp
* 4567/tcp
* 4568/tcp
* 4567/udp
### Restart MariaDB
* systemctl restart mysql
### Check Cluster Size
* mysql -u root -p -e "show status like 'wsrep_cluster_size'"
```
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 2 |
+--------------------+-------+
```

View File

@ -1,7 +1,36 @@
<creole>
<files/>
<files>
<file filelist='dbCluster' name='/etc/mysql/conf.d/galera.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_restriction service='mariadb'>
<ip interface='ifMariaDBLimit' interface_type="SymLinkOption" netmask='maskMariaDBLimit' netmask_type='SymLinkOption' ip_type='SymLinkOption'>ipMariaDBLimit</ip>
</service_restriction>
<service_restriction service='galera'>
<ip interface='ifDBCluster' interface_type="SymLinkOption" netmask='maskDBCluster' netmask_type='SymLinkOption' ip_type='SymLinkOption'>ipDBCluster</ip>
</service_restriction>
</files>
<variables>
<family name="Services">
<variable namle="dbEnable" type='oui/non' description='Activer le serveur de base de données MariaDB'>
<value>non</non>
</variable>
</family>
<family name="DataBase">
<variable name='dbEnableClustter' type='oui/non' description="Activer la mise en grappe MariaDB Galera ?">
<value>non</value>
</variable>
<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="accLimits" type='string' description="Limiter les accès des comptes">
@ -9,30 +38,59 @@
</variable>
<variable name="accLimitTarget" type="string" description="Restriction d'accès à ces IP/noms d'hôtes (liste séparateur séparateur ',')" />
</family>
<family name="Database Cluster">
<variable name='ifDBCluster' type='string' description="Interface réseau dédiée à la grappe BDD"/>
<variable name='dbClusterMember' type='String' description="Membre de la grappe BDD"/>
<variable name='dbClusterMemberIP' type='ip' description="Adresse IP"/>
</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='dbClusterMember'>
<slave>dbClusterMemeberIP</slave>
</group>
<check name='valid_enum' target='accLimits'>
<param>['Default','Custom']</param>
</check>
<group master='accName'>
<slave>accLimits</slave>
<slave>accLimitTarget</slave>
</group>
<fill name='calc_multi_condition' target='accLimitTarget'>
<param>Default</param>
<param type='eole' name='condition_1'>accLimits</param>
<param name='default_match'>Default</param>
<param name='mismatch'>""</param>
</fill>
<condition name='disabled_if_in' source="dbCreateFixAdmin">
<param>non</param>
<target type='variable'>accName</target>
<target type='variable'>accLimits</target>
<target type='variable'>accLimitTarget</target>
</condition>
<condition name='disabled_if_in' source="dbEnableCluster">
<param>non</param>
<target type='family'>Database Cluster</target>
<target type='service_accesslist'>dbCluster</target>
</condition>
<condition name='disabled_if_in' source="dbEnable">
<param>non</param>
<target type='family'>Database Cluster</target>
<target type='family'>Database</target>
<target type='service_accesslist'>dbCluster</target>
</condition>
</constraints>
<help/>
</creole>