MySQL Master-master replication

Source: Internet
Author: User

Set primary-primary replication: 1, set up a user with copy permission on both servers, 2, modify the configuration file: # on the primary server [Mysqld]server-id = 10log-bin = Mysql-binrelay-log = Relay-mysqlrelay-log-index = Relay-mysql.indexauto-increment-increment = 2Auto-increment-offset = 1# from the server [Mysqld]server-id = 20log-bin = Mysql-binrelay-log = Relay-mysqlrelay-log-index = Relay-mysql.indexauto-increment-increment = 2Auto-increment-offset = 23, if the two servers are newly established, and no other write operations, each server only need to record the current binary log files and the location of the event, as an additional server replication start location can 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, each server next specify to another server as its own master server can: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

From for notes (Wiz)

MySQL Master-master replication

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.