Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:主主同步master2 auto-increment-offset 应为2,防止自增冲突 #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mysql/MySQL主主同步复制.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ binlog-ignore-db = mysql #忽略同步的数据库
log-slave-updates #把从库的写操作记录到binlog中 (缺少之后,双主创建失败)
expire_logs_days = 365 #日志文件过期天数,默认是 0,表示不过期
auto-increment-increment= 2 #设定为主服务器的数量,防止auto_increment字段重复
auto-increment-offset = 1 #自增长字段的初始值,在多台master环境下,不会出现自增长ID重复
auto-increment-offset = 2 #自增长字段的初始值,在多台master环境下,不会出现自增长ID重复
```

##### 创建帐号密码并授权
Expand Down Expand Up @@ -231,4 +231,4 @@ mysql> select * from employee;
| 7 | d |
+----+------+
4 rows in set (0.00 sec)
```
```