Переглянути джерело

Merge branch 'master' of https://code.senomas.com/seno/docker-mysql-replication

DenMaSeno 9 роки тому
батько
коміт
621ac23143
2 змінених файлів з 101 додано та 3 видалено
  1. 101 0
      readme.md
  2. 0 3
      readme.txt

+ 101 - 0
readme.md

@@ -0,0 +1,101 @@
+# MYSQL REPLICATION TEST
+
+## BUILD:
+```
+docker-compose build
+```
+
+### RUN DOCKER:
+```
+docker-compose up
+```
+
+### Check master status:
+```
+./status-master.sh
+```
+result:
+```
++------------------+----------+--------------+------------------+-------------------+
+| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
++------------------+----------+--------------+------------------+-------------------+
+| mysql-bin.000003 |      154 | xbrlgen      |                  |                   |
++------------------+----------+--------------+------------------+-------------------+
+```
+
+make sure File is "mysql-bin.000003" IF NOT
+RUN SQL ON SLAVE:
+```
+CHANGE MASTER TO MASTER_HOST='mysql-master', MASTER_USER='replica', MASTER_PASSWORD='duren123', MASTER_LOG_FILE='mysql-bin.000003', MASTER_LOG_POS=0;
+```
+Then restart slave
+```
+docker restart mysql-slave
+```
+
+
+### Check slave status:
+```
+./status-slave.sh
+```
+make sure no error (Last_IO_Error and Last_SQL_Error)
+
+
+#### Check master data:
+```
+docker exec -ti mysql-master mysql -u root --password=dodol123 xbrlgen
+```
+run sql:
+```
+SHOW TABLES;
+```
+make sure no table exists
+
+
+#### 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
+```
+
+
+#### Check slave data:
+```
+docker exec -ti mysql-slave mysql -u root --password=dodol123 xbrlgen
+```
+Run sql:
+```
+SHOW TABLES;
+```
+make sure table DATA1 exists
+```
+SELECT * FROM DATA1;
+```
+make sure table DATA1 is not empty
+
+
+#### Check replication status:
+```
+./status-master.sh
+```
+check the Position
+```
+./status-slave.sh
+```
+check Exec_Master_Log_Pos equal with <master Position>
+
+
+### CLEAN-UP:
+```
+docker-compose rm -f
+```

+ 0 - 3
readme.txt

@@ -1,3 +0,0 @@
-REPLICATION
-
-