mysql> select * from t_order; +----+------+ | id | name | +----+------+ | 2 | A | | 4 | B | +----+------+ 2 rows in set (0.00 sec) 可以发现master2中id的步长为2,且从2开始自增。
然后在master1查询数据,并添加:
mysql> select * from t_order; +----+------+ | id | name | +----+------+ | 2 | A | | 4 | B | +----+------+ 2 rows in set (0.00 sec)
mysql> select * from t_order; +----+------+ | id | name | +----+------+ | 2 | A | | 4 | B | | 5 | E | +----+------+ 3 rows in set (0.00 sec) 可以发现master1中id的步长为2,且从1开始自增,再去master2中查询能发现id为5的数据,说明主主复制配置没有问题。