|
@@ -1,16 +1,16 @@
|
|
-#MYSQL REPLICATION TEST
|
|
|
|
|
|
+# MYSQL REPLICATION TEST
|
|
|
|
|
|
-##BUILD:
|
|
|
|
|
|
+## BUILD:
|
|
```
|
|
```
|
|
docker-compose build
|
|
docker-compose build
|
|
```
|
|
```
|
|
|
|
|
|
-##RUN:
|
|
|
|
|
|
+### RUN DOCKER:
|
|
```
|
|
```
|
|
docker-compose up
|
|
docker-compose up
|
|
```
|
|
```
|
|
|
|
|
|
-###RUN:
|
|
|
|
|
|
+### Check master status:
|
|
```
|
|
```
|
|
./status-master.sh
|
|
./status-master.sh
|
|
```
|
|
```
|
|
@@ -33,14 +33,15 @@ Then restart slave
|
|
docker restart mysql-slave
|
|
docker restart mysql-slave
|
|
```
|
|
```
|
|
|
|
|
|
-###RUN:
|
|
|
|
|
|
+
|
|
|
|
+### Check slave status:
|
|
```
|
|
```
|
|
./status-slave.sh
|
|
./status-slave.sh
|
|
```
|
|
```
|
|
make sure no error (Last_IO_Error and Last_SQL_Error)
|
|
make sure no error (Last_IO_Error and Last_SQL_Error)
|
|
|
|
|
|
-###TEST:
|
|
|
|
-Check slave data:
|
|
|
|
|
|
+
|
|
|
|
+#### Check master data:
|
|
```
|
|
```
|
|
docker exec -ti mysql-master mysql -u root --password=dodol123 xbrlgen
|
|
docker exec -ti mysql-master mysql -u root --password=dodol123 xbrlgen
|
|
```
|
|
```
|
|
@@ -50,14 +51,27 @@ SHOW TABLES;
|
|
```
|
|
```
|
|
make sure no table exists
|
|
make sure no table exists
|
|
|
|
|
|
-###Run test sql on master:
|
|
|
|
|
|
+
|
|
|
|
+#### Check slave data:
|
|
|
|
+```
|
|
|
|
+docker exec -ti mysql-slave mysql -u root --password=dodol123 xbrlgen
|
|
|
|
+```
|
|
|
|
+Run sql:
|
|
|
|
+```
|
|
|
|
+SHOW TABLES;
|
|
|
|
+```
|
|
|
|
+make sure no table exists
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+#### Run test sql on master:
|
|
```
|
|
```
|
|
docker exec -i mysql-master mysql -u root --password=dodol123 xbrlgen < test.sql
|
|
docker exec -i mysql-master mysql -u root --password=dodol123 xbrlgen < test.sql
|
|
```
|
|
```
|
|
|
|
|
|
-###Check slave data:
|
|
|
|
|
|
+
|
|
|
|
+#### Check slave data:
|
|
```
|
|
```
|
|
-docker exec -ti mysql-master mysql -u root --password=dodol123 xbrlgen
|
|
|
|
|
|
+docker exec -ti mysql-slave mysql -u root --password=dodol123 xbrlgen
|
|
```
|
|
```
|
|
Run sql:
|
|
Run sql:
|
|
```
|
|
```
|
|
@@ -69,7 +83,8 @@ SELECT * FROM DATA1;
|
|
```
|
|
```
|
|
make sure table DATA1 is not empty
|
|
make sure table DATA1 is not empty
|
|
|
|
|
|
-###RUN:
|
|
|
|
|
|
+
|
|
|
|
+#### Check replication status:
|
|
```
|
|
```
|
|
./status-master.sh
|
|
./status-master.sh
|
|
```
|
|
```
|
|
@@ -80,7 +95,7 @@ check the Position
|
|
check Exec_Master_Log_Pos equal with <master Position>
|
|
check Exec_Master_Log_Pos equal with <master Position>
|
|
|
|
|
|
|
|
|
|
-###CLEAN-UP:
|
|
|
|
|
|
+### CLEAN-UP:
|
|
```
|
|
```
|
|
docker-compose rm -f
|
|
docker-compose rm -f
|
|
```
|
|
```
|