-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
132 lines (127 loc) · 3.22 KB
/
docker-compose.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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
version: '3.4'
services:
mysql_node01:
hostname: mysql_node01
image: garutilorenzo/mysql-innodb-cluster:latest
build:
context: mysql/
args:
- http_proxy=$http_proxy
- https_proxy=$http_proxy
command: --default-authentication-plugin=mysql_native_password
volumes:
- ./config/master.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
- type: volume
source: mysql_node01
target: /var/lib/mysql/
volume:
nocopy: true
cap_add:
- SYS_NICE # CAP_SYS_NICE
networks:
cluster:
ipv4_address: 172.16.0.2
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: test
MYSQL_PASSWORD: P@ssw0rd
MYSQL_DATABASE: db_test
GROUP_NAME: C55153C1-1574-4972-BF06-7332D6AD46A7
BOOTSTRAP: 1
mysql_node02:
hostname: mysql_node02
image: garutilorenzo/mysql-innodb-cluster:latest
build:
context: mysql/
args:
- http_proxy=$http_proxy
- https_proxy=$http_proxy
restart: always
command: --default-authentication-plugin=mysql_native_password
volumes:
- ./config/replica.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
- type: volume
source: mysql_node02
target: /var/lib/mysql/
volume:
nocopy: true
cap_add:
- SYS_NICE # CAP_SYS_NICE
networks:
cluster:
ipv4_address: 172.16.0.3
environment:
MYSQL_ROOT_PASSWORD: root
GROUP_NAME: C55153C1-1574-4972-BF06-7332D6AD46A7
GROUP_SEEDS: mysql_node01:33061,mysql_node03:33061
depends_on:
- "mysql_node01"
mysql_node03:
hostname: mysql_node03
image: garutilorenzo/mysql-innodb-cluster:latest
build:
context: mysql/
args:
- http_proxy=$http_proxy
- https_proxy=$http_proxy
restart: always
command: --default-authentication-plugin=mysql_native_password
volumes:
- ./config/replica-bis.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
- type: volume
source: mysql_node03
target: /var/lib/mysql/
volume:
nocopy: true
cap_add:
- SYS_NICE # CAP_SYS_NICE
networks:
cluster:
ipv4_address: 172.16.0.4
environment:
MYSQL_ROOT_PASSWORD: root
GROUP_NAME: C55153C1-1574-4972-BF06-7332D6AD46A7
GROUP_SEEDS: mysql_node01:33061,mysql_node02:33061
depends_on:
- "mysql_node01"
router:
hostname: router
image: garutilorenzo/mysql-innodb-cluster-router:latest
build:
context: mysqlrouter/
args:
- http_proxy=$http_proxy
- https_proxy=$http_proxy
restart: always
ports:
- "3306:3306"
- "6606:6606"
- "6446-6447:6446-6447"
volumes:
- type: volume
source: mysql_router
target: /var/lib/mysqlrouter
volume:
nocopy: true
networks:
cluster:
ipv4_address: 172.16.0.5
depends_on:
- "mysql_node01"
- "mysql_node02"
- "mysql_node03"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_HOST: mysql_node01
CLUSTERMEMBERS: 3
volumes:
mysql_node01:
mysql_node02:
mysql_node03:
mysql_router:
networks:
cluster:
ipam:
driver: default
config:
- subnet: 172.16.0.0/16