readme.txt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. MYSQL REPLICATION TEST
  2. BUILD:
  3. docker-compose build
  4. RUN:
  5. docker-compose up
  6. RUN:
  7. ./status-master.sh
  8. result:
  9. +------------------+----------+--------------+------------------+-------------------+
  10. | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
  11. +------------------+----------+--------------+------------------+-------------------+
  12. | mysql-bin.000003 | 154 | xbrlgen | | |
  13. +------------------+----------+--------------+------------------+-------------------+
  14. make sure File is "mysql-bin.000003" IF NOT
  15. RUN SQL ON SLAVE:
  16. CHANGE MASTER TO MASTER_HOST='mysql-master', MASTER_USER='replica', MASTER_PASSWORD='duren123', MASTER_LOG_FILE='mysql-bin.000003', MASTER_LOG_POS=0;
  17. RESTART slave
  18. RUN:
  19. ./status-slave.sh
  20. make sure no error (Last_IO_Error and Last_SQL_Error)
  21. TEST:
  22. Check slave data:
  23. docker exec -ti mysql-master mysql -u root --password=dodol123 xbrlgen
  24. run sql:
  25. SHOW TABLES;
  26. make sure no table exists
  27. Run test sql on master:
  28. docker exec -i mysql-master mysql -u root --password=dodol123 xbrlgen < test.sql
  29. Check slave data:
  30. docker exec -ti mysql-master mysql -u root --password=dodol123 xbrlgen
  31. run sql:
  32. SHOW TABLES;
  33. make sure table DATA1 exists
  34. SELECT * FROM DATA1;
  35. make sure table DATA1 is not empty
  36. RUN:
  37. ./status-master.sh
  38. check the Position
  39. ./status-slave.sh
  40. check Exec_Master_Log_Pos equal with <master Position>