主MySQL服务器 172.16.1.10

授权 172.16.1.10 权限
grant replication slave on *.* to 'slave'@'172.16.1.11' identified by 'king123';
[mysqld]
log-bin=aaa_10
server-id=1
master-host=172.16.1.11
master-user=slave
master-password=king123
auto-increment-increment=2
auto-increment-offset=1

主MySQL服务器 172.16.1.11

授权172.16.1.10 权限
grant replication slave on *.* to 'slave'@'172.16.1.10' identified by 'king123';
[mysqld]
log-bin=bb_11
server-id=2
master-host=172.16.1.10
master-user=slave
master-password=king123
auto-increment-increment=2
auto-increment-offset=2