forked from mlucasdasilva/cluster-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
86 lines (84 loc) · 2.16 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
version: '2'
#version: '3.1'
services:
management1:
image: mysql/mysql-cluster
volumes:
- ./mysql.conf/my.cnf:/etc/my.cnf
- ./mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf
#command: "ndb_mgmd --ndb-nodeid=1"
command: ndb_mgmd
networks:
mysqlcluster:
# ipv4_address: 192.168.0.2
ipv4_address: 172.28.0.2
ndb1:
image: mysql/mysql-cluster
volumes:
- ./mysql.conf/my.cnf:/etc/my.cnf
- ./mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf
#command: bash -c 'sleep 40; exec ndbd'
command: ndbd
depends_on:
- "management1"
networks:
mysqlcluster:
# ipv4_address: 192.168.0.3
ipv4_address: 172.28.0.3
ndb2:
image: mysql/mysql-cluster
volumes:
- ./mysql.conf/my.cnf:/etc/my.cnf
- ./mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf
#command: bash -c 'sleep 40; exec ndbd'
command: ndbd
depends_on:
- "management1"
networks:
mysqlcluster:
# ipv4_address: 192.168.0.4
ipv4_address: 172.28.0.4
mysql1:
image: mysql/mysql-cluster
ports:
- "3306:3306"
volumes:
- ./mysql.conf/my.cnf:/etc/my.cnf
- ./mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf
# restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: bdteste
MYSQL_USER: teste
MYSQL_PASSWORD: teste
MYSQL_ROOT_HOST: '%'
#command: bash -c 'sleep 60; exec mysqld'
command: mysqld
depends_on:
- "management1"
- "ndb1"
- "ndb2"
networks:
mysqlcluster:
# ipv4_address: 192.168.0.10
ipv4_address: 172.28.0.10
adminer:
image: adminer
restart: always
ports:
- 8081:8080
links:
- mysql1:db
networks:
mysqlcluster:
networks:
mysqlcluster:
# driver: overlay
driver: bridge
ipam:
config:
# - subnet: 192.168.0.0/16
- subnet: 172.28.0.0/16
gateway: 172.28.5.254
## - ip-range: 172.28.5.0/24
# docker run -it -v "$PWD/mysql.conf/my.cnf:/etc/my.cnf" -v "$PWD/mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf" --net=mysqlcluster_mysqlcluster mysql/mysql-cluster ndb_mgm