-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
92 lines (82 loc) · 2.19 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
version: "3.4"
x-env-files: &env-files
env_file:
- .env
x-logging: &logging
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
volumes:
cluster_data_vol:
services:
mysql-manager-1:
image: mysql-cluster
<<: *env-files
logging: *logging
networks:
- db-network
restart: always
command: ndb_mgmd --ndb-nodeid=1
mysql-manager-2:
image: mysql-cluster
<<: *env-files
logging: *logging
networks:
- db-network
restart: always
command: ndb_mgmd --ndb-nodeid=2
data-node-1:
image: mysql-cluster
<<: *env-files
logging: *logging
depends_on:
- mysql-manager-1
- mysql-manager-2
networks:
- db-network
restart: always
volumes:
- cluster_data_vol:/var/lib/mysql
command: ndbd --ndb-nodeid=11 --nowait-nodes=3 --initial-start --connect-string="nodeid=1;host=mysql-manager-1:1186"
data-node-2:
image: mysql-cluster
<<: *env-files
logging: *logging
depends_on:
- mysql-manager-1
- mysql-manager-2
networks:
- db-network
restart: always
volumes:
- cluster_data_vol:/var/lib/mysql
command: ndbd --ndb-nodeid=12 --nowait-nodes=3 --initial-start --connect-string="nodeid=1;host=mysql-manager-1:1186"
mysql-server-1:
image: mysql-cluster
<<: *env-files
logging: *logging
depends_on:
- mysql-manager-1
- mysql-manager-2
networks:
- db-network
restart: always
command: mysqld --user=mysql --connect-string="nodeid=1;host=mysql-manager-1:1186;host=mysql-manager-2:1186"
ports:
- 3306:3306
mysql-server-2:
image: mysql-cluster
<<: *env-files
logging: *logging
depends_on:
- mysql-manager-1
- mysql-manager-2
networks:
- db-network
restart: always
command: mysqld --user=mysql --connect-string="nodeid=1;host=mysql-manager-1:1186;host=mysql-manager-2:1186"
ports:
- 3307:3306
networks:
db-network: