Création d'un docker.compose.yml qui instancie 3 serveurs MariaDB
On ajoute la configuration nécessaire pour que les serveurs puissent communiquer entre eux
# GALERA saved state
version: 2.1
uuid: 5981f182-a4cc-11e6-98cc-77fabedd360d
seqno: 1234
safe_to_bootstrap: 1
- configuration node 1
-
[mysqld] wsrep_node_address="node1.localhost" wsrep_node_name="node1" wsrep_cluster_address="gcomm://node1.localhost,node2.localhost,node3.localhost" wsrep_provider=/usr/lib/libgalera_smm.so binlog_format=ROW default_storage_engine=InnoDB innodb_autoinc_lock_mode=2 innodb_doublewrite=1 query_cache_size=0 wsrep_on=ON
- configuration node 2
-
[mysqld] wsrep_node_address="node1.localhost" wsrep_node_name="node2" wsrep_cluster_address="gcomm://node1.localhost,node2.localhost,node3.localhost" wsrep_provider=/usr/lib/libgalera_smm.so binlog_format=ROW default_storage_engine=InnoDB innodb_autoinc_lock_mode=2 innodb_doublewrite=1 query_cache_size=0 wsrep_on=ON
- configuration node 3
-
[mysqld] wsrep_node_address="node1.localhost" wsrep_node_name="node3" wsrep_cluster_address="gcomm://node1.localhost,node2.localhost,node3.localhost" wsrep_provider=/usr/lib/libgalera_smm.so binlog_format=ROW default_storage_engine=InnoDB innodb_autoinc_lock_mode=2 innodb_doublewrite=1 query_cache_size=0 wsrep_on=ON