MYSQL-GTID复制
一,my.cnf增加配置
################################################# #------------------GTID主从---------------------# server-id = 210 gtid_mode = ON enforce_gtid_consistency = ON #强制gtid一致性,开启后对于特定create table不被支持 log_slave_updates = ON #从库开启binlog记录执行过的GTID,5.6必须开启,5.7版本后非必须,影响从库IO性能 slave_parallel_workers = 4 #开启基于库的多线程复制默认0不开启
二、重启mysql
三、master增加同步用户
grant replication slave on *.* to 'gtid'@'10.11.0.%' identified by '123456';
四、slave端建立连接
change master to master_host='10.11.0.209', master_port=3306, master_user='gtid', master_password='123456', master_auto_position=1; start slave;