主从的版本:5.7.25-28-log
现状:
将主库的全备(innobackupex)还原作为一个从库,还原的过程正常,在设置从库报错:
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.'
具体的操作过程是:
STOP SLAVE;
RESET SLAVE;
reset master ;
SET GLOBAL gtid_purged='xtrabackup_binlog_info文件获取的GTID值 '
此处的GTID是从备份恢复过来的文件:xtrabackup_binlog_info上获取,如下截图:
CHANGE MASTER TO MASTER_HOST='192.168.1.221', MASTER_PORT=3306, MASTER_USER='repl', MASTER_PASSWORD='uyIVUpxYZ6ai', MASTER_AUTO_POSITION=1;
show slave status就报错了:
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.'
请问知道这是什么原因吗?
首次同步可以先用MASTER_LOG_FILE+MASTER_LOG_POS执行恢复同步 然后修改成MASTER_AUTO_POSITION=1
收起