主主复制

双主


主服务器分别创建复制账户
mysql> grant replication slave on *.* to 'repl'@'192.168.31.%' IDENTIFIED BY 'www.c1688.CC';



主主复制

Master01配置:
#vi /etc/my.cnf
[mysqld]
gtid_mode=ON
server-id=1
log-bin=mysql-bin
log-slave-updates
auto_increment_increment=2
auto_increment_offset=1

Master02配置:
#vi /etc/my.cnf
[mysqld]
gtid_mode=ON
server-id=2
log-slave-updates
auto_increment_increment=2
auto_increment_offset=2


启动两台主机salve
mqsql> start slave;





猜你喜欢

转载自blog.csdn.net/qq_28710983/article/details/80914757