MYSQL????GTID?????
?????????? ???????[ 2016/9/28 11:47:23 ] ????????????? MySQL
????1.????
??????MYSQL5.6 ?????mysql??????GTID?????
???????????????????
?????????????????????????????????????????????????????????????????????????????
????????GTID?????
????1.????????????????????????е??????GTID???
????2.???????????ЩGTID??????б???С?
??????????????????????????Ρ?
????????GTID
????GTID?????????ID??????????????????????????????????п????????????ID.
????GTID=source_id:transaction_id
????source_id:???????server UUID????????????auto.cnf ????С?
????transaction_id: ??1???????????С?
????2.????GTID????????
????1.????DB???????????????????
???????????????????
????2.????????????????
????bin_log =mysql-bin
????server_id=1001
????gtid_mode=on
????enforce-gtid-consiste:???????????????????????
????????????
????1.create table ????select
????2.???????????create temporary table ????????????ù????????????????????
????log-slave-updates=on
?????????????м????????????????????????????
???????GTID 5.6 ?????????????5.7???????á?
????3.????????????
????server_id=1002
????relay_log=relay_log
????gtid_mode=on
????enforce-gtid-consistency
????????????
????read_only=on
??????????????????????
????master_info_reposistory=TABLE
????relay_log_info_reposistory=TABLE
???????????????????????????????м????????? master_info????relay_log?С?
????4.?????????????????
????mysqldump --master-data=2 -single-transaction
????xtarbackup –slave-info
???????????????????GTID???
????????????
????mysqldump --single-transaction --master-data=2 --triggers -routines --all-databases -uroot -p -P3308 >all2.sql
????????????
????mysql -uroot -p -P3309 < all2.sql
????5.???????GTID?????
????change master to master-host=’??????IP’??
????master_user=’repl’??
????master_password=’password’??
????master_auto_position=1
????change master to MASTER_HOST='192.168.1.106'??
????MASTER_PORT=3308??
????MASTER_USER='repl'??
????MASTER_PASSWORD='repl'??
????master_auto_position=1;
????start slave;
????show slave status G;
????image
?????????slave??????
????ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
???????????
????reset slave;????slave
????????? slave
????start slave;
?????????????
????1.?????????????????????
????2.???????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11