-
Notifications
You must be signed in to change notification settings - Fork 6
/
galera.yml
61 lines (58 loc) · 1.31 KB
/
galera.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
stack: jussi/galera
version: 0.1.0
expose: mariadb-lb
variables:
mariadb_affinity:
type: string
default: label!=no-mariadb
from:
env: MARIADB_AFFINITY
prompt: Affinity rule for MariaDB Galera
mysql_root_pwd:
type: string
from:
vault: ${STACK}-mysql-pwd
random_string: 24
to:
vault: ${STACK}-mysql-pwd
mysql_xtrabackup_pwd:
type: string
from:
vault: ${STACK}-xtrabackup-pwd
random_string: 24
to:
vault: ${STACK}-xtrabackup-pwd
services:
mariadb-lb:
image: kontena/lb:latest
instances: 2
mem_limit: 128m
affinity:
- "{{ mariadb_affinity }}"
mariadb-galera:
image: severalnines/mariadb:latest
instances: 3
affinity:
- "{{ mariadb_affinity }}"
deploy:
wait_for_port: 3306
secrets:
- secret: ${STACK}-mysql-pwd
name: MYSQL_ROOT_PASSWORD
type: env
- secret: ${STACK}-xtrabackup-pwd
name: XTRABACKUP_PASSWORD
type: env
environment:
DISCOVERY_SERVICE: etcd.kontena.local:2379
CLUSTER_NAME: "${STACK}"
KONTENA_LB_MODE: tcp
KONTENA_LB_INTERNAL_PORT: 3306
KONTENA_LB_EXTERNAL_PORT: 3306
links:
- mariadb-lb
volumes:
- galera-data:/var/lib/mysql
volumes:
galera-data: # scope=instance
external: true