对于master-master复制,我遇到了自动增量复制问题。然后,我设置:
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 99999;这将跳过9999个查询。然后我做到了:
SHOW SLAVE STATUS\G
Slave_IO_Running: Yes
Slave_SQL_Running: Yes它看起来运行得很好。
但是,当然,由于我跳过了99999 statements...if,所以我在数据库1上进行了更改,它不会在传递的数据库2...until 99999语句中反映出来。对,是这样?
嗯……我创建了一个脚本,自动将999999行插入到一个虚拟表中。这应该足够了,对吧?我的两个数据库应该再次同步吗?
但是,我在第300万行,它似乎不起作用。我的数据库2仍然没有我刚刚在数据库1上创建的这300万行。
发布于 2011-01-14 00:24:32
i.e.
master-1 only creates ids as: 1,11,21,31,41...
master-2 only creates ids as: 2,12,22,32,42...
On master-1, add this to the my.cnf
auto_increment_increment = 10
auto_increment_offset = 1
on master-2, and this to the my.cnf
auto_increment_increment = 10
auto_increment_offset = 2现在它们永远不会相撞了。
发布于 2010-11-30 23:35:54
我在这样的实例中所做的是:
表现在应该是同步的。
https://stackoverflow.com/questions/1870001
复制相似问题