-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmariadb-cluster-setup.yaml
88 lines (84 loc) · 2.14 KB
/
mariadb-cluster-setup.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
version: "3.8"
services:
db01:
image: ustcweizhou/mariadb-cluster:latest
hostname: db01
networks:
br-db:
ipv4_address: 172.16.10.11
volumes:
- /docker/db01:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "-uroot", "-pcloudstack", "ping"]
interval: 10s
timeout: 10s
retries: 60
start_period: 10s
environment:
- NODE_NAME=db01
- CLUSTER_ADDRESS=gcomm://db01,db02,db03
- DB_ROOT_PASSWORD=cloudstack
- DB_MARIABACKUP_PASSWORD=cloudstack
db02:
image: ustcweizhou/mariadb-cluster:latest
hostname: db02
depends_on:
db01:
condition: service_healthy
networks:
br-db:
ipv4_address: 172.16.10.12
volumes:
- /docker/db02:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "-uroot", "-pcloudstack", "ping"]
interval: 10s
timeout: 10s
retries: 60
start_period: 10s
environment:
- NODE_NAME=db02
- CLUSTER_ADDRESS=gcomm://db01,db02,db03
- DB_ROOT_PASSWORD=cloudstack
- DB_MARIABACKUP_PASSWORD=cloudstack
db03:
image: ustcweizhou/mariadb-cluster:latest
hostname: db03
depends_on:
db01:
condition: service_healthy
db02:
condition: service_healthy
networks:
br-db:
ipv4_address: 172.16.10.13
volumes:
- /docker/db03:/var/lib/mysql
environment:
- NODE_NAME=db03
- CLUSTER_ADDRESS=gcomm://db01,db02,db03
- DB_ROOT_PASSWORD=cloudstack
- DB_MARIABACKUP_PASSWORD=cloudstack
dbvip:
image: nginx
hostname: dbvip
networks:
br-db:
ipv4_address: 172.16.10.14
ports:
- "13306:3306"
volumes:
- ./nginx-galera.conf:/etc/nginx/nginx.conf
depends_on:
db01:
condition: service_healthy
networks:
br-db:
driver: bridge
driver_opts:
com.docker.network.bridge.name: "br-db"
ipam:
driver: default
config:
- subnet: 172.16.10.0/24
gateway: 172.16.10.254