-
Notifications
You must be signed in to change notification settings - Fork 7
/
mariadb-cluster-setup-macvlan.yaml
74 lines (71 loc) · 1.84 KB
/
mariadb-cluster-setup-macvlan.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
version: "3.8"
services:
db01:
image: ustcweizhou/mariadb-cluster:latest
hostname: db01
networks:
bridge-mgmt:
ipv4_address: 10.0.33.53
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:
bridge-mgmt:
ipv4_address: 10.0.35.200
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:
bridge-mgmt:
ipv4_address: 10.0.33.212
volumes:
- /docker/db03:/var/lib/mysql
environment:
- NODE_NAME=db03
- CLUSTER_ADDRESS=gcomm://db01,db02,db03
- DB_ROOT_PASSWORD=cloudstack
- DB_MARIABACKUP_PASSWORD=cloudstack
networks:
bridge-mgmt:
driver: macvlan
driver_opts:
parent: eth0
com.docker.network.bridge.name: "bridge-mgmt"
ipam:
config:
- subnet: "10.0.32.0/20"
gateway: "10.0.32.1"