How does MySQL achieve two-way mutual primary replication?

Source: Internet
Author: User

bidirectional Mutual Master from step:

12 machines Add a cluster machine access to the account given replication slave permissions

mysql> grant replication Slave on * * to ' rep ' @ ' 172.16.1.% ' identified by ' 1234566 ';

22 Machine parameter Configuration

Log_bin =/data/3307/mysql-bin

Log-slave-update

Relay-log =/data/3307/relay-bin Turn on the trunk log

server_id = 1 Another set to 2

Auto_increment-offset = 1 Start value another set to 2

Auto_increment-increment = 2 Step

3 from the boot server

/etc/init.dmysqld restart

42 servers change from one master to another

Change MASTER to

Master_host = ' HOST ', #另一台机器的地址

Master_port = 3306, #另一台机器的端口

Master_user = ' rep ', #另一台机器上第一步分配的用户名

Master_password = ' 123456 ', #另一台机器上第一步分配的密码

Master_log_file = ' mysql-bin.000001 ', #另一台机器上执行得到的文件名

Master_log_pos = 192; #另一台机器上得到的偏移量

If the master-slave replication is based on Gtid, don't look for Binglog and Pos points

Master_auto_position=1; #加上这个参数就可以


How does MySQL achieve two-way mutual primary replication?

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.