GTID复制的搭建和问题处理
2018-06-17 23:46:25来源:未知 阅读 ()
CHANGE MASTER TO MASTER_HOST='',MASTER_PORT=3306,MASTER_USER='repl',MASTER_PASSWORD='*****',MASTER_LOG_FILE='mysqlbinlog.000003',MASTER_LOG_POS=99721204;
CHANGE MASTER TO MASTER_HOST='****', MASTER_USER='repl', MASTER_PASSWORD='******', MASTER_PORT=3306, master_auto_position=1;
root@perconatest09:23:44>show global variables like 'GTID_%'\G *************************** 1. row *************************** Variable_name: gtid_executed Value: 5031589f-3551-11e7-89a0-00505693235d:1-12, 806ede0c-357e-11e7-9719-00505693235d:1-11, a38c33ee-34b7-11e7-ae1d-005056931959:1-24 *************************** 2. row *************************** Variable_name: gtid_executed_compression_period Value: 1000 *************************** 3. row *************************** Variable_name: gtid_mode Value: ON *************************** 4. row *************************** Variable_name: gtid_owned Value: *************************** 5. row *************************** Variable_name: gtid_purged Value: 5031589f-3551-11e7-89a0-00505693235d:1-12, 806ede0c-357e-11e7-9719-00505693235d:1-11, a38c33ee-34b7-11e7-ae1d-005056931959:1-12
root@perconatest09:23:58>show global variables like 'GTID_e%'\G *************************** 1. row *************************** Variable_name: gtid_executed Value: 5031589f-3551-11e7-89a0-00505693235d:1-12, 806ede0c-357e-11e7-9719-00505693235d:1-11, a38c33ee-34b7-11e7-ae1d-005056931959:1-24 2 rows in set (0.01 sec) root@perconatest09:41:33>show global variables like 'GTID_p%'\G *************************** 1. row *************************** Variable_name: gtid_purged Value: 5031589f-3551-11e7-89a0-00505693235d:1-12, 806ede0c-357e-11e7-9719-00505693235d:1-11, a38c33ee-34b7-11e7-ae1d-005056931959:1-12 1 row in set (0.01 sec)
mysqldump -uroot -p --set-gtid-purged=off --single-transaction --triggers --routines --all-databases> /home/sa/backup.sql
[root@localhost sa]# head -30 backup.sql
SET @@GLOBAL.GTID_PURGED='5031589f-3551-11e7-89a0-00505693235d:1-12, 806ede0c-357e-11e7-9719-00505693235d:1-11, a38c33ee-34b7-11e7-ae1d-005056931959:1-24';
show global variables like 'gtid_executed'; show global variables like 'gtid_purged';
CHANGE MASTER TO MASTER_HOST="***", MASTER_USER="root", MASTER_PASSWORD="*****", MASTER_PORT=3306, MASTER_AUTO_POSITION = 1;
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.'
提示我们找不到日志,主从复制就会停掉,下面我们看一下处理方式:
root@perconatest09:41:38>show global variables like 'GTID_EXECUTED'; +---------------+---------------------------------------------------------------------------------------------------------------------------------+ | Variable_name | Value | +---------------+---------------------------------------------------------------------------------------------------------------------------------+ | gtid_executed | 5031589f-3551-11e7-89a0-00505693235d:1-12, 806ede0c-357e-11e7-9719-00505693235d:1-11, a38c33ee-34b7-11e7-ae1d-005056931959:1-24 | +---------------+---------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.01 sec)
root@(none)03:04:49>set global GTID_PURGED='5031589f-3551-11e7-89a0-00505693235d:1-12,806ede0c-357e-11e7-9719-00505693235d:1-11,a38c33ee-34b7-11e7-ae1d-005056931959:1-24';
root@(none)03:04:49>reset master; root@(none)03:04:49>set global GTID_PURGED='5031589f-3551-11e7-89a0-00505693235d:1-12,806ede0c-357e-11e7-9719-00505693235d:1-11,a38c33ee-34b7-11e7-ae1d-005056931959:1-24'; root@(none)03:04:49>start slave; root@(none)03:04:49>show slave status\G
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- MySQL 主从复制(实时热备)原理与配置 2019-08-13
- 面试必问!5 分钟带你搞定 Redis 复制(会的举个手) 2019-08-09
- 如何保障MySQL主从复制关系的稳定性?关键词(新特性、crash 2019-07-24
- mysql中用命令行复制表结构(数据) 2019-07-24
- MySQL基础之二:主从复制 2019-07-24
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash