This repository contains scripts to create a Docker Swarm cluster of VirtualBox VMs and then start a Galera cluster of Docker containers running on the Swarm cluster.
The script create-cluster.sh will go through the following steps:
- Create the VMs, one to host the consul container which will act as the keystore for the Docker Swarm cluster, then some more as members of the cluster.
- Create an overlay network spanning all the Swarm cluster nodes so containers on one node can directly connect to others on other hosts.
- Create an initial Galera container which will act as an initial master for the Galera cluster.
- Create additional Galera containers and connect them to the growing Galera cluster.
.-----------------------------------------------.
| |
| .-------------..-------------..-------------. |
| | Galera Node || Galera Node || Galera Node | |
| '-------------''-------------''-------------' |
| .-------------..-------------..-------------. |
| | Galera Node || Galera Node || Galera Node | |
| '-------------''-------------''-------------' | Galera Cluster
| .-------------..-------------..-------------. | on overlay network
| | Galera Node || Galera Node || Galera Node | |
| '-------------''-------------''-------------' |
| |
'-----------------------------------------------'
.-----------------------------------------------.
| ________ ________ ________ ________ |
| |==|=====| |==|=====| |==|=====| |==|=====| |
| | | | | | | | | | | | | |
| | | VM | | | VM | | | VM | | | VM | |
| | | | | | | | | | | | | | Docker Swarm
| | | | | | | | | | | | | | Cluster
| | |====°| | |====°| | |====°| | |====°| |
| |__|_____| |__|_____| |__|_____| |__|_____| |
| |
'-----------------------------------------------'
How can you access to your galera cluster from the outside ? What would you configure to set a unique access point in your swarm cluster, to send some mysql requests to galera ? Is it possible without installing anything outside a docker context ?