Skip to content

Instantly share code, notes, and snippets.

@fabiomontefuscolo
Forked from lucidfrontier45/galera_cluster.yml
Created November 8, 2016 20:57
Show Gist options
  • Save fabiomontefuscolo/e17658f25dc586c58913715d54fb8acc to your computer and use it in GitHub Desktop.
Save fabiomontefuscolo/e17658f25dc586c58913715d54fb8acc to your computer and use it in GitHub Desktop.
docker-compose file for mariadb galera cluster
version: '2'
services:
node1:
image: hauptmedia/mariadb:10.1
hostname: node1
environment:
- MYSQL_ROOT_PASSWORD=test
- REPLICATION_PASSWORD=test
- MYSQL_DATABASE=maria
- MYSQL_USER=maria
- MYSQL_PASSWORD=test
- GALERA=On
- NODE_NAME=node1
- CLUSTER_NAME=maria_cluster
- CLUSTER_ADDRESS=gcomm://node1,node2,node3,node4
command: --wsrep-new-cluster
networks:
- cluster
node2:
image: hauptmedia/mariadb:10.1
hostname: node2
environment:
- MYSQL_ROOT_PASSWORD=test
- REPLICATION_PASSWORD=test
- GALERA=On
- NODE_NAME=node2
- CLUSTER_NAME=maria_cluster
- CLUSTER_ADDRESS=gcomm://node1,node2,node3,node4
networks:
- cluster
node3:
image: hauptmedia/mariadb:10.1
hostname: node3
environment:
- MYSQL_ROOT_PASSWORD=test
- REPLICATION_PASSWORD=test
- GALERA=On
- NODE_NAME=node3
- CLUSTER_NAME=maria_cluster
- CLUSTER_ADDRESS=gcomm://node1,node2,node3,node4
networks:
- cluster
node4:
image: hauptmedia/mariadb:10.1
hostname: node4
environment:
- MYSQL_ROOT_PASSWORD=test
- REPLICATION_PASSWORD=test
- GALERA=On
- NODE_NAME=node4
- CLUSTER_NAME=maria_cluster
- CLUSTER_ADDRESS=gcomm://node1,node2,node3,node4
networks:
- cluster
networks:
cluster:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment