mysql主-主复制
时间:2021-07-01 10:21:17
帮助过:29人阅读
auto-increment-offset = 1 # 从服务器上[mysqld]server-id = 20log-bin = mysql-binrelay-log = relay-mysqlrelay-log-index = relay-mysql.index
auto-increment-increment = 2auto-increment-offset = 2 3、如果此时两台服务器均为新建立,且无其它写入操作,各服务器只需记录当前自己二进制日志文件及事件位置,以之作为另外的服务器复制起始位置即可 server1|mysql> SHOW MASTER STATUS\G************************** 1. row *************************** File: mysql-bin.000001 Position: 710 Binlog_Do_DB:Binlog_Ignore_DB:1 row in set (0.00 sec) server2|mysql> SHOW MASTER STATUS\Gmysql> SHOW MASTER STATUS\G*************************** 1. row *************************** File: mysql-bin.000003 Position: 811 Binlog_Do_DB:Binlog_Ignore_DB:1 row in set (0.00 sec) 4、各服务器接下来指定对另一台服务器为自己的主服务器即可:server1|mysql> CHANGE MASTER TO ...,MASTER_LOG_FILE=‘mysql-bin.000003‘, MASTER_LOG_POS=811 server2|mysql> CHANGE MASTER TO ...,MASTER_LOG_FILE=‘mysql-bin.000001‘, MASTER_LOG_POS=710
来自为知笔记(Wiz)
mysql主-主复制
标签:配置文件 服务器 mysql style 用户