Go to file
2018-04-12 12:14:05 +02:00
creolefuncs Adding mariadb service management 2018-04-12 10:38:53 +02:00
dicos Run root password scripts only on Cluster Leaders 2018-04-12 12:14:05 +02:00
postservice Adding Tunning Options 2018-04-11 17:00:18 +02:00
posttemplate Adding Cluster bootstraping on first run. 2018-04-12 10:50:35 +02:00
pretemplate Run root password scripts only on Cluster Leaders 2018-04-12 12:14:05 +02:00
tmpl Ajout d'une variable manquante 2018-04-11 17:17:09 +02:00
apps.mk Adding project base 2018-04-10 14:21:22 +02:00
eole-mariadb.mk Adding eole-mariadb.mk to deploy creolefuncs 2018-04-11 17:11:16 +02:00
eole.mk Adding project base 2018-04-10 14:21:22 +02:00
LICENSE Initial commit 2018-04-10 14:15:57 +02:00
Makefile Adding project base 2018-04-10 14:21:22 +02:00
README.md Adding cluster configuration template 2018-04-10 16:31:41 +02:00

eole-mariadb

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 (using this repo dico and templates)

FIXME

How-to for Eole 2.6.2 (From scratch)

Sources

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     |
+--------------------+-------+