zhaiyuzhen 发表于 2016-07-26 14:24

innobackupex还原导致双主复制失败?

本帖最后由 zhaiyuzhen 于 2016-07-26 14:25 编辑

A、B两台数据库配置了双主复制,在A服务器上用:innobackupex --user=root --password='123456' --databases=test10/opt/backup备份了test10,然后用:innobackupex --defaults-file=/etc/my.cnf --copy-back /opt/backup/2016-07-25_14-34-10
chown -R mysql:mysql /opt/mysql
service mysql start恢复后,发现B已经不能复制A的数据变化,是我操作有误么?谢谢大家!

ning_lianjie 发表于 2016-07-26 14:57

有没有指定正确的pos位置,操作步骤和报错是什么?

zhaiyuzhen 发表于 2016-07-26 16:43

备份:
innobackupex --user=root --password='123456' --apply-log --no-timestamp /opt/backup
innobackupex --user=root --password='123456' --apply-log/opt/backup

还原:
service mysql stop
cd /opt/mysql
rm -rf data-old
mv data data-old
innobackupex --defaults-file=/etc/my.cnf --copy-back /opt/backup
chown -R mysql:mysql /opt/mysql
service mysql start

zhaiyuzhen 发表于 2016-07-26 16:45

恢复前 A主机:
mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000012 |      559 |            |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
恢复后:
mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000001 |      120 |            |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)

zhaiyuzhen 发表于 2016-07-26 16:46

然后B主机上的 show slave status\G:
有一句:
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'

zhaiyuzhen 发表于 2016-07-26 16:47

看样子好像是A主机恢复后binlog变了。。。。
页: [1]
查看完整版本: innobackupex还原导致双主复制失败?