1.备份数据
mysqldump -uroot -p --all-databases --single-transaction --triggers --routines --events > /opt/backup/onlinedata-backup/2020-01-17/slave-01-2020-01-17.sql
2.从备份数据中获取 GTID_PURGED
# grep GTID_PURGED /tmp/alldb.sql
SET @@GLOBAL.GTID_PURGED='31d7e420-69a7-11e8-a75c-00163e0684c7:1-9199686819
3.导入数据
4.重置主从
reset master
reset slave all
5.配置主从