MySQL主主复制配置注意事项【转】

MySQL中对于表上ID自增列可以在创建表的时候指定列上的auto_increment属性和auto_increment_offset属性。
auto_increment_increment控制列中的值的增量值,也就是步长。
auto_increment_offset确定AUTO_INCREMENT列值的起点,也就是初始值。

 

log-slave-updates = true     #将复制事件写入binlog,一台服务器既做主库又做从库此选项必须要开启

#masterA自增长ID
auto_increment_offset = 1
auto_increment_increment = 2       #奇数ID                                   

 
#masterB自增加ID
auto_increment_offset = 2
auto_increment_increment = 2        #偶数ID

 

参考
作者:XiaoMing丶
链接:https://www.jianshu.com/p/f63a4e7941e2
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

 

MySQL双主(主主)架构方案 - ygqygq2 - 博客园

https://www.cnblogs.com/ygqygq2/p/6045279.html

posted @ 2021-07-09 11:31  paul_hch  阅读(87)  评论(0编辑  收藏  举报