Skip to content

Commit 9062e0d

Browse files
author
Vishal Raj
committed
Minor improvements
1 parent 2e9c770 commit 9062e0d

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

docker/master-2-master.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: "3"
22
services:
33
master_1:
44
image: mysql:5.7.27
5+
container_name: ${MASTER_1_HOSTNAME}
56
hostname: ${MASTER_1_HOSTNAME}
67
volumes:
78
- ../conf/master1.cnf:/etc/mysql/conf.d/my.cnf:ro
@@ -14,6 +15,7 @@ services:
1415
ipv4_address: ${MASTER_1_HOST_IP}
1516
master_2:
1617
image: mysql:5.7.27
18+
container_name: ${MASTER_2_HOSTNAME}
1719
hostname: ${MASTER_2_HOSTNAME}
1820
volumes:
1921
- ../conf/master2.cnf:/etc/mysql/conf.d/my.cnf:ro

docker/master-2-slave.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: "3"
22
services:
33
master_1:
44
image: mysql:5.7.27
5+
container_name: ${MASTER_1_HOSTNAME}
56
hostname: ${MASTER_1_HOSTNAME}
67
volumes:
78
- ../conf/master1.cnf:/etc/mysql/conf.d/my.cnf:ro
@@ -14,6 +15,7 @@ services:
1415
ipv4_address: ${MASTER_1_HOST_IP}
1516
slave_1:
1617
image: mysql:5.7.27
18+
container_name: ${SLAVE_1_HOSTNAME}
1719
hostname: ${SLAVE_1_HOSTNAME}
1820
volumes:
1921
- ../conf/slave1.cnf:/etc/mysql/conf.d/my.cnf:ro
@@ -49,6 +51,16 @@ services:
4951
REPL_USER: ${REPL_USER}
5052
REPL_PASSWORD: ${REPL_PASSWORD}
5153
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
5264
networks:
5365
replication_network:
5466
ipam:

docker/slave-2-master-2-master-2-slave.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: "3"
22
services:
33
master_1:
44
image: mysql:5.7.27
5+
container_name: ${MASTER_1_HOSTNAME}
56
hostname: ${MASTER_1_HOSTNAME}
67
volumes:
78
- ../conf/master1.cnf:/etc/mysql/conf.d/my.cnf:ro
@@ -14,6 +15,7 @@ services:
1415
ipv4_address: ${MASTER_1_HOST_IP}
1516
slave_1:
1617
image: mysql:5.7.27
18+
container_name: ${SLAVE_1_HOSTNAME}
1719
hostname: ${SLAVE_1_HOSTNAME}
1820
volumes:
1921
- ../conf/slave1.cnf:/etc/mysql/conf.d/my.cnf:ro
@@ -27,6 +29,7 @@ services:
2729
replication_network:
2830
ipv4_address: ${SLAVE_1_HOST_IP}
2931
master_2:
32+
container_name: ${MASTER_2_HOSTNAME}
3033
image: mysql:5.7.27
3134
hostname: ${MASTER_2_HOSTNAME}
3235
volumes:
@@ -40,6 +43,7 @@ services:
4043
ipv4_address: ${MASTER_2_HOST_IP}
4144
slave_2:
4245
image: mysql:5.7.27
46+
container_name: ${SLAVE_2_HOSTNAME}
4347
hostname: ${SLAVE_2_HOSTNAME}
4448
volumes:
4549
- ../conf/slave2.cnf:/etc/mysql/conf.d/my.cnf:ro

start

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source check_params.sh
66

77
check_docker_config
88

9-
if [ $file_found -eq 1 ]
9+
if [ $file_found -eq 1 ];
1010
then
1111
echo Using docker configuration file : $file
1212
echo

stop

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ source check_params.sh
66

77
check_docker_config
88

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
1215

13-
if [ "$2" == "clean" ]
16+
if [ "$2" == "clean" ];
1417
then
1518
for node in "master" "slave"
1619
do

0 commit comments

Comments
 (0)