File tree 5 files changed +26
-5
lines changed
5 files changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ version: "3"
2
2
services :
3
3
master_1 :
4
4
image : mysql:5.7.27
5
+ container_name : ${MASTER_1_HOSTNAME}
5
6
hostname : ${MASTER_1_HOSTNAME}
6
7
volumes :
7
8
- ../conf/master1.cnf:/etc/mysql/conf.d/my.cnf:ro
@@ -14,6 +15,7 @@ services:
14
15
ipv4_address : ${MASTER_1_HOST_IP}
15
16
master_2 :
16
17
image : mysql:5.7.27
18
+ container_name : ${MASTER_2_HOSTNAME}
17
19
hostname : ${MASTER_2_HOSTNAME}
18
20
volumes :
19
21
- ../conf/master2.cnf:/etc/mysql/conf.d/my.cnf:ro
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ version: "3"
2
2
services :
3
3
master_1 :
4
4
image : mysql:5.7.27
5
+ container_name : ${MASTER_1_HOSTNAME}
5
6
hostname : ${MASTER_1_HOSTNAME}
6
7
volumes :
7
8
- ../conf/master1.cnf:/etc/mysql/conf.d/my.cnf:ro
@@ -14,6 +15,7 @@ services:
14
15
ipv4_address : ${MASTER_1_HOST_IP}
15
16
slave_1 :
16
17
image : mysql:5.7.27
18
+ container_name : ${SLAVE_1_HOSTNAME}
17
19
hostname : ${SLAVE_1_HOSTNAME}
18
20
volumes :
19
21
- ../conf/slave1.cnf:/etc/mysql/conf.d/my.cnf:ro
@@ -49,6 +51,16 @@ services:
49
51
REPL_USER : ${REPL_USER}
50
52
REPL_PASSWORD : ${REPL_PASSWORD}
51
53
command : bash ${REPL_SCRIPT_MOUNT_PATH}/master-2-slave.sh
54
+ pma :
55
+ image : phpmyadmin:phpmyadmin
56
+ container_name : phpmyadmin
57
+ environment :
58
+ PMA_ARBITRARY=1
59
+ restart : always
60
+ ports :
61
+ - 8080:80
62
+ volumes :
63
+ - /sessions
52
64
networks :
53
65
replication_network :
54
66
ipam :
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ version: "3"
2
2
services :
3
3
master_1 :
4
4
image : mysql:5.7.27
5
+ container_name : ${MASTER_1_HOSTNAME}
5
6
hostname : ${MASTER_1_HOSTNAME}
6
7
volumes :
7
8
- ../conf/master1.cnf:/etc/mysql/conf.d/my.cnf:ro
@@ -14,6 +15,7 @@ services:
14
15
ipv4_address : ${MASTER_1_HOST_IP}
15
16
slave_1 :
16
17
image : mysql:5.7.27
18
+ container_name : ${SLAVE_1_HOSTNAME}
17
19
hostname : ${SLAVE_1_HOSTNAME}
18
20
volumes :
19
21
- ../conf/slave1.cnf:/etc/mysql/conf.d/my.cnf:ro
@@ -27,6 +29,7 @@ services:
27
29
replication_network :
28
30
ipv4_address : ${SLAVE_1_HOST_IP}
29
31
master_2 :
32
+ container_name : ${MASTER_2_HOSTNAME}
30
33
image : mysql:5.7.27
31
34
hostname : ${MASTER_2_HOSTNAME}
32
35
volumes :
@@ -40,6 +43,7 @@ services:
40
43
ipv4_address : ${MASTER_2_HOST_IP}
41
44
slave_2 :
42
45
image : mysql:5.7.27
46
+ container_name : ${SLAVE_2_HOSTNAME}
43
47
hostname : ${SLAVE_2_HOSTNAME}
44
48
volumes :
45
49
- ../conf/slave2.cnf:/etc/mysql/conf.d/my.cnf:ro
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ source check_params.sh
6
6
7
7
check_docker_config
8
8
9
- if [ $file_found -eq 1 ]
9
+ if [ $file_found -eq 1 ];
10
10
then
11
11
echo Using docker configuration file : $file
12
12
echo
Original file line number Diff line number Diff line change @@ -6,11 +6,14 @@ source check_params.sh
6
6
7
7
check_docker_config
8
8
9
- echo " Using configuration file $file "
10
- echo
11
- docker-compose -f $file down
9
+ if [ $file_found -eq 1 ];
10
+ then
11
+ echo " Using configuration file $file "
12
+ echo
13
+ docker-compose -f $file down
14
+ fi
12
15
13
- if [ " $2 " == " clean" ]
16
+ if [ " $2 " == " clean" ];
14
17
then
15
18
for node in " master" " slave"
16
19
do
You can’t perform that action at this time.
0 commit comments